Class: Zernio::UpdateConversionDestinationRequest

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

Overview

At least one mutable field beyond adAccountId is required; the route returns 400 if no patch fields are provided.

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



106
107
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
# File 'lib/zernio-sdk/models/update_conversion_destination_request.rb', line 106

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

  if attributes.key?(:'enabled')
    self.enabled = attributes[:'enabled']
  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
end

Instance Attribute Details

#ad_account_idObject

Returns the value of attribute ad_account_id.



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

def 
  @ad_account_id
end

#attribution_typeObject

Returns the value of attribute attribution_type.



26
27
28
# File 'lib/zernio-sdk/models/update_conversion_destination_request.rb', line 26

def attribution_type
  @attribution_type
end

#enabledObject

Setting false is equivalent to calling DELETE — the rule will appear as inactive afterwards.



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

def enabled
  @enabled
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#post_click_attribution_window_sizeObject

365 only allowed for LEAD, PURCHASE, ADD_TO_CART, QUALIFIED_LEAD, SUBMIT_APPLICATION rule types.



29
30
31
# File 'lib/zernio-sdk/models/update_conversion_destination_request.rb', line 29

def post_click_attribution_window_size
  @post_click_attribution_window_size
end

#valueObject

Returns the value of attribute value.



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

def value
  @value
end

#value_typeObject

Returns the value of attribute value_type.



34
35
36
# File 'lib/zernio-sdk/models/update_conversion_destination_request.rb', line 34

def value_type
  @value_type
end

#view_through_attribution_window_sizeObject

365 only allowed for LEAD, PURCHASE, ADD_TO_CART, QUALIFIED_LEAD, SUBMIT_APPLICATION rule types.



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

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



75
76
77
# File 'lib/zernio-sdk/models/update_conversion_destination_request.rb', line 75

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



80
81
82
# File 'lib/zernio-sdk/models/update_conversion_destination_request.rb', line 80

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/zernio-sdk/models/update_conversion_destination_request.rb', line 61

def self.attribute_map
  {
    :'ad_account_id' => :'adAccountId',
    :'name' => :'name',
    :'enabled' => :'enabled',
    :'attribution_type' => :'attributionType',
    :'post_click_attribution_window_size' => :'postClickAttributionWindowSize',
    :'view_through_attribution_window_size' => :'viewThroughAttributionWindowSize',
    :'value_type' => :'valueType',
    :'value' => :'value'
  }
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



282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/zernio-sdk/models/update_conversion_destination_request.rb', line 282

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



99
100
101
102
# File 'lib/zernio-sdk/models/update_conversion_destination_request.rb', line 99

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

.openapi_typesObject

Attribute type mapping.



85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/zernio-sdk/models/update_conversion_destination_request.rb', line 85

def self.openapi_types
  {
    :'ad_account_id' => :'String',
    :'name' => :'String',
    :'enabled' => :'Boolean',
    :'attribution_type' => :'String',
    :'post_click_attribution_window_size' => :'Integer',
    :'view_through_attribution_window_size' => :'Integer',
    :'value_type' => :'String',
    :'value' => :'UpdateConversionDestinationRequestValue'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/zernio-sdk/models/update_conversion_destination_request.rb', line 254

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
       == o. &&
      name == o.name &&
      enabled == o.enabled &&
      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
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


269
270
271
# File 'lib/zernio-sdk/models/update_conversion_destination_request.rb', line 269

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



275
276
277
# File 'lib/zernio-sdk/models/update_conversion_destination_request.rb', line 275

def hash
  [, name, enabled, attribution_type, post_click_attribution_window_size, view_through_attribution_window_size, value_type, value].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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

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? && @name.to_s.length > 255
    invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



304
305
306
307
308
309
310
311
312
313
314
315
316
# File 'lib/zernio-sdk/models/update_conversion_destination_request.rb', line 304

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



173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/zernio-sdk/models/update_conversion_destination_request.rb', line 173

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @ad_account_id.nil?
  return false if !@name.nil? && @name.to_s.length > 255
  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)
  true
end