Class: Zernio::CreateTrackingTagEventRequest
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Zernio::CreateTrackingTagEventRequest
- Defined in:
- lib/zernio-sdk/models/create_tracking_tag_event_request.rb
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_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3).
-
.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 = {}) ⇒ CreateTrackingTagEventRequest
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 = {}) ⇒ CreateTrackingTagEventRequest
Initializes the object
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 170 171 172 173 174 175 176 177 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 122 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateTrackingTagEventRequest` 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::CreateTrackingTagEventRequest`. 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'] else self.name = nil 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.
19 20 21 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 19 def ad_account_id @ad_account_id end |
#click_window_days ⇒ Object
Returns the value of attribute click_window_days.
36 37 38 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 36 def click_window_days @click_window_days end |
#currency ⇒ Object
ISO 4217 code.
34 35 36 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 34 def currency @currency end |
#default_value ⇒ Object
Returns the value of attribute default_value.
31 32 33 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 31 def default_value @default_value end |
#enabled ⇒ Object
Returns the value of attribute enabled.
29 30 31 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 29 def enabled @enabled end |
#name ⇒ Object
Returns the value of attribute name.
21 22 23 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 21 def name @name end |
#site_event ⇒ Object
Neutral alternative to type, mapped to the platform's closest type.
27 28 29 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 27 def site_event @site_event end |
#type ⇒ Object
The platform's own event type enum value (e.g. PURCHASE).
24 25 26 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 24 def type @type end |
#url_contains ⇒ Object
Fire only on pages whose URL contains this text (case-insensitive).
41 42 43 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 41 def url_contains @url_contains end |
#view_window_days ⇒ Object
Returns the value of attribute view_window_days.
38 39 40 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 38 def view_window_days @view_window_days end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
82 83 84 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 82 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
87 88 89 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 87 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 66 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
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 374 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_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3)
114 115 116 117 118 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 114 def self.openapi_all_of [ :'TrackingTagEventInput' ] end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
108 109 110 111 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 108 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 92 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.
344 345 346 347 348 349 350 351 352 353 354 355 356 357 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 344 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
361 362 363 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 361 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
367 368 369 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 367 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?
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 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 181 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @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.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
396 397 398 399 400 401 402 403 404 405 406 407 408 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 396 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
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/zernio-sdk/models/create_tracking_tag_event_request.rb', line 229 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @name.nil? return false if @name.to_s.length > 200 return false if @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 |