lib/twilio-ruby/rest/api/v2010/account/call.rb in twilio-ruby-5.38.0 vs lib/twilio-ruby/rest/api/v2010/account/call.rb in twilio-ruby-5.39.0
- old
+ new
@@ -29,12 +29,11 @@
# Components
@feedback_summaries = nil
end
##
- # Retrieve a single page of CallInstance records from the API.
- # Request is executed immediately.
+ # Create the CallInstance
# @param [String] to The phone number, SIP address, or client identifier to call.
# @param [String] from The phone number or client identifier to use as the caller
# id. If using a phone number, it must be a Twilio number or a Verified [outgoing
# caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your
# account. If the `to` parameter is a phone number, `From` must also be a phone
@@ -150,11 +149,11 @@
# @param [String] twiml TwiML instructions for the call Twilio will use without
# fetching Twiml from url parameter. If both `twiml` and `url` are provided then
# `twiml` parameter will be ignored.
# @param [String] application_sid The SID of the Application resource that will
# handle the call, if the call will be handled by an application.
- # @return [CallInstance] Newly created CallInstance
+ # @return [CallInstance] Created CallInstance
def create(to: nil, from: nil, method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_event: :unset, status_callback_method: :unset, send_digits: :unset, timeout: :unset, record: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, machine_detection: :unset, machine_detection_timeout: :unset, recording_status_callback_event: :unset, trim: :unset, caller_id: :unset, machine_detection_speech_threshold: :unset, machine_detection_speech_end_threshold: :unset, machine_detection_silence_timeout: :unset, async_amd: :unset, async_amd_status_callback: :unset, async_amd_status_callback_method: :unset, byoc: :unset, call_reason: :unset, url: :unset, twiml: :unset, application_sid: :unset)
data = Twilio::Values.of({
'To' => to,
'From' => from,
'Url' => url,
@@ -187,15 +186,11 @@
'AsyncAmdStatusCallbackMethod' => async_amd_status_callback_method,
'Byoc' => byoc,
'CallReason' => call_reason,
})
- payload = @version.create(
- 'POST',
- @uri,
- data: data
- )
+ payload = @version.create('POST', @uri, data: data)
CallInstance.new(@version, payload, account_sid: @solution[:account_sid], )
end
##
@@ -337,15 +332,13 @@
'EndTime>' => Twilio.serialize_iso8601_datetime(end_time_after),
'PageToken' => page_token,
'Page' => page_number,
'PageSize' => page_size,
})
- response = @version.page(
- 'GET',
- @uri,
- params
- )
+
+ response = @version.page('GET', @uri, params)
+
CallPage.new(@version, response, @solution)
end
##
# Retrieve a single page of CallInstance records from the API.
@@ -434,28 +427,22 @@
@feedback = nil
@payments = nil
end
##
- # Deletes the CallInstance
+ # Delete the CallInstance
# @return [Boolean] true if delete succeeds, false otherwise
def delete
- @version.delete('delete', @uri)
+ @version.delete('DELETE', @uri)
end
##
- # Fetch a CallInstance
+ # Fetch the CallInstance
# @return [CallInstance] Fetched CallInstance
def fetch
- params = Twilio::Values.of({})
+ payload = @version.fetch('GET', @uri)
- payload = @version.fetch(
- 'GET',
- @uri,
- params,
- )
-
CallInstance.new(@version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], )
end
##
# Update the CallInstance
@@ -499,15 +486,11 @@
'StatusCallback' => status_callback,
'StatusCallbackMethod' => status_callback_method,
'Twiml' => twiml,
})
- payload = @version.update(
- 'POST',
- @uri,
- data: data,
- )
+ payload = @version.update('POST', @uri, data: data)
CallInstance.new(@version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], )
end
##
@@ -820,17 +803,17 @@
def subresource_uris
@properties['subresource_uris']
end
##
- # Deletes the CallInstance
+ # Delete the CallInstance
# @return [Boolean] true if delete succeeds, false otherwise
def delete
context.delete
end
##
- # Fetch a CallInstance
+ # Fetch the CallInstance
# @return [CallInstance] Fetched CallInstance
def fetch
context.fetch
end
\ No newline at end of file