lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb in twilio-ruby-5.4.2 vs lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb in twilio-ruby-5.4.3
- old
+ new
@@ -23,15 +23,11 @@
# @return [MessageInteractionList] MessageInteractionList
def initialize(version, service_sid: nil, session_sid: nil, participant_sid: nil)
super(version)
# Path Solution
- @solution = {
- service_sid: service_sid,
- session_sid: session_sid,
- participant_sid: participant_sid
- }
+ @solution = {service_sid: service_sid, session_sid: session_sid, participant_sid: participant_sid}
@uri = "/Services/#{@solution[:service_sid]}/Sessions/#{@solution[:session_sid]}/Participants/#{@solution[:participant_sid]}/MessageInteractions"
end
##
# Retrieve a single page of MessageInteractionInstance records from the API.
@@ -40,14 +36,11 @@
# to 1600 characters long.
# @param [String] media_url The public url of an image or video to send to the
# Participant.
# @return [MessageInteractionInstance] Newly created MessageInteractionInstance
def create(body: :unset, media_url: :unset)
- data = Twilio::Values.of({
- 'Body' => body,
- 'MediaUrl' => media_url,
- })
+ data = Twilio::Values.of({'Body' => body, 'MediaUrl' => media_url,})
payload = @version.create(
'POST',
@uri,
data: data
@@ -72,14 +65,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(limit: nil, page_size: nil)
- self.stream(
- limit: limit,
- page_size: page_size
- ).entries
+ self.stream(limit: limit, page_size: page_size).entries
end
##
# Streams MessageInteractionInstance records from the API as an Enumerable.
# This operation lazily loads records as efficiently as possible until the limit
@@ -92,13 +82,11 @@
# 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(
- page_size: limits[:page_size],
- )
+ page = self.page(page_size: limits[:page_size],)
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
end
##
@@ -106,12 +94,10 @@
# 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
\ No newline at end of file