lib/twilio-ruby/rest/api/v2010/account.rb in twilio-ruby-5.38.0 vs lib/twilio-ruby/rest/api/v2010/account.rb in twilio-ruby-5.39.0

- old
+ new

@@ -22,23 +22,18 @@ @solution = {} @uri = "/Accounts.json" end ## - # Retrieve a single page of AccountInstance records from the API. - # Request is executed immediately. + # Create the AccountInstance # @param [String] friendly_name A human readable description of the account to # create, defaults to `SubAccount Created at {YYYY-MM-DD HH:MM meridian}` - # @return [AccountInstance] Newly created AccountInstance + # @return [AccountInstance] Created AccountInstance def create(friendly_name: :unset) data = Twilio::Values.of({'FriendlyName' => friendly_name, }) - payload = @version.create( - 'POST', - @uri, - data: data - ) + payload = @version.create('POST', @uri, data: data) AccountInstance.new(@version, payload, ) end ## @@ -119,15 +114,13 @@ 'Status' => status, 'PageToken' => page_token, 'Page' => page_number, 'PageSize' => page_size, }) - response = @version.page( - 'GET', - @uri, - params - ) + + response = @version.page('GET', @uri, params) + AccountPage.new(@version, response, @solution) end ## # Retrieve a single page of AccountInstance records from the API. @@ -218,21 +211,15 @@ @usage = nil @validation_requests = nil end ## - # Fetch a AccountInstance + # Fetch the AccountInstance # @return [AccountInstance] Fetched AccountInstance def fetch - params = Twilio::Values.of({}) + payload = @version.fetch('GET', @uri) - payload = @version.fetch( - 'GET', - @uri, - params, - ) - AccountInstance.new(@version, payload, sid: @solution[:sid], ) end ## # Update the AccountInstance @@ -243,15 +230,11 @@ # `active` to reactivate it. # @return [AccountInstance] Updated AccountInstance def update(friendly_name: :unset, status: :unset) data = Twilio::Values.of({'FriendlyName' => friendly_name, 'Status' => status, }) - payload = @version.update( - 'POST', - @uri, - data: data, - ) + payload = @version.update('POST', @uri, data: data) AccountInstance.new(@version, payload, sid: @solution[:sid], ) end ## @@ -762,10 +745,10 @@ def uri @properties['uri'] end ## - # Fetch a AccountInstance + # Fetch the AccountInstance # @return [AccountInstance] Fetched AccountInstance def fetch context.fetch end \ No newline at end of file