lib/twilio-ruby/rest/api/v2010/account/application.rb in twilio-ruby-5.0.0.rc9 vs lib/twilio-ruby/rest/api/v2010/account/application.rb in twilio-ruby-5.0.0.rc10

- old
+ new

@@ -13,11 +13,10 @@ ## # Initialize the ApplicationList # @param [Version] version Version that contains the resource # @param [String] account_sid The unique id of the Account that created this # application. - # @return [ApplicationList] ApplicationList def initialize(version, account_sid: nil) super(version) # Path Solution @@ -61,11 +60,10 @@ # this application on an outgoing SMS request. # @param [String] message_status_callback Twilio will make a `POST` request to # this URL to pass status parameters (such as sent or failed) to your application # if you use the `/Messages` endpoint to send the message and specify this # application's `Sid` as the `ApplicationSid` on an outgoing SMS request. - # @return [ApplicationInstance] Newly created ApplicationInstance def create(friendly_name: nil, api_version: nil, voice_url: nil, voice_method: nil, voice_fallback_url: nil, voice_fallback_method: nil, status_callback: nil, status_callback_method: nil, voice_caller_id_lookup: nil, sms_url: nil, sms_method: nil, sms_fallback_url: nil, sms_fallback_method: nil, sms_status_callback: nil, message_status_callback: nil) data = { 'FriendlyName' => friendly_name, 'ApiVersion' => api_version, @@ -91,11 +89,11 @@ ) return ApplicationInstance.new( @version, payload, - account_sid: @solution['account_sid'], + account_sid: @solution[:account_sid], ) end ## # Lists ApplicationInstance records from the API as a list. @@ -107,11 +105,10 @@ # guarantees to never return more than limit. Default is no limit # @param [Integer] page_size Number of records to fetch per request, when not set will use # the default value of 50 records. If no page_size is defined # but a limit is defined, stream() will attempt to read the # limit with the most efficient page size, i.e. min(limit, 1000) - # @return [Array] Array of up to limit results def list(friendly_name: nil, limit: nil, page_size: nil) self.stream( friendly_name: friendly_name, limit: limit, @@ -129,11 +126,10 @@ # guarantees to never return more than limit. Default is no limit # @param [Integer] page_size Number of records to fetch per request, when not set will use # the default value of 50 records. If no page_size is defined # but a limit is defined, stream() will attempt to read the # limit with the most efficient page size, i.e. min(limit, 1000) - # @return [Enumerable] Enumerable that will yield up to limit results def stream(friendly_name: nil, limit: nil, page_size: nil) limits = @version.read_limits(limit, page_size) page = self.page( @@ -174,11 +170,10 @@ # @param [String] friendly_name Only return application resources with friendly # names that match exactly with this name # @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 ApplicationInstance def page(friendly_name: nil, page_token: nil, page_number: nil, page_size: nil) params = { 'FriendlyName' => friendly_name, 'PageToken' => page_token, @@ -206,11 +201,10 @@ # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @param [String] account_sid The unique id of the Account that created this # application. - # @return [ApplicationPage] ApplicationPage def initialize(version, response, solution) super(version, response) # Path Solution @@ -218,17 +212,16 @@ end ## # Build an instance of ApplicationInstance # @param [Hash] payload Payload response from the API - # @return [ApplicationInstance] ApplicationInstance def get_instance(payload) return ApplicationInstance.new( @version, payload, - account_sid: @solution['account_sid'], + account_sid: @solution[:account_sid], ) end ## # Provide a user friendly representation @@ -242,11 +235,10 @@ # Initialize the ApplicationContext # @param [Version] version Version that contains the resource # @param [String] account_sid The account_sid # @param [String] sid The application Sid that that uniquely identifies this # resource - # @return [ApplicationContext] ApplicationContext def initialize(version, account_sid, sid) super(version) # Path Solution @@ -277,12 +269,12 @@ ) return ApplicationInstance.new( @version, payload, - account_sid: @solution['account_sid'], - sid: @solution['sid'], + account_sid: @solution[:account_sid], + sid: @solution[:sid], ) end ## # Update the ApplicationInstance @@ -317,11 +309,10 @@ # this application on an outgoing SMS request. # @param [String] message_status_callback Twilio will make a `POST` request to # this URL to pass status parameters (such as sent or failed) to your application # if you use the `/Messages` endpoint to send the message and specify this # application's `Sid` as the `ApplicationSid` on an outgoing SMS request. - # @return [ApplicationInstance] Updated ApplicationInstance def update(friendly_name: nil, api_version: nil, voice_url: nil, voice_method: nil, voice_fallback_url: nil, voice_fallback_method: nil, status_callback: nil, status_callback_method: nil, voice_caller_id_lookup: nil, sms_url: nil, sms_method: nil, sms_fallback_url: nil, sms_fallback_method: nil, sms_status_callback: nil, message_status_callback: nil) data = { 'FriendlyName' => friendly_name, 'ApiVersion' => api_version, @@ -347,12 +338,12 @@ ) return ApplicationInstance.new( @version, payload, - account_sid: @solution['account_sid'], - sid: @solution['sid'], + account_sid: @solution[:account_sid], + sid: @solution[:sid], ) end ## # Provide a user friendly representation @@ -369,11 +360,10 @@ # @param [Hash] payload payload that contains response from Twilio # @param [String] account_sid The unique id of the Account that created this # application. # @param [String] sid The application Sid that that uniquely identifies this # resource - # @return [ApplicationInstance] ApplicationInstance def initialize(version, payload, account_sid: nil, sid: nil) super(version) # Marshaled Properties @@ -410,11 +400,10 @@ ## # Generate an instance context for the instance, the context is capable of # performing various actions. All instance actions are proxied to the context # @param [Version] version Version that contains the resource - # @return [ApplicationContext] ApplicationContext for this ApplicationInstance def context unless @instance_context @instance_context = ApplicationContext.new( @version, @@ -507,18 +496,18 @@ ## # Deletes the ApplicationInstance # @return [Boolean] true if delete succeeds, true otherwise def delete - @context.delete() + context.delete end ## # Fetch a ApplicationInstance # @return [ApplicationInstance] Fetched ApplicationInstance def fetch - @context.fetch() + context.fetch end ## # Update the ApplicationInstance # @param [String] friendly_name A human readable descriptive text for this @@ -552,14 +541,14 @@ # this application on an outgoing SMS request. # @param [String] message_status_callback Twilio will make a `POST` request to # this URL to pass status parameters (such as sent or failed) to your application # if you use the `/Messages` endpoint to send the message and specify this # application's `Sid` as the `ApplicationSid` on an outgoing SMS request. - # @return [ApplicationInstance] Updated ApplicationInstance def update(friendly_name: nil, api_version: nil, voice_url: nil, voice_method: nil, voice_fallback_url: nil, voice_fallback_method: nil, status_callback: nil, status_callback_method: nil, voice_caller_id_lookup: nil, sms_url: nil, sms_method: nil, sms_fallback_url: nil, sms_fallback_method: nil, sms_status_callback: nil, message_status_callback: nil) - @context.update( + context.update( + friendly_name: friendly_name, api_version: api_version, voice_url: voice_url, voice_method: voice_method, voice_fallback_url: voice_fallback_url, voice_fallback_method: voice_fallback_method, @@ -576,11 +565,11 @@ end ## # Provide a user friendly representation def to_s - context = @params.map{|k, v| "#{k}: #{v}"}.join(" ") - "<Twilio.Api.V2010.ApplicationInstance #{context}>" + values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") + "<Twilio.Api.V2010.ApplicationInstance #{values}>" end end end end end \ No newline at end of file