class PureCloud::PostTextRequest
Attributes
Alias/Version of the bot
The channels this bot is utilizing
Id for tracking the activity - this will be returned in the response
ID of the bot to send the text to.
GUID for this bot's session
Override timeout for the bot session. This should be greater than 10 minutes.
the integration service id for the bot's credentials
The launguage code the bot will run under
Message
to send to the bot
Public Class Methods
Attribute
mapping from ruby-style variable name to JSON key.
# File lib/purecloudplatformclientv2/models/post_text_request.rb, line 53 def self.attribute_map { :'bot_id' => :'botId', :'bot_alias' => :'botAlias', :'integration_id' => :'integrationId', :'bot_session_id' => :'botSessionId', :'post_text_message' => :'postTextMessage', :'language_code' => :'languageCode', :'bot_session_timeout_minutes' => :'botSessionTimeoutMinutes', :'bot_channels' => :'botChannels', :'bot_correlation_id' => :'botCorrelationId', :'amazon_lex_request' => :'amazonLexRequest', :'google_dialogflow' => :'googleDialogflow' } end
Initializes the object @param [Hash] attributes Model attributes in the form of hash
# File lib/purecloudplatformclientv2/models/post_text_request.rb, line 112 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} if attributes.has_key?(:'botId') self.bot_id = attributes[:'botId'] end if attributes.has_key?(:'botAlias') self.bot_alias = attributes[:'botAlias'] end if attributes.has_key?(:'integrationId') self.integration_id = attributes[:'integrationId'] end if attributes.has_key?(:'botSessionId') self.bot_session_id = attributes[:'botSessionId'] end if attributes.has_key?(:'postTextMessage') self.post_text_message = attributes[:'postTextMessage'] end if attributes.has_key?(:'languageCode') self.language_code = attributes[:'languageCode'] end if attributes.has_key?(:'botSessionTimeoutMinutes') self.bot_session_timeout_minutes = attributes[:'botSessionTimeoutMinutes'] end if attributes.has_key?(:'botChannels') if (value = attributes[:'botChannels']).is_a?(Array) self.bot_channels = value end end if attributes.has_key?(:'botCorrelationId') self.bot_correlation_id = attributes[:'botCorrelationId'] end if attributes.has_key?(:'amazonLexRequest') self.amazon_lex_request = attributes[:'amazonLexRequest'] end if attributes.has_key?(:'googleDialogflow') self.google_dialogflow = attributes[:'googleDialogflow'] end end
Attribute
type mapping.
# File lib/purecloudplatformclientv2/models/post_text_request.rb, line 82 def self.swagger_types { :'bot_id' => :'String', :'bot_alias' => :'String', :'integration_id' => :'String', :'bot_session_id' => :'String', :'post_text_message' => :'PostTextMessage', :'language_code' => :'String', :'bot_session_timeout_minutes' => :'Integer', :'bot_channels' => :'Array<String>', :'bot_correlation_id' => :'String', :'amazon_lex_request' => :'AmazonLexRequest', :'google_dialogflow' => :'GoogleDialogflowCustomSettings' } end
Public Instance Methods
Checks equality by comparing each attribute. @param [Object] Object to be compared
# File lib/purecloudplatformclientv2/models/post_text_request.rb, line 359 def ==(o) return true if self.equal?(o) self.class == o.class && bot_id == o.bot_id && bot_alias == o.bot_alias && integration_id == o.integration_id && bot_session_id == o.bot_session_id && post_text_message == o.post_text_message && language_code == o.language_code && bot_session_timeout_minutes == o.bot_session_timeout_minutes && bot_channels == o.bot_channels && bot_correlation_id == o.bot_correlation_id && amazon_lex_request == o.amazon_lex_request && google_dialogflow == o.google_dialogflow end
# File lib/purecloudplatformclientv2/models/post_text_request.rb, line 407 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /^(true|t|yes|y|1)$/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model _model = Object.const_get("PureCloud").const_get(type).new _model.build_from_hash(value) end end
Method to output non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
# File lib/purecloudplatformclientv2/models/post_text_request.rb, line 467 def _to_hash(value) if value.is_a?(Array) value.compact.map{ |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end
build the object from hash
# File lib/purecloudplatformclientv2/models/post_text_request.rb, line 388 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) else #TODO show warning in debug mode end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) else # data not found in attributes(hash), not an issue as the data can be optional end end self end
@see the `==` method @param [Object] Object to be compared
# File lib/purecloudplatformclientv2/models/post_text_request.rb, line 377 def eql?(o) self == o end
Calculates hash code according to all attributes. @return [Fixnum] Hash code
# File lib/purecloudplatformclientv2/models/post_text_request.rb, line 383 def hash [bot_id, bot_alias, integration_id, bot_session_id, post_text_message, language_code, bot_session_timeout_minutes, bot_channels, bot_correlation_id, amazon_lex_request, google_dialogflow].hash end
Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properies with the reasons
# File lib/purecloudplatformclientv2/models/post_text_request.rb, line 224 def list_invalid_properties invalid_properties = Array.new return invalid_properties end
return the object in the form of hash
# File lib/purecloudplatformclientv2/models/post_text_request.rb, line 455 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end
# File lib/purecloudplatformclientv2/models/post_text_request.rb, line 445 def to_s to_hash.to_s end
Check to see if the all the properties in the model are valid @return true if the model is valid
# File lib/purecloudplatformclientv2/models/post_text_request.rb, line 233 def valid? if @bot_id.nil? return false end if @integration_id.nil? return false end if @bot_session_id.nil? return false end if @post_text_message.nil? return false end end