Class: GongAPI::CustomActionEvent
- Inherits:
-
Object
- Object
- GongAPI::CustomActionEvent
- Defined in:
- lib/gong_api/models/custom_action_event.rb
Overview
Custom Action Event
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#action_name ⇒ Object
The name of the action like "Document Viewed" or "Presentation Opened".
-
#actor ⇒ Object
Returns the value of attribute actor.
-
#agent_platform ⇒ Object
Platform on which the interaction was made.
-
#content_id ⇒ Object
The id of the content that was viewed in the reporting system.
-
#content_properties ⇒ Object
A list of additional properties for the content.
-
#content_title ⇒ Object
Human readable title of the content.
-
#content_url ⇒ Object
The url of the content that was viewed in the reporting system.
-
#crm_context ⇒ Object
A list of references to external systems such as CRM, Telephony System, Case Management, etc.
-
#event_id ⇒ Object
The original id of the event as designated in the reporting system.
-
#event_info_url ⇒ Object
The link to a page that presents additional information about this event.
-
#event_properties ⇒ Object
A list of additional properties for the event.
-
#event_timestamp ⇒ Object
The date and time when the event happened in the ISO-8601 format (e.g., ‘2021-08-01T02:30:00+05:00’ or ‘2021-08-01T08:00:00Z’, where Z stands for UTC);.
-
#mobile_app_id ⇒ Object
The application identification string in case of interaction via mobile application (bundle identifier or package name).
-
#reporting_system ⇒ Object
The unique identifier of the reporting system.
-
#user_agent ⇒ Object
"User-Agent" header value for browser based interaction.
-
#workspace_id ⇒ Object
Optional workspace identifier.
Class Method Summary collapse
-
.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 = {}) ⇒ CustomActionEvent
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 = {}) ⇒ CustomActionEvent
Initializes the object
138 139 140 141 142 143 144 145 146 147 148 149 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 |
# File 'lib/gong_api/models/custom_action_event.rb', line 138 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `GongAPI::CustomActionEvent` 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 `GongAPI::CustomActionEvent`. 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?(:'action_name') self.action_name = attributes[:'action_name'] end if attributes.key?(:'actor') self.actor = attributes[:'actor'] end if attributes.key?(:'agent_platform') self.agent_platform = attributes[:'agent_platform'] end if attributes.key?(:'content_id') self.content_id = attributes[:'content_id'] end if attributes.key?(:'content_properties') if (value = attributes[:'content_properties']).is_a?(Array) self.content_properties = value end end if attributes.key?(:'content_title') self.content_title = attributes[:'content_title'] end if attributes.key?(:'content_url') self.content_url = attributes[:'content_url'] end if attributes.key?(:'crm_context') if (value = attributes[:'crm_context']).is_a?(Array) self.crm_context = value end end if attributes.key?(:'event_id') self.event_id = attributes[:'event_id'] end if attributes.key?(:'event_info_url') self.event_info_url = attributes[:'event_info_url'] end if attributes.key?(:'event_properties') if (value = attributes[:'event_properties']).is_a?(Array) self.event_properties = value end end if attributes.key?(:'event_timestamp') self. = attributes[:'event_timestamp'] end if attributes.key?(:'mobile_app_id') self.mobile_app_id = attributes[:'mobile_app_id'] end if attributes.key?(:'reporting_system') self.reporting_system = attributes[:'reporting_system'] end if attributes.key?(:'user_agent') self.user_agent = attributes[:'user_agent'] end if attributes.key?(:'workspace_id') self.workspace_id = attributes[:'workspace_id'] end end |
Instance Attribute Details
#action_name ⇒ Object
The name of the action like "Document Viewed" or "Presentation Opened".
18 19 20 |
# File 'lib/gong_api/models/custom_action_event.rb', line 18 def action_name @action_name end |
#actor ⇒ Object
Returns the value of attribute actor.
20 21 22 |
# File 'lib/gong_api/models/custom_action_event.rb', line 20 def actor @actor end |
#agent_platform ⇒ Object
Platform on which the interaction was made
23 24 25 |
# File 'lib/gong_api/models/custom_action_event.rb', line 23 def agent_platform @agent_platform end |
#content_id ⇒ Object
The id of the content that was viewed in the reporting system.
26 27 28 |
# File 'lib/gong_api/models/custom_action_event.rb', line 26 def content_id @content_id end |
#content_properties ⇒ Object
A list of additional properties for the content
29 30 31 |
# File 'lib/gong_api/models/custom_action_event.rb', line 29 def content_properties @content_properties end |
#content_title ⇒ Object
Human readable title of the content.
32 33 34 |
# File 'lib/gong_api/models/custom_action_event.rb', line 32 def content_title @content_title end |
#content_url ⇒ Object
The url of the content that was viewed in the reporting system. This is the url that is was accessed by the viewer.
35 36 37 |
# File 'lib/gong_api/models/custom_action_event.rb', line 35 def content_url @content_url end |
#crm_context ⇒ Object
A list of references to external systems such as CRM, Telephony System, Case Management, etc.
38 39 40 |
# File 'lib/gong_api/models/custom_action_event.rb', line 38 def crm_context @crm_context end |
#event_id ⇒ Object
The original id of the event as designated in the reporting system.
41 42 43 |
# File 'lib/gong_api/models/custom_action_event.rb', line 41 def event_id @event_id end |
#event_info_url ⇒ Object
The link to a page that presents additional information about this event.
44 45 46 |
# File 'lib/gong_api/models/custom_action_event.rb', line 44 def event_info_url @event_info_url end |
#event_properties ⇒ Object
A list of additional properties for the event
47 48 49 |
# File 'lib/gong_api/models/custom_action_event.rb', line 47 def event_properties @event_properties end |
#event_timestamp ⇒ Object
The date and time when the event happened in the ISO-8601 format (e.g., ‘2021-08-01T02:30:00+05:00’ or ‘2021-08-01T08:00:00Z’, where Z stands for UTC);
50 51 52 |
# File 'lib/gong_api/models/custom_action_event.rb', line 50 def @event_timestamp end |
#mobile_app_id ⇒ Object
The application identification string in case of interaction via mobile application (bundle identifier or package name).
53 54 55 |
# File 'lib/gong_api/models/custom_action_event.rb', line 53 def mobile_app_id @mobile_app_id end |
#reporting_system ⇒ Object
The unique identifier of the reporting system. It is the same value in all events originating from the same system.
56 57 58 |
# File 'lib/gong_api/models/custom_action_event.rb', line 56 def reporting_system @reporting_system end |
#user_agent ⇒ Object
"User-Agent" header value for browser based interaction
59 60 61 |
# File 'lib/gong_api/models/custom_action_event.rb', line 59 def user_agent @user_agent end |
#workspace_id ⇒ Object
Optional workspace identifier. If specified, the event will be placed into this workspace, otherwise, the default algorithm for workspace placement will be applied.
62 63 64 |
# File 'lib/gong_api/models/custom_action_event.rb', line 62 def workspace_id @workspace_id end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/gong_api/models/custom_action_event.rb', line 87 def self.attribute_map { :'action_name' => :'actionName', :'actor' => :'actor', :'agent_platform' => :'agentPlatform', :'content_id' => :'contentId', :'content_properties' => :'contentProperties', :'content_title' => :'contentTitle', :'content_url' => :'contentUrl', :'crm_context' => :'crmContext', :'event_id' => :'eventId', :'event_info_url' => :'eventInfoUrl', :'event_properties' => :'eventProperties', :'event_timestamp' => :'eventTimestamp', :'mobile_app_id' => :'mobileAppId', :'reporting_system' => :'reportingSystem', :'user_agent' => :'userAgent', :'workspace_id' => :'workspaceId' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
295 296 297 |
# File 'lib/gong_api/models/custom_action_event.rb', line 295 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
131 132 133 134 |
# File 'lib/gong_api/models/custom_action_event.rb', line 131 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/gong_api/models/custom_action_event.rb', line 109 def self.openapi_types { :'action_name' => :'Object', :'actor' => :'Object', :'agent_platform' => :'Object', :'content_id' => :'Object', :'content_properties' => :'Object', :'content_title' => :'Object', :'content_url' => :'Object', :'crm_context' => :'Object', :'event_id' => :'Object', :'event_info_url' => :'Object', :'event_properties' => :'Object', :'event_timestamp' => :'Object', :'mobile_app_id' => :'Object', :'reporting_system' => :'Object', :'user_agent' => :'Object', :'workspace_id' => :'Object' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 |
# File 'lib/gong_api/models/custom_action_event.rb', line 259 def ==(o) return true if self.equal?(o) self.class == o.class && action_name == o.action_name && actor == o.actor && agent_platform == o.agent_platform && content_id == o.content_id && content_properties == o.content_properties && content_title == o.content_title && content_url == o.content_url && crm_context == o.crm_context && event_id == o.event_id && event_info_url == o.event_info_url && event_properties == o.event_properties && == o. && mobile_app_id == o.mobile_app_id && reporting_system == o.reporting_system && user_agent == o.user_agent && workspace_id == o.workspace_id end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
# File 'lib/gong_api/models/custom_action_event.rb', line 325 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 =~ /\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 GongAPI.const_get(type).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
394 395 396 397 398 399 400 401 402 403 404 405 406 |
# File 'lib/gong_api/models/custom_action_event.rb', line 394 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
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/gong_api/models/custom_action_event.rb', line 302 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| if 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]])) elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) end end self end |
#eql?(o) ⇒ Boolean
282 283 284 |
# File 'lib/gong_api/models/custom_action_event.rb', line 282 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
288 289 290 |
# File 'lib/gong_api/models/custom_action_event.rb', line 288 def hash [action_name, actor, agent_platform, content_id, content_properties, content_title, content_url, crm_context, event_id, event_info_url, event_properties, , mobile_app_id, reporting_system, user_agent, workspace_id].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/gong_api/models/custom_action_event.rb', line 224 def list_invalid_properties invalid_properties = Array.new if @event_timestamp.nil? invalid_properties.push('invalid value for "event_timestamp", event_timestamp cannot be nil.') end if @reporting_system.nil? invalid_properties.push('invalid value for "reporting_system", reporting_system cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
370 371 372 |
# File 'lib/gong_api/models/custom_action_event.rb', line 370 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
376 377 378 379 380 381 382 383 384 385 386 387 388 |
# File 'lib/gong_api/models/custom_action_event.rb', line 376 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
364 365 366 |
# File 'lib/gong_api/models/custom_action_event.rb', line 364 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
239 240 241 242 243 244 245 |
# File 'lib/gong_api/models/custom_action_event.rb', line 239 def valid? agent_platform_validator = EnumAttributeValidator.new('Object', ['Android', 'Linux', 'MacOS', 'Windows', 'iOS']) return false unless agent_platform_validator.valid?(@agent_platform) return false if @event_timestamp.nil? return false if @reporting_system.nil? true end |