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

- old
+ new

@@ -14,11 +14,10 @@ ## # Initialize the SmsMessageList # @param [Version] version Version that contains the resource # @param [String] account_sid A 34 character string that uniquely identifies this # resource. - # @return [SmsMessageList] SmsMessageList def initialize(version, account_sid: nil) super(version) # Path Solution @@ -35,11 +34,10 @@ # @param [String] from The from # @param [String] status_callback The status_callback # @param [String] application_sid The application_sid # @param [String] body The body # @param [String] media_url The media_url - # @return [SmsMessageInstance] Newly created SmsMessageInstance def create(to: nil, from: nil, status_callback: nil, application_sid: nil, body: nil, media_url: nil) data = { 'To' => to, 'From' => from, @@ -56,11 +54,11 @@ ) return SmsMessageInstance.new( @version, payload, - account_sid: @solution['account_sid'], + account_sid: @solution[:account_sid], ) end ## # Lists SmsMessageInstance records from the API as a list. @@ -75,11 +73,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(to: nil, from: nil, date_sent_before: nil, date_sent: nil, date_sent_after: nil, limit: nil, page_size: nil) self.stream( to: to, from: from, @@ -104,11 +101,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(to: nil, from: nil, date_sent_before: nil, date_sent: nil, date_sent_after: nil, limit: nil, page_size: nil) limits = @version.read_limits(limit, page_size) page = self.page( @@ -159,11 +155,10 @@ # @param [Time] date_sent The date_sent # @param [Time] date_sent_after: The date_sent # @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 SmsMessageInstance def page(to: nil, from: nil, date_sent_before: nil, date_sent: nil, date_sent_after: nil, page_token: nil, page_number: nil, page_size: nil) params = { 'To' => to, 'From' => from, @@ -195,11 +190,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 A 34 character string that uniquely identifies this # resource. - # @return [SmsMessagePage] SmsMessagePage def initialize(version, response, solution) super(version, response) # Path Solution @@ -207,17 +201,16 @@ end ## # Build an instance of SmsMessageInstance # @param [Hash] payload Payload response from the API - # @return [SmsMessageInstance] SmsMessageInstance def get_instance(payload) return SmsMessageInstance.new( @version, payload, - account_sid: @solution['account_sid'], + account_sid: @solution[:account_sid], ) end ## # Provide a user friendly representation @@ -230,11 +223,10 @@ ## # Initialize the SmsMessageContext # @param [Version] version Version that contains the resource # @param [String] account_sid The account_sid # @param [String] sid The sid - # @return [SmsMessageContext] SmsMessageContext def initialize(version, account_sid, sid) super(version) # Path Solution @@ -265,19 +257,18 @@ ) return SmsMessageInstance.new( @version, payload, - account_sid: @solution['account_sid'], - sid: @solution['sid'], + account_sid: @solution[:account_sid], + sid: @solution[:sid], ) end ## # Update the SmsMessageInstance # @param [String] body The body - # @return [SmsMessageInstance] Updated SmsMessageInstance def update(body: nil) data = { 'Body' => body, } @@ -289,12 +280,12 @@ ) return SmsMessageInstance.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 @@ -310,11 +301,10 @@ # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] account_sid A 34 character string that uniquely identifies this # resource. # @param [String] sid The sid - # @return [SmsMessageInstance] SmsMessageInstance def initialize(version, payload, account_sid: nil, sid: nil) super(version) # Marshaled Properties @@ -345,11 +335,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 [SmsMessageContext] SmsMessageContext for this SmsMessageInstance def context unless @instance_context @instance_context = SmsMessageContext.new( @version, @@ -418,33 +407,34 @@ ## # Deletes the SmsMessageInstance # @return [Boolean] true if delete succeeds, true otherwise def delete - @context.delete() + context.delete end ## # Fetch a SmsMessageInstance # @return [SmsMessageInstance] Fetched SmsMessageInstance def fetch - @context.fetch() + context.fetch end ## # Update the SmsMessageInstance # @param [String] body The body - # @return [SmsMessageInstance] Updated SmsMessageInstance def update(body: nil) - @context.update() + context.update( + body: body, + ) end ## # Provide a user friendly representation def to_s - context = @params.map{|k, v| "#{k}: #{v}"}.join(" ") - "<Twilio.Api.V2010.SmsMessageInstance #{context}>" + values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") + "<Twilio.Api.V2010.SmsMessageInstance #{values}>" end end end end end \ No newline at end of file