lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb in twilio-ruby-5.0.0.rc9 vs lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb in twilio-ruby-5.0.0.rc10

- old
+ new

@@ -14,11 +14,10 @@ ## # Initialize the MemberList # @param [Version] version Version that contains the resource # @param [String] service_sid The service_sid # @param [String] channel_sid The channel_sid - # @return [MemberList] MemberList def initialize(version, service_sid: nil, channel_sid: nil) super(version) # Path Solution @@ -32,11 +31,10 @@ ## # Retrieve a single page of MemberInstance records from the API. # Request is executed immediately. # @param [String] identity The identity # @param [String] role_sid The role_sid - # @return [MemberInstance] Newly created MemberInstance def create(identity: nil, role_sid: nil) data = { 'Identity' => identity, 'RoleSid' => role_sid, @@ -49,12 +47,12 @@ ) return MemberInstance.new( @version, payload, - service_sid: @solution['service_sid'], - channel_sid: @solution['channel_sid'], + service_sid: @solution[:service_sid], + channel_sid: @solution[:channel_sid], ) end ## # Lists MemberInstance records from the API as a list. @@ -64,11 +62,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(limit: nil, page_size: nil) self.stream( limit: limit, page_size: page_size @@ -83,11 +80,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(limit: nil, page_size: nil) limits = @version.read_limits(limit, page_size) page = self.page( @@ -123,11 +119,10 @@ # Retrieve a single page of MemberInstance records from the API. # 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 MemberInstance def page(page_token: nil, page_number: nil, page_size: nil) params = { 'PageToken' => page_token, 'Page' => page_number, @@ -154,11 +149,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] service_sid The service_sid # @param [String] channel_sid The channel_sid - # @return [MemberPage] MemberPage def initialize(version, response, solution) super(version, response) # Path Solution @@ -166,18 +160,17 @@ end ## # Build an instance of MemberInstance # @param [Hash] payload Payload response from the API - # @return [MemberInstance] MemberInstance def get_instance(payload) return MemberInstance.new( @version, payload, - service_sid: @solution['service_sid'], - channel_sid: @solution['channel_sid'], + service_sid: @solution[:service_sid], + channel_sid: @solution[:channel_sid], ) end ## # Provide a user friendly representation @@ -191,11 +184,10 @@ # Initialize the MemberContext # @param [Version] version Version that contains the resource # @param [String] service_sid The service_sid # @param [String] channel_sid The channel_sid # @param [String] sid The sid - # @return [MemberContext] MemberContext def initialize(version, service_sid, channel_sid, sid) super(version) # Path Solution @@ -220,13 +212,13 @@ ) return MemberInstance.new( @version, payload, - service_sid: @solution['service_sid'], - channel_sid: @solution['channel_sid'], - sid: @solution['sid'], + service_sid: @solution[:service_sid], + channel_sid: @solution[:channel_sid], + sid: @solution[:sid], ) end ## # Deletes the MemberInstance @@ -249,11 +241,10 @@ # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] service_sid The service_sid # @param [String] channel_sid The channel_sid # @param [String] sid The sid - # @return [MemberInstance] MemberInstance def initialize(version, payload, service_sid: nil, channel_sid: nil, sid: nil) super(version) # Marshaled Properties @@ -280,11 +271,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 [MemberContext] MemberContext for this MemberInstance def context unless @instance_context @instance_context = MemberContext.new( @version, @@ -334,24 +324,24 @@ ## # Fetch a MemberInstance # @return [MemberInstance] Fetched MemberInstance def fetch - @context.fetch() + context.fetch end ## # Deletes the MemberInstance # @return [Boolean] true if delete succeeds, true otherwise def delete - @context.delete() + context.delete end ## # Provide a user friendly representation def to_s - context = @params.map{|k, v| "#{k}: #{v}"}.join(" ") - "<Twilio.IpMessaging.V1.MemberInstance #{context}>" + values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") + "<Twilio.IpMessaging.V1.MemberInstance #{values}>" end end end end end \ No newline at end of file