Class: UltracartClient::ConversationAgentStatusEvent
- Inherits:
-
Object
- Object
- UltracartClient::ConversationAgentStatusEvent
- Defined in:
- lib/ultracart_api/models/conversation_agent_status_event.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#agent_identifier ⇒ Object
Agent identifier — voice_identity for PBX (e.g. 'client:login'), participant_arn for chat, synthetic 'ai:<user_id>' for AI flag events.
-
#agent_name ⇒ Object
Agent display name at the time of the event.
-
#agent_type ⇒ Object
Agent type.
-
#agent_user_id ⇒ Object
Agent user id (links across channels).
-
#channel ⇒ Object
Channel.
-
#custom_status_name ⇒ Object
Custom status name (when applicable).
-
#custom_status_uuid ⇒ Object
Custom status uuid (when applicable).
-
#duration_in_previous_seconds ⇒ Object
Time spent in the previous status, in seconds.
-
#event_dts ⇒ Object
Event timestamp (ISO 8601).
-
#event_uuid ⇒ Object
Event UUID (natural key for ES + BQ).
-
#merchant_id ⇒ Object
Merchant Id.
-
#new_routing_effect ⇒ Object
Canonical new routing semantic.
-
#new_status ⇒ Object
Channel-native new status name.
-
#parent_merchant_id ⇒ Object
Parent merchant id (denormalized for ES routing parity).
-
#previous_routing_effect ⇒ Object
Canonical previous routing semantic.
-
#previous_status ⇒ Object
Channel-native previous status name.
-
#trigger ⇒ Object
What triggered the transition.
Class Method Summary collapse
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ConversationAgentStatusEvent
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ ConversationAgentStatusEvent
Initializes the object
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 150 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationAgentStatusEvent` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationAgentStatusEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'agent_identifier') self.agent_identifier = attributes[:'agent_identifier'] end if attributes.key?(:'agent_name') self.agent_name = attributes[:'agent_name'] end if attributes.key?(:'agent_type') self.agent_type = attributes[:'agent_type'] end if attributes.key?(:'agent_user_id') self.agent_user_id = attributes[:'agent_user_id'] end if attributes.key?(:'channel') self.channel = attributes[:'channel'] end if attributes.key?(:'custom_status_name') self.custom_status_name = attributes[:'custom_status_name'] end if attributes.key?(:'custom_status_uuid') self.custom_status_uuid = attributes[:'custom_status_uuid'] end if attributes.key?(:'duration_in_previous_seconds') self.duration_in_previous_seconds = attributes[:'duration_in_previous_seconds'] end if attributes.key?(:'event_dts') self.event_dts = attributes[:'event_dts'] end if attributes.key?(:'event_uuid') self.event_uuid = attributes[:'event_uuid'] end if attributes.key?(:'merchant_id') self.merchant_id = attributes[:'merchant_id'] end if attributes.key?(:'new_routing_effect') self.new_routing_effect = attributes[:'new_routing_effect'] end if attributes.key?(:'new_status') self.new_status = attributes[:'new_status'] end if attributes.key?(:'parent_merchant_id') self.parent_merchant_id = attributes[:'parent_merchant_id'] end if attributes.key?(:'previous_routing_effect') self.previous_routing_effect = attributes[:'previous_routing_effect'] end if attributes.key?(:'previous_status') self.previous_status = attributes[:'previous_status'] end if attributes.key?(:'trigger') self.trigger = attributes[:'trigger'] end end |
Instance Attribute Details
#agent_identifier ⇒ Object
Agent identifier — voice_identity for PBX (e.g. 'client:login'), participant_arn for chat, synthetic 'ai:<user_id>' for AI flag events. Stable across an agent's events; participates in DDB pk and GSI1 sk.
19 20 21 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 19 def agent_identifier @agent_identifier end |
#agent_name ⇒ Object
Agent display name at the time of the event
22 23 24 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 22 def agent_name @agent_name end |
#agent_type ⇒ Object
Agent type
25 26 27 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 25 def agent_type @agent_type end |
#agent_user_id ⇒ Object
Agent user id (links across channels)
28 29 30 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 28 def agent_user_id @agent_user_id end |
#channel ⇒ Object
Channel
31 32 33 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 31 def channel @channel end |
#custom_status_name ⇒ Object
Custom status name (when applicable)
34 35 36 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 34 def custom_status_name @custom_status_name end |
#custom_status_uuid ⇒ Object
Custom status uuid (when applicable)
37 38 39 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 37 def custom_status_uuid @custom_status_uuid end |
#duration_in_previous_seconds ⇒ Object
Time spent in the previous status, in seconds
40 41 42 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 40 def duration_in_previous_seconds @duration_in_previous_seconds end |
#event_dts ⇒ Object
Event timestamp (ISO 8601)
43 44 45 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 43 def event_dts @event_dts end |
#event_uuid ⇒ Object
Event UUID (natural key for ES + BQ)
46 47 48 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 46 def event_uuid @event_uuid end |
#merchant_id ⇒ Object
Merchant Id
49 50 51 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 49 def merchant_id @merchant_id end |
#new_routing_effect ⇒ Object
Canonical new routing semantic
52 53 54 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 52 def new_routing_effect @new_routing_effect end |
#new_status ⇒ Object
Channel-native new status name
55 56 57 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 55 def new_status @new_status end |
#parent_merchant_id ⇒ Object
Parent merchant id (denormalized for ES routing parity)
58 59 60 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 58 def parent_merchant_id @parent_merchant_id end |
#previous_routing_effect ⇒ Object
Canonical previous routing semantic
61 62 63 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 61 def previous_routing_effect @previous_routing_effect end |
#previous_status ⇒ Object
Channel-native previous status name
64 65 66 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 64 def previous_status @previous_status end |
#trigger ⇒ Object
What triggered the transition
67 68 69 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 67 def trigger @trigger end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
115 116 117 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 115 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 92 def self.attribute_map { :'agent_identifier' => :'agent_identifier', :'agent_name' => :'agent_name', :'agent_type' => :'agent_type', :'agent_user_id' => :'agent_user_id', :'channel' => :'channel', :'custom_status_name' => :'custom_status_name', :'custom_status_uuid' => :'custom_status_uuid', :'duration_in_previous_seconds' => :'duration_in_previous_seconds', :'event_dts' => :'event_dts', :'event_uuid' => :'event_uuid', :'merchant_id' => :'merchant_id', :'new_routing_effect' => :'new_routing_effect', :'new_status' => :'new_status', :'parent_merchant_id' => :'parent_merchant_id', :'previous_routing_effect' => :'previous_routing_effect', :'previous_status' => :'previous_status', :'trigger' => :'trigger' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
404 405 406 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 404 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
143 144 145 146 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 143 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 120 def self.openapi_types { :'agent_identifier' => :'String', :'agent_name' => :'String', :'agent_type' => :'String', :'agent_user_id' => :'String', :'channel' => :'String', :'custom_status_name' => :'String', :'custom_status_uuid' => :'String', :'duration_in_previous_seconds' => :'Integer', :'event_dts' => :'String', :'event_uuid' => :'String', :'merchant_id' => :'String', :'new_routing_effect' => :'String', :'new_status' => :'String', :'parent_merchant_id' => :'String', :'previous_routing_effect' => :'String', :'previous_status' => :'String', :'trigger' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 367 def ==(o) return true if self.equal?(o) self.class == o.class && agent_identifier == o.agent_identifier && agent_name == o.agent_name && agent_type == o.agent_type && agent_user_id == o.agent_user_id && channel == o.channel && custom_status_name == o.custom_status_name && custom_status_uuid == o.custom_status_uuid && duration_in_previous_seconds == o.duration_in_previous_seconds && event_dts == o.event_dts && event_uuid == o.event_uuid && merchant_id == o.merchant_id && new_routing_effect == o.new_routing_effect && new_status == o.new_status && parent_merchant_id == o.parent_merchant_id && previous_routing_effect == o.previous_routing_effect && previous_status == o.previous_status && trigger == o.trigger end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 435 def _deserialize(type, value) case type.to_sym when :Time Time.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 =~ /\A(true|t|yes|y|1)\z/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 # models (e.g. Pet) or oneOf klass = UltracartClient.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
506 507 508 509 510 511 512 513 514 515 516 517 518 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 506 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_from_hash(attributes) ⇒ Object
Builds the object from hash
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 411 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
391 392 393 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 391 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
397 398 399 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 397 def hash [agent_identifier, agent_name, agent_type, agent_user_id, channel, custom_status_name, custom_status_uuid, duration_in_previous_seconds, event_dts, event_uuid, merchant_id, new_routing_effect, new_status, parent_merchant_id, previous_routing_effect, previous_status, trigger].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 234 def list_invalid_properties invalid_properties = Array.new if !@custom_status_uuid.nil? && @custom_status_uuid.to_s.length > 50 invalid_properties.push('invalid value for "custom_status_uuid", the character length must be smaller than or equal to 50.') end if !@event_uuid.nil? && @event_uuid.to_s.length > 36 invalid_properties.push('invalid value for "event_uuid", the character length must be smaller than or equal to 36.') end if !@merchant_id.nil? && @merchant_id.to_s.length > 5 invalid_properties.push('invalid value for "merchant_id", the character length must be smaller than or equal to 5.') end if !@parent_merchant_id.nil? && @parent_merchant_id.to_s.length > 5 invalid_properties.push('invalid value for "parent_merchant_id", the character length must be smaller than or equal to 5.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
482 483 484 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 482 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
488 489 490 491 492 493 494 495 496 497 498 499 500 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 488 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
476 477 478 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 476 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/ultracart_api/models/conversation_agent_status_event.rb', line 257 def valid? agent_type_validator = EnumAttributeValidator.new('String', ["human", "ai"]) return false unless agent_type_validator.valid?(@agent_type) channel_validator = EnumAttributeValidator.new('String', ["pbx", "chat"]) return false unless channel_validator.valid?(@channel) return false if !@custom_status_uuid.nil? && @custom_status_uuid.to_s.length > 50 return false if !@event_uuid.nil? && @event_uuid.to_s.length > 36 return false if !@merchant_id.nil? && @merchant_id.to_s.length > 5 new_routing_effect_validator = EnumAttributeValidator.new('String', ["available", "busy", "unavailable"]) return false unless new_routing_effect_validator.valid?(@new_routing_effect) return false if !@parent_merchant_id.nil? && @parent_merchant_id.to_s.length > 5 previous_routing_effect_validator = EnumAttributeValidator.new('String', ["available", "busy", "unavailable"]) return false unless previous_routing_effect_validator.valid?(@previous_routing_effect) trigger_validator = EnumAttributeValidator.new('String', ["manual", "system", "auto_disconnect"]) return false unless trigger_validator.valid?(@trigger) true end |