lib/purecloudplatformclientv2/models/chat_message.rb in purecloudplatformclientv2-52.0.0 vs lib/purecloudplatformclientv2/models/chat_message.rb in purecloudplatformclientv2-53.0.0

- old
+ new

@@ -5,37 +5,46 @@ OpenAPI spec version: v2 Contact: DeveloperEvangelists@genesys.com Generated by: https://github.com/swagger-api/swagger-codegen.git -License: ININ -http://www.inin.com +License: UNLICENSED +https://help.mypurecloud.com/articles/terms-and-conditions/ -Terms of Service: https://developer.mypurecloud.com/tos +Terms of Service: https://help.mypurecloud.com/articles/terms-and-conditions/ =end require 'date' module PureCloud class ChatMessage + # The message body attr_accessor :body attr_accessor :id + # The message recipient attr_accessor :to + # The message sender attr_accessor :from attr_accessor :utc + # The interaction id (if available) attr_accessor :chat + # The message id attr_accessor :message attr_accessor :type + # Type of the message body (v2 chats only) + attr_accessor :body_type + + # The user information for the sender (if available) attr_accessor :user # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -54,10 +63,12 @@ :'message' => :'message', :'type' => :'type', + :'body_type' => :'bodyType', + :'user' => :'user' } end @@ -79,10 +90,12 @@ :'message' => :'String', :'type' => :'String', + :'body_type' => :'String', + :'user' => :'ChatMessageUser' } end @@ -165,10 +178,19 @@ end + if attributes.has_key?(:'bodyType') + + + self.body_type = attributes[:'bodyType'] + + + end + + if attributes.has_key?(:'user') self.user = attributes[:'user'] @@ -223,12 +245,21 @@ + allowed_values = ["STANDARD", "ACTIVITY", "TYPING", "NOTICE", "MEMBERJOIN", "MEMBERLEAVE", "MEDIAREQUEST"] + if @body_type && !allowed_values.include?(@body_type) + return false + end + + + + + end @@ -269,14 +300,28 @@ + # Custom attribute writer method checking allowed values (enum). + # @param [Object] body_type Object to be assigned + def body_type=(body_type) + allowed_values = ["STANDARD", "ACTIVITY", "TYPING", "NOTICE", "MEMBERJOIN", "MEMBERLEAVE", "MEDIAREQUEST"] + if body_type && !allowed_values.include?(body_type) + fail ArgumentError, "invalid value for 'body_type', must be one of #{allowed_values}." + end + @body_type = body_type + end + + + + + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && @@ -286,10 +331,11 @@ from == o.from && utc == o.utc && chat == o.chat && message == o.message && type == o.type && + body_type == o.body_type && user == o.user end # @see the `==` method # @param [Object] Object to be compared @@ -298,10 +344,10 @@ end # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [body, id, to, from, utc, chat, message, type, user].hash + [body, id, to, from, utc, chat, message, type, body_type, user].hash end # build the object from hash def build_from_hash(attributes) return nil unless attributes.is_a?(Hash)