lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb in twilio-ruby-5.0.0.rc21 vs lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb in twilio-ruby-5.0.0.rc22
- old
+ new
@@ -93,27 +93,40 @@
# Request is executed immediately.
# @param [String] page_token PageToken provided by the API
# @param [Integer] page_number Page Number, this value is simply for client state
# @param [Integer] page_size Number of records to return, defaults to 50
# @return [Page] Page of DomainInstance
- def page(page_token: nil, page_number: nil, page_size: nil)
- params = {
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
+ params = Twilio::Values.of({
'PageToken' => page_token,
'Page' => page_number,
'PageSize' => page_size,
- }
+ })
response = @version.page(
'GET',
@uri,
params
)
- return DomainPage.new(@version, response, @solution)
+ DomainPage.new(@version, response, @solution)
end
##
# Retrieve a single page of DomainInstance records from the API.
# Request is executed immediately.
+ # @param [String] target_url API-generated URL for the requested results page
+ # @return [Page] Page of DomainInstance
+ def get_page(target_url)
+ response = @version.domain.request(
+ 'GET',
+ target_url
+ )
+ DomainPage.new(@version, response, @solution)
+ end
+
+ ##
+ # Retrieve a single page of DomainInstance records from the API.
+ # Request is executed immediately.
# @param [String] domain_name The unique address you reserve on Twilio to which
# you route your SIP traffic
# @param [String] friendly_name A user-specified, human-readable name for the
# trigger.
# @param [String] auth_type The types of authentication you have mapped to your
@@ -127,30 +140,30 @@
# requesting the VoiceFallbackUrl
# @param [String] voice_status_callback_url The URL that Twilio will request to
# pass status parameters
# @param [String] voice_status_callback_method The voice_status_callback_method
# @return [DomainInstance] Newly created DomainInstance
- def create(domain_name: nil, friendly_name: nil, auth_type: nil, voice_url: nil, voice_method: nil, voice_fallback_url: nil, voice_fallback_method: nil, voice_status_callback_url: nil, voice_status_callback_method: nil)
- data = {
+ def create(domain_name: nil, friendly_name: :unset, auth_type: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, voice_status_callback_url: :unset, voice_status_callback_method: :unset)
+ data = Twilio::Values.of({
'DomainName' => domain_name,
'FriendlyName' => friendly_name,
'AuthType' => auth_type,
'VoiceUrl' => voice_url,
'VoiceMethod' => voice_method,
'VoiceFallbackUrl' => voice_fallback_url,
'VoiceFallbackMethod' => voice_fallback_method,
'VoiceStatusCallbackUrl' => voice_status_callback_url,
'VoiceStatusCallbackMethod' => voice_status_callback_method,
- }
+ })
payload = @version.create(
'POST',
@uri,
data: data
)
- return DomainInstance.new(
+ DomainInstance.new(
@version,
payload,
account_sid: @solution[:account_sid],
)
end
@@ -181,11 +194,11 @@
##
# Build an instance of DomainInstance
# @param [Hash] payload Payload response from the API
# @return [DomainInstance] DomainInstance
def get_instance(payload)
- return DomainInstance.new(
+ DomainInstance.new(
@version,
payload,
account_sid: @solution[:account_sid],
)
end
@@ -221,19 +234,19 @@
##
# Fetch a DomainInstance
# @return [DomainInstance] Fetched DomainInstance
def fetch
- params = {}
+ params = Twilio::Values.of({})
payload = @version.fetch(
'GET',
@uri,
params,
)
- return DomainInstance.new(
+ DomainInstance.new(
@version,
payload,
account_sid: @solution[:account_sid],
sid: @solution[:sid],
)
@@ -249,29 +262,29 @@
# @param [String] voice_method The HTTP method to use with the voice_url
# @param [String] voice_status_callback_method The voice_status_callback_method
# @param [String] voice_status_callback_url The voice_status_callback_url
# @param [String] voice_url The voice_url
# @return [DomainInstance] Updated DomainInstance
- def update(auth_type: nil, friendly_name: nil, voice_fallback_method: nil, voice_fallback_url: nil, voice_method: nil, voice_status_callback_method: nil, voice_status_callback_url: nil, voice_url: nil)
- data = {
+ def update(auth_type: :unset, friendly_name: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_status_callback_method: :unset, voice_status_callback_url: :unset, voice_url: :unset)
+ data = Twilio::Values.of({
'AuthType' => auth_type,
'FriendlyName' => friendly_name,
'VoiceFallbackMethod' => voice_fallback_method,
'VoiceFallbackUrl' => voice_fallback_url,
'VoiceMethod' => voice_method,
'VoiceStatusCallbackMethod' => voice_status_callback_method,
'VoiceStatusCallbackUrl' => voice_status_callback_url,
'VoiceUrl' => voice_url,
- }
+ })
payload = @version.update(
'POST',
@uri,
data: data,
)
- return DomainInstance.new(
+ DomainInstance.new(
@version,
payload,
account_sid: @solution[:account_sid],
sid: @solution[:sid],
)
@@ -279,11 +292,11 @@
##
# Deletes the DomainInstance
# @return [Boolean] true if delete succeeds, true otherwise
def delete
- return @version.delete('delete', @uri)
+ @version.delete('delete', @uri)
end
##
# Access the ip_access_control_list_mappings
# @return [IpAccessControlListMappingList] IpAccessControlListMappingList
@@ -477,10 +490,10 @@
# @param [String] voice_method The HTTP method to use with the voice_url
# @param [String] voice_status_callback_method The voice_status_callback_method
# @param [String] voice_status_callback_url The voice_status_callback_url
# @param [String] voice_url The voice_url
# @return [DomainInstance] Updated DomainInstance
- def update(auth_type: nil, friendly_name: nil, voice_fallback_method: nil, voice_fallback_url: nil, voice_method: nil, voice_status_callback_method: nil, voice_status_callback_url: nil, voice_url: nil)
+ def update(auth_type: :unset, friendly_name: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_status_callback_method: :unset, voice_status_callback_url: :unset, voice_url: :unset)
context.update(
auth_type: auth_type,
friendly_name: friendly_name,
voice_fallback_method: voice_fallback_method,
voice_fallback_url: voice_fallback_url,
\ No newline at end of file