Class: Zernio::CreateConversionDestinationRequest

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/zernio-sdk/models/create_conversion_destination_request.rb

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 = {}) ⇒ CreateConversionDestinationRequest

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 123

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

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

  if attributes.key?(:'type')
    self.type = attributes[:'type']
  else
    self.type = nil
  end

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

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

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

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

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

  if attributes.key?(:'auto_association_type')
    self.auto_association_type = attributes[:'auto_association_type']
  else
    self.auto_association_type = 'ALL_CAMPAIGNS'
  end

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

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

Instance Attribute Details

#ad_account_idObject

Ad account ID. For LinkedIn: numeric (e.g. "5123456") or full urn:li:sponsoredAccount:{id} URN. For Google: numeric customer ID (e.g. "1234567890") or customers/{id} form.



19
20
21
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 19

def 
  @ad_account_id
end

#attribution_typeObject

LinkedIn only.



27
28
29
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 27

def attribution_type
  @attribution_type
end

#auto_association_typeObject

LinkedIn only. Controls campaign association at rule-creation time: - ALL_CAMPAIGNS: associate the rule with every active, paused, and draft campaign in the ad account - OBJECTIVE_BASED: associate only campaigns whose objective matches the rule's type - NONE: don't auto-associate. Manage associations via the /associations endpoints below. Note: auto-association runs once at create time; new campaigns added after the rule still need explicit association.



41
42
43
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 41

def auto_association_type
  @auto_association_type
end

#counting_typeObject

Google Ads only. Whether to count multiple conversions from the same click (MANY_PER_CLICK) or at most one (ONE_PER_CLICK). Defaults to MANY_PER_CLICK if omitted.



44
45
46
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 44

def counting_type
  @counting_type
end

#nameObject

Returns the value of attribute name.



21
22
23
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 21

def name
  @name
end

#post_click_attribution_window_sizeObject

LinkedIn only. Default 30. 365 only allowed for LEAD, PURCHASE, ADD_TO_CART, QUALIFIED_LEAD, SUBMIT_APPLICATION rule types; the API rejects other combinations locally.



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

def post_click_attribution_window_size
  @post_click_attribution_window_size
end

#primary_for_goalObject

Google Ads only. When true, the conversion action is marked as primary and immediately influences Smart Bidding. Defaults to false (secondary, record-only) to avoid unintentionally steering the customer's campaigns on creation.



47
48
49
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 47

def primary_for_goal
  @primary_for_goal
end

#typeObject

Conversion type. For LinkedIn: a unified standard event name (e.g. "Purchase", "Lead", "AddToCart") or a LinkedIn rule type enum (e.g. "PURCHASE", "QUALIFIED_LEAD"). For Google: a unified standard event name (Purchase, Subscribe, CompleteRegistration, Lead, Schedule) or a Google ConversionActionCategory enum value directly (e.g. "PURCHASE", "SUBSCRIBE_PAID", "SIGNUP", "IMPORTED_LEAD", "BOOK_APPOINTMENT"). Unknown values pass through to the platform.



24
25
26
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 24

def type
  @type
end

#valueObject

Returns the value of attribute value.



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

def value
  @value
end

#value_typeObject

LinkedIn only. DYNAMIC (default) uses the per-event value from sendConversions. FIXED uses the rule's value field. NO_VALUE drops monetary value entirely.



36
37
38
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 36

def value_type
  @value_type
end

#view_through_attribution_window_sizeObject

LinkedIn only. Default 7. Same 365-day-window type restriction applies as postClickAttributionWindowSize.



33
34
35
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 33

def view_through_attribution_window_size
  @view_through_attribution_window_size
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



89
90
91
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 89

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



94
95
96
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 94

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 72

def self.attribute_map
  {
    :'ad_account_id' => :'adAccountId',
    :'name' => :'name',
    :'type' => :'type',
    :'attribution_type' => :'attributionType',
    :'post_click_attribution_window_size' => :'postClickAttributionWindowSize',
    :'view_through_attribution_window_size' => :'viewThroughAttributionWindowSize',
    :'value_type' => :'valueType',
    :'value' => :'value',
    :'auto_association_type' => :'autoAssociationType',
    :'counting_type' => :'countingType',
    :'primary_for_goal' => :'primaryForGoal'
  }
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



364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 364

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_nullableObject

List of attributes with nullable: true



116
117
118
119
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 116

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

.openapi_typesObject

Attribute type mapping.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 99

def self.openapi_types
  {
    :'ad_account_id' => :'String',
    :'name' => :'String',
    :'type' => :'String',
    :'attribution_type' => :'String',
    :'post_click_attribution_window_size' => :'Integer',
    :'view_through_attribution_window_size' => :'Integer',
    :'value_type' => :'String',
    :'value' => :'CreateConversionDestinationRequestValue',
    :'auto_association_type' => :'String',
    :'counting_type' => :'String',
    :'primary_for_goal' => :'Boolean'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 333

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
       == o. &&
      name == o.name &&
      type == o.type &&
      attribution_type == o.attribution_type &&
      post_click_attribution_window_size == o.post_click_attribution_window_size &&
      view_through_attribution_window_size == o.view_through_attribution_window_size &&
      value_type == o.value_type &&
      value == o.value &&
      auto_association_type == o.auto_association_type &&
      counting_type == o.counting_type &&
      primary_for_goal == o.primary_for_goal
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


351
352
353
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 351

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



357
358
359
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 357

def hash
  [, name, type, attribution_type, post_click_attribution_window_size, view_through_attribution_window_size, value_type, value, auto_association_type, counting_type, primary_for_goal].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 192

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @ad_account_id.nil?
    invalid_properties.push('invalid value for "ad_account_id", ad_account_id cannot be nil.')
  end

  if @name.nil?
    invalid_properties.push('invalid value for "name", name cannot be nil.')
  end

  if @name.to_s.length > 255
    invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
  end

  if @type.nil?
    invalid_properties.push('invalid value for "type", type cannot be nil.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 386

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



216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/zernio-sdk/models/create_conversion_destination_request.rb', line 216

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @ad_account_id.nil?
  return false if @name.nil?
  return false if @name.to_s.length > 255
  return false if @type.nil?
  attribution_type_validator = EnumAttributeValidator.new('String', ["LAST_TOUCH_BY_CAMPAIGN", "LAST_TOUCH_BY_CONVERSION"])
  return false unless attribution_type_validator.valid?(@attribution_type)
  post_click_attribution_window_size_validator = EnumAttributeValidator.new('Integer', [1, 7, 30, 90, 365])
  return false unless post_click_attribution_window_size_validator.valid?(@post_click_attribution_window_size)
  view_through_attribution_window_size_validator = EnumAttributeValidator.new('Integer', [1, 7, 30, 90, 365])
  return false unless view_through_attribution_window_size_validator.valid?(@view_through_attribution_window_size)
  value_type_validator = EnumAttributeValidator.new('String', ["DYNAMIC", "FIXED", "NO_VALUE"])
  return false unless value_type_validator.valid?(@value_type)
  auto_association_type_validator = EnumAttributeValidator.new('String', ["ALL_CAMPAIGNS", "OBJECTIVE_BASED", "NONE"])
  return false unless auto_association_type_validator.valid?(@auto_association_type)
  counting_type_validator = EnumAttributeValidator.new('String', ["MANY_PER_CLICK", "ONE_PER_CLICK"])
  return false unless counting_type_validator.valid?(@counting_type)
  true
end