Class: Zernio::TrackingTagEventInput
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Zernio::TrackingTagEventInput
- Defined in:
- lib/zernio-sdk/models/tracking_tag_event_input.rb
Overview
Conversion event fields. Each platform stores a subset; a field it does not store answers 400 naming the supported ones.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#ad_account_id ⇒ Object
Scopes the lookup on platforms whose tag ids live inside an ad account.
-
#click_window_days ⇒ Object
Returns the value of attribute click_window_days.
-
#currency ⇒ Object
ISO 4217 code.
-
#default_value ⇒ Object
Returns the value of attribute default_value.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#name ⇒ Object
Returns the value of attribute name.
-
#site_event ⇒ Object
Neutral alternative to
type, mapped to the platform's closest type. -
#type ⇒ Object
The platform's own event type enum value (e.g.
PURCHASE). -
#url_contains ⇒ Object
Fire only on pages whose URL contains this text (case-insensitive).
-
#view_window_days ⇒ Object
Returns the value of attribute view_window_days.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.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.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ TrackingTagEventInput
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ TrackingTagEventInput
Initializes the object
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 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 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 116 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::TrackingTagEventInput` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::TrackingTagEventInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'ad_account_id') self.ad_account_id = attributes[:'ad_account_id'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'site_event') self.site_event = attributes[:'site_event'] end if attributes.key?(:'enabled') self.enabled = attributes[:'enabled'] end if attributes.key?(:'default_value') self.default_value = attributes[:'default_value'] end if attributes.key?(:'currency') self.currency = attributes[:'currency'] end if attributes.key?(:'click_window_days') self.click_window_days = attributes[:'click_window_days'] end if attributes.key?(:'view_window_days') self.view_window_days = attributes[:'view_window_days'] end if attributes.key?(:'url_contains') self.url_contains = attributes[:'url_contains'] end end |
Instance Attribute Details
#ad_account_id ⇒ Object
Scopes the lookup on platforms whose tag ids live inside an ad account.
20 21 22 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 20 def ad_account_id @ad_account_id end |
#click_window_days ⇒ Object
Returns the value of attribute click_window_days.
37 38 39 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 37 def click_window_days @click_window_days end |
#currency ⇒ Object
ISO 4217 code.
35 36 37 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 35 def currency @currency end |
#default_value ⇒ Object
Returns the value of attribute default_value.
32 33 34 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 32 def default_value @default_value end |
#enabled ⇒ Object
Returns the value of attribute enabled.
30 31 32 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 30 def enabled @enabled end |
#name ⇒ Object
Returns the value of attribute name.
22 23 24 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 22 def name @name end |
#site_event ⇒ Object
Neutral alternative to type, mapped to the platform's closest type.
28 29 30 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 28 def site_event @site_event end |
#type ⇒ Object
The platform's own event type enum value (e.g. PURCHASE).
25 26 27 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 25 def type @type end |
#url_contains ⇒ Object
Fire only on pages whose URL contains this text (case-insensitive).
42 43 44 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 42 def url_contains @url_contains end |
#view_window_days ⇒ Object
Returns the value of attribute view_window_days.
39 40 41 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 39 def view_window_days @view_window_days end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
83 84 85 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 83 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
88 89 90 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 88 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 67 def self.attribute_map { :'ad_account_id' => :'adAccountId', :'name' => :'name', :'type' => :'type', :'site_event' => :'siteEvent', :'enabled' => :'enabled', :'default_value' => :'defaultValue', :'currency' => :'currency', :'click_window_days' => :'clickWindowDays', :'view_window_days' => :'viewWindowDays', :'url_contains' => :'urlContains' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 361 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{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[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
109 110 111 112 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 109 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 93 def self.openapi_types { :'ad_account_id' => :'String', :'name' => :'String', :'type' => :'String', :'site_event' => :'String', :'enabled' => :'Boolean', :'default_value' => :'Float', :'currency' => :'String', :'click_window_days' => :'Integer', :'view_window_days' => :'Integer', :'url_contains' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 331 def ==(o) return true if self.equal?(o) self.class == o.class && ad_account_id == o.ad_account_id && name == o.name && type == o.type && site_event == o.site_event && enabled == o.enabled && default_value == o.default_value && currency == o.currency && click_window_days == o.click_window_days && view_window_days == o.view_window_days && url_contains == o.url_contains end |
#eql?(o) ⇒ Boolean
348 349 350 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 348 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
354 355 356 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 354 def hash [ad_account_id, name, type, site_event, enabled, default_value, currency, click_window_days, view_window_days, url_contains].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 173 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if !@name.nil? && @name.to_s.length > 200 invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 200.') end if !@name.nil? && @name.to_s.length < 1 invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.') end if !@default_value.nil? && @default_value < 0 invalid_properties.push('invalid value for "default_value", must be greater than or equal to 0.') end if !@click_window_days.nil? && @click_window_days > 365 invalid_properties.push('invalid value for "click_window_days", must be smaller than or equal to 365.') end if !@click_window_days.nil? && @click_window_days < 1 invalid_properties.push('invalid value for "click_window_days", must be greater than or equal to 1.') end if !@view_window_days.nil? && @view_window_days > 365 invalid_properties.push('invalid value for "view_window_days", must be smaller than or equal to 365.') end if !@view_window_days.nil? && @view_window_days < 0 invalid_properties.push('invalid value for "view_window_days", must be greater than or equal to 0.') end if !@url_contains.nil? && @url_contains.to_s.length > 500 invalid_properties.push('invalid value for "url_contains", the character length must be smaller than or equal to 500.') end if !@url_contains.nil? && @url_contains.to_s.length < 1 invalid_properties.push('invalid value for "url_contains", the character length must be greater than or equal to 1.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
383 384 385 386 387 388 389 390 391 392 393 394 395 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 383 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 |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/zernio-sdk/models/tracking_tag_event_input.rb', line 217 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@name.nil? && @name.to_s.length > 200 return false if !@name.nil? && @name.to_s.length < 1 site_event_validator = EnumAttributeValidator.new('String', ["page_view", "view_content", "add_to_cart", "search", "initiate_checkout", "add_payment_info", "purchase"]) return false unless site_event_validator.valid?(@site_event) return false if !@default_value.nil? && @default_value < 0 return false if !@click_window_days.nil? && @click_window_days > 365 return false if !@click_window_days.nil? && @click_window_days < 1 return false if !@view_window_days.nil? && @view_window_days > 365 return false if !@view_window_days.nil? && @view_window_days < 0 return false if !@url_contains.nil? && @url_contains.to_s.length > 500 return false if !@url_contains.nil? && @url_contains.to_s.length < 1 true end |