Class: Zernio::UpdateTrackingTagRequest

Inherits:
ApiModelBase show all
Defined in:
lib/zernio-sdk/models/update_tracking_tag_request.rb

Overview

At least one updatable field is required; the route returns 400 if the body is empty or names a field the tag's platform cannot update.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ UpdateTrackingTagRequest

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {}) —

    Model attributes in the form of hash



108
109
110
111
112
113
114
115
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
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 108

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::UpdateTrackingTagRequest` 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::UpdateTrackingTagRequest`. 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. = attributes[:'ad_account_id']
  end

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.key?(:'enable_automatic_matching')
    self.enable_automatic_matching = attributes[:'enable_automatic_matching']
  end

  if attributes.key?(:'automatic_matching_fields')
    if (value = attributes[:'automatic_matching_fields']).is_a?(Array)
      self.automatic_matching_fields = value
    end
  end

  if attributes.key?(:'first_party_cookie_status')
    self.first_party_cookie_status = attributes[:'first_party_cookie_status']
  end

  if attributes.key?(:'data_use_setting')
    self.data_use_setting = attributes[:'data_use_setting']
  end

  if attributes.key?(:'enable_first_party_cookies')
    self.enable_first_party_cookies = attributes[:'enable_first_party_cookies']
  end

  if attributes.key?(:'auto_tagging')
    self.auto_tagging = attributes[:'auto_tagging']
  end
end

Instance Attribute Details

#ad_account_id ⇒ Object

Scopes the lookup on platforms whose tag ids live inside an ad account. Ignored elsewhere.



20
21
22
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 20

def 
  @ad_account_id
end

#auto_tagging ⇒ Object

Google Ads: turn gclid auto-tagging on or off for the ad account.



38
39
40
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 38

def auto_tagging
  @auto_tagging
end

#automatic_matching_fields ⇒ Object

Which user fields Advanced Matching may collect. Meta's terse codes: em=email, ph=phone, fn=first name, ln=last name, ge=gender, db=date of birth, ct=city, st=state, zp=zip.



28
29
30
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 28

def automatic_matching_fields
  @automatic_matching_fields
end

#data_use_setting ⇒ Object

Returns the value of attribute data_use_setting.



32
33
34
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 32

def data_use_setting
  @data_use_setting
end

#enable_automatic_matching ⇒ Object

Meta Advanced Matching toggle (enable_automatic_matching).



25
26
27
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 25

def enable_automatic_matching
  @enable_automatic_matching
end

#enable_first_party_cookies ⇒ Object

First-party cookie on or off (TikTok, LinkedIn). Platform-neutral alternative to firstPartyCookieStatus.



35
36
37
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 35

def enable_first_party_cookies
  @enable_first_party_cookies
end

Returns the value of attribute first_party_cookie_status.



30
31
32
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 30

def first_party_cookie_status
  @first_party_cookie_status
end

#name ⇒ Object

Returns the value of attribute name.



22
23
24
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 22

def name
  @name
end

Class Method Details

.acceptable_attribute_map ⇒ Object

Returns attribute mapping this model knows about



77
78
79
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 77

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributes ⇒ Object

Returns all the JSON keys this model knows about



82
83
84
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 82

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_map ⇒ Object

Attribute mapping from ruby-style variable name to JSON key.



63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 63

def self.attribute_map
  {
    :'ad_account_id' => :'adAccountId',
    :'name' => :'name',
    :'enable_automatic_matching' => :'enableAutomaticMatching',
    :'automatic_matching_fields' => :'automaticMatchingFields',
    :'first_party_cookie_status' => :'firstPartyCookieStatus',
    :'data_use_setting' => :'dataUseSetting',
    :'enable_first_party_cookies' => :'enableFirstPartyCookies',
    :'auto_tagging' => :'autoTagging'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash) —

    Model attributes in the form of hash

Returns:

  • (Object) —

    Returns the model itself



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 254

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



101
102
103
104
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 101

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_types ⇒ Object

Attribute type mapping.



87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 87

def self.openapi_types
  {
    :'ad_account_id' => :'String',
    :'name' => :'String',
    :'enable_automatic_matching' => :'Boolean',
    :'automatic_matching_fields' => :'Array<String>',
    :'first_party_cookie_status' => :'String',
    :'data_use_setting' => :'String',
    :'enable_first_party_cookies' => :'Boolean',
    :'auto_tagging' => :'Boolean'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object) —

    to be compared



226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 226

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
       == o. &&
      name == o.name &&
      enable_automatic_matching == o.enable_automatic_matching &&
      automatic_matching_fields == o.automatic_matching_fields &&
      first_party_cookie_status == o.first_party_cookie_status &&
      data_use_setting == o.data_use_setting &&
      enable_first_party_cookies == o.enable_first_party_cookies &&
      auto_tagging == o.auto_tagging
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object) —

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


241
242
243
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 241

def eql?(o)
  self == o
end

#hash ⇒ Integer

Calculates hash code according to all attributes.

Returns:

  • (Integer) —

    Hash code



247
248
249
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 247

def hash
  [, name, enable_automatic_matching, automatic_matching_fields, first_party_cookie_status, data_use_setting, enable_first_party_cookies, auto_tagging].hash
end

#list_invalid_properties ⇒ Object

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 159

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

  invalid_properties
end

#to_hash ⇒ Hash

Returns the object in the form of hash

Returns:

  • (Hash) —

    Returns the object in the form of hash



276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 276

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

Returns:

  • (Boolean) —

    true if the model is valid



175
176
177
178
179
180
181
182
183
184
# File 'lib/zernio-sdk/models/update_tracking_tag_request.rb', line 175

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
  first_party_cookie_status_validator = EnumAttributeValidator.new('String', ["empty", "first_party_cookie_disabled", "first_party_cookie_enabled"])
  return false unless first_party_cookie_status_validator.valid?(@first_party_cookie_status)
  data_use_setting_validator = EnumAttributeValidator.new('String', ["advertising_and_analytics", "analytics_only", "empty"])
  return false unless data_use_setting_validator.valid?(@data_use_setting)
  true
end