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

- old
+ new

@@ -16,11 +16,10 @@ # @param [Version] version Version that contains the resource # @param [String] account_sid The unique id of the Account responsible for this # media. # @param [String] message_sid A 34 character string that uniquely identifies this # resource. - # @return [MediaList] MediaList def initialize(version, account_sid: nil, message_sid: nil) super(version) # Path Solution @@ -42,11 +41,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(date_created_before: nil, date_created: nil, date_created_after: nil, limit: nil, page_size: nil) self.stream( date_created_before: date_created_before, date_created: date_created, @@ -67,11 +65,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(date_created_before: nil, date_created: nil, date_created_after: nil, limit: nil, page_size: nil) limits = @version.read_limits(limit, page_size) page = self.page( @@ -116,11 +113,10 @@ # @param [Time] date_created Filter by date created # @param [Time] date_created_after: Filter by date created # @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 MediaInstance def page(date_created_before: nil, date_created: nil, date_created_after: nil, page_token: nil, page_number: nil, page_size: nil) params = { 'DateCreated<' => Twilio.serialize_iso8601(date_created_before), 'DateCreated' => Twilio.serialize_iso8601(date_created), @@ -152,11 +148,10 @@ # @param [Hash] solution Path solution for the resource # @param [String] account_sid The unique id of the Account responsible for this # media. # @param [String] message_sid A 34 character string that uniquely identifies this # resource. - # @return [MediaPage] MediaPage def initialize(version, response, solution) super(version, response) # Path Solution @@ -164,18 +159,17 @@ end ## # Build an instance of MediaInstance # @param [Hash] payload Payload response from the API - # @return [MediaInstance] MediaInstance def get_instance(payload) return MediaInstance.new( @version, payload, - account_sid: @solution['account_sid'], - message_sid: @solution['message_sid'], + account_sid: @solution[:account_sid], + message_sid: @solution[:message_sid], ) end ## # Provide a user friendly representation @@ -189,11 +183,10 @@ # Initialize the MediaContext # @param [Version] version Version that contains the resource # @param [String] account_sid The account_sid # @param [String] message_sid The message_sid # @param [String] sid The media Sid that uniquely identifies this resource - # @return [MediaContext] MediaContext def initialize(version, account_sid, message_sid, sid) super(version) # Path Solution @@ -225,13 +218,13 @@ ) return MediaInstance.new( @version, payload, - account_sid: @solution['account_sid'], - message_sid: @solution['message_sid'], - sid: @solution['sid'], + account_sid: @solution[:account_sid], + message_sid: @solution[:message_sid], + sid: @solution[:sid], ) end ## # Provide a user friendly representation @@ -249,11 +242,10 @@ # @param [String] account_sid The unique id of the Account responsible for this # media. # @param [String] message_sid A 34 character string that uniquely identifies this # resource. # @param [String] sid The media Sid that uniquely identifies this resource - # @return [MediaInstance] MediaInstance def initialize(version, payload, account_sid: nil, message_sid: nil, sid: nil) super(version) # Marshaled Properties @@ -278,11 +270,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 [MediaContext] MediaContext for this MediaInstance def context unless @instance_context @instance_context = MediaContext.new( @version, @@ -324,24 +315,24 @@ ## # Deletes the MediaInstance # @return [Boolean] true if delete succeeds, true otherwise def delete - @context.delete() + context.delete end ## # Fetch a MediaInstance # @return [MediaInstance] Fetched MediaInstance def fetch - @context.fetch() + context.fetch end ## # Provide a user friendly representation def to_s - context = @params.map{|k, v| "#{k}: #{v}"}.join(" ") - "<Twilio.Api.V2010.MediaInstance #{context}>" + values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") + "<Twilio.Api.V2010.MediaInstance #{values}>" end end end end end \ No newline at end of file