lib/twilio-ruby/rest/chat/v1/service/channel/member.rb in twilio-ruby-5.4.2 vs lib/twilio-ruby/rest/chat/v1/service/channel/member.rb in twilio-ruby-5.4.3
- old
+ new
@@ -19,28 +19,22 @@
# @return [MemberList] MemberList
def initialize(version, service_sid: nil, channel_sid: nil)
super(version)
# Path Solution
- @solution = {
- service_sid: service_sid,
- channel_sid: channel_sid
- }
+ @solution = {service_sid: service_sid, channel_sid: channel_sid}
@uri = "/Services/#{@solution[:service_sid]}/Channels/#{@solution[:channel_sid]}/Members"
end
##
# 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: :unset)
- data = Twilio::Values.of({
- 'Identity' => identity,
- 'RoleSid' => role_sid,
- })
+ data = Twilio::Values.of({'Identity' => identity, 'RoleSid' => role_sid,})
payload = @version.create(
'POST',
@uri,
data: data
@@ -65,15 +59,11 @@
# 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(identity: :unset, limit: nil, page_size: nil)
- self.stream(
- identity: identity,
- limit: limit,
- page_size: page_size
- ).entries
+ self.stream(identity: identity, limit: limit, page_size: page_size).entries
end
##
# Streams MemberInstance records from the API as an Enumerable.
# This operation lazily loads records as efficiently as possible until the limit
@@ -87,14 +77,11 @@
# efficient page size, i.e. min(limit, 1000)
# @return [Enumerable] Enumerable that will yield up to limit results
def stream(identity: :unset, limit: nil, page_size: nil)
limits = @version.read_limits(limit, page_size)
- page = self.page(
- identity: identity,
- page_size: limits[:page_size],
- )
+ page = self.page(identity: identity, page_size: limits[:page_size],)
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
end
##
@@ -102,13 +89,11 @@
# This operation lazily loads records as efficiently as possible until the limit
# is reached.
def each
limits = @version.read_limits
- page = self.page(
- page_size: limits[:page_size],
- )
+ page = self.page(page_size: limits[:page_size],)
@version.stream(page,
limit: limits[:limit],
page_limit: limits[:page_limit]).each {|x| yield x}
end
@@ -200,15 +185,11 @@
# @return [MemberContext] MemberContext
def initialize(version, service_sid, channel_sid, sid)
super(version)
# Path Solution
- @solution = {
- service_sid: service_sid,
- channel_sid: channel_sid,
- sid: sid,
- }
+ @solution = {service_sid: service_sid, channel_sid: channel_sid, sid: sid,}
@uri = "/Services/#{@solution[:service_sid]}/Channels/#{@solution[:channel_sid]}/Members/#{@solution[:sid]}"
end
##
# Fetch a MemberInstance
@@ -408,13 +389,10 @@
# Update the MemberInstance
# @param [String] role_sid The role_sid
# @param [String] last_consumed_message_index The last_consumed_message_index
# @return [MemberInstance] Updated MemberInstance
def update(role_sid: :unset, last_consumed_message_index: :unset)
- context.update(
- role_sid: role_sid,
- last_consumed_message_index: last_consumed_message_index,
- )
+ context.update(role_sid: role_sid, last_consumed_message_index: last_consumed_message_index,)
end
##
# Provide a user friendly representation
def to_s
\ No newline at end of file