lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb in twilio-ruby-5.41.0 vs lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb in twilio-ruby-5.42.0
- old
+ new
@@ -14,16 +14,12 @@
class ChannelContext < InstanceContext
class MessageList < ListResource
##
# Initialize the MessageList
# @param [Version] version Version that contains the resource
- # @param [String] service_sid The SID of the
- # {Service}[https://www.twilio.com/docs/api/chat/rest/services] the resource is
- # associated with.
- # @param [String] channel_sid The unique ID of the
- # {Channel}[https://www.twilio.com/docs/api/chat/rest/channels] the Message
- # resource belongs to.
+ # @param [String] service_sid The service_sid
+ # @param [String] channel_sid The channel_sid
# @return [MessageList] MessageList
def initialize(version, service_sid: nil, channel_sid: nil)
super(version)
# Path Solution
@@ -31,18 +27,13 @@
@uri = "/Services/#{@solution[:service_sid]}/Channels/#{@solution[:channel_sid]}/Messages"
end
##
# Create the MessageInstance
- # @param [String] body The message to send to the channel. Can also be an empty
- # string or `null`, which sets the value as an empty string. You can send
- # structured data in the body by serializing it as a string.
- # @param [String] from The
- # {identity}[https://www.twilio.com/docs/api/chat/guides/identity] of the new
- # message's author. The default value is `system`.
- # @param [String] attributes A valid JSON string that contains
- # application-specific data.
+ # @param [String] body The body
+ # @param [String] from The from
+ # @param [String] attributes The attributes
# @return [MessageInstance] Created MessageInstance
def create(body: nil, from: :unset, attributes: :unset)
data = Twilio::Values.of({'Body' => body, 'From' => from, 'Attributes' => attributes, })
payload = @version.create('POST', @uri, data: data)
@@ -57,12 +48,11 @@
##
# Lists MessageInstance records from the API as a list.
# Unlike stream(), this operation is eager and will load `limit` records into
# memory before returning.
- # @param [message.OrderType] order The sort order of the returned messages. Can
- # be: `asc` (ascending) or `desc` (descending) with `asc` as the default.
+ # @param [message.OrderType] order The order
# @param [Integer] limit Upper limit for the number of records to return. stream()
# 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
@@ -74,12 +64,11 @@
##
# Streams MessageInstance records from the API as an Enumerable.
# This operation lazily loads records as efficiently as possible until the limit
# is reached.
- # @param [message.OrderType] order The sort order of the returned messages. Can
- # be: `asc` (ascending) or `desc` (descending) with `asc` as the default.
+ # @param [message.OrderType] order The order
# @param [Integer] limit Upper limit for the number of records to return. stream()
# 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
@@ -108,12 +97,11 @@
end
##
# Retrieve a single page of MessageInstance records from the API.
# Request is executed immediately.
- # @param [message.OrderType] order The sort order of the returned messages. Can
- # be: `asc` (ascending) or `desc` (descending) with `asc` as the default.
+ # @param [message.OrderType] order The order
# @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 MessageInstance
def page(order: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
@@ -185,18 +173,13 @@
class MessageContext < InstanceContext
##
# Initialize the MessageContext
# @param [Version] version Version that contains the resource
- # @param [String] service_sid The SID of the
- # {Service}[https://www.twilio.com/docs/api/chat/rest/services] to fetch the
- # resource from.
- # @param [String] channel_sid The unique ID of the
- # {Channel}[https://www.twilio.com/docs/api/chat/rest/channels] the message to
- # fetch belongs to. Can be the Channel's `sid` or `unique_name`.
- # @param [String] sid The Twilio-provided string that uniquely identifies the
- # Message resource to fetch.
+ # @param [String] service_sid The service_sid
+ # @param [String] channel_sid The channel_sid
+ # @param [String] sid The sid
# @return [MessageContext] MessageContext
def initialize(version, service_sid, channel_sid, sid)
super(version)
# Path Solution
@@ -226,15 +209,12 @@
@version.delete('DELETE', @uri)
end
##
# Update the MessageInstance
- # @param [String] body The message to send to the channel. Can also be an empty
- # string or `null`, which sets the value as an empty string. You can send
- # structured data in the body by serializing it as a string.
- # @param [String] attributes A valid JSON string that contains
- # application-specific data.
+ # @param [String] body The body
+ # @param [String] attributes The attributes
# @return [MessageInstance] Updated MessageInstance
def update(body: :unset, attributes: :unset)
data = Twilio::Values.of({'Body' => body, 'Attributes' => attributes, })
payload = @version.update('POST', @uri, data: data)
@@ -266,18 +246,13 @@
class MessageInstance < InstanceResource
##
# Initialize the MessageInstance
# @param [Version] version Version that contains the resource
# @param [Hash] payload payload that contains response from Twilio
- # @param [String] service_sid The SID of the
- # {Service}[https://www.twilio.com/docs/api/chat/rest/services] the resource is
- # associated with.
- # @param [String] channel_sid The unique ID of the
- # {Channel}[https://www.twilio.com/docs/api/chat/rest/channels] the Message
- # resource belongs to.
- # @param [String] sid The Twilio-provided string that uniquely identifies the
- # Message resource to fetch.
+ # @param [String] service_sid The service_sid
+ # @param [String] channel_sid The channel_sid
+ # @param [String] sid The sid
# @return [MessageInstance] MessageInstance
def initialize(version, payload, service_sid: nil, channel_sid: nil, sid: nil)
super(version)
# Marshaled Properties
@@ -321,83 +296,83 @@
end
@instance_context
end
##
- # @return [String] The unique string that identifies the resource
+ # @return [String] The sid
def sid
@properties['sid']
end
##
- # @return [String] The SID of the Account that created the resource
+ # @return [String] The account_sid
def account_sid
@properties['account_sid']
end
##
- # @return [String] The JSON string that stores application-specific data
+ # @return [String] The attributes
def attributes
@properties['attributes']
end
##
- # @return [String] The SID of the Service that the resource is associated with
+ # @return [String] The service_sid
def service_sid
@properties['service_sid']
end
##
- # @return [String] The SID of the Channel that the message was sent to
+ # @return [String] The to
def to
@properties['to']
end
##
- # @return [String] The unique ID of the Channel the Message resource belongs to
+ # @return [String] The channel_sid
def channel_sid
@properties['channel_sid']
end
##
- # @return [Time] The RFC 2822 date and time in GMT when the resource was created
+ # @return [Time] The date_created
def date_created
@properties['date_created']
end
##
- # @return [Time] The RFC 2822 date and time in GMT when the resource was last updated
+ # @return [Time] The date_updated
def date_updated
@properties['date_updated']
end
##
- # @return [Boolean] Whether the message has been edited since it was created
+ # @return [Boolean] The was_edited
def was_edited
@properties['was_edited']
end
##
- # @return [String] The identity of the message's author
+ # @return [String] The from
def from
@properties['from']
end
##
- # @return [String] The content of the message
+ # @return [String] The body
def body
@properties['body']
end
##
- # @return [String] The index of the message within the Channel
+ # @return [String] The index
def index
@properties['index']
end
##
- # @return [String] The absolute URL of the Message resource
+ # @return [String] The url
def url
@properties['url']
end
##
@@ -414,14 +389,11 @@
context.delete
end
##
# Update the MessageInstance
- # @param [String] body The message to send to the channel. Can also be an empty
- # string or `null`, which sets the value as an empty string. You can send
- # structured data in the body by serializing it as a string.
- # @param [String] attributes A valid JSON string that contains
- # application-specific data.
+ # @param [String] body The body
+ # @param [String] attributes The attributes
# @return [MessageInstance] Updated MessageInstance
def update(body: :unset, attributes: :unset)
context.update(body: body, attributes: attributes, )
end
\ No newline at end of file