lib/twilio-ruby/rest/pricing/v1/messaging/country.rb in twilio-ruby-5.0.0.rc21 vs lib/twilio-ruby/rest/pricing/v1/messaging/country.rb in twilio-ruby-5.0.0.rc22
- old
+ new
@@ -88,25 +88,38 @@
# 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 CountryInstance
- 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 CountryPage.new(@version, response, @solution)
+ CountryPage.new(@version, response, @solution)
end
##
+ # Retrieve a single page of CountryInstance records from the API.
+ # Request is executed immediately.
+ # @param [String] target_url API-generated URL for the requested results page
+ # @return [Page] Page of CountryInstance
+ def get_page(target_url)
+ response = @version.domain.request(
+ 'GET',
+ target_url
+ )
+ CountryPage.new(@version, response, @solution)
+ end
+
+ ##
# Provide a user friendly representation
def to_s
'#<Twilio.Pricing.V1.CountryList>'
end
end
@@ -128,11 +141,11 @@
##
# Build an instance of CountryInstance
# @param [Hash] payload Payload response from the API
# @return [CountryInstance] CountryInstance
def get_instance(payload)
- return CountryInstance.new(
+ CountryInstance.new(
@version,
payload,
)
end
@@ -161,18 +174,18 @@
##
# Fetch a CountryInstance
# @return [CountryInstance] Fetched CountryInstance
def fetch
- params = {}
+ params = Twilio::Values.of({})
payload = @version.fetch(
'GET',
@uri,
params,
)
- return CountryInstance.new(
+ CountryInstance.new(
@version,
payload,
iso_country: @solution[:iso_country],
)
end
\ No newline at end of file