Class: Zernio::GooglePmaxAssetGroup

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

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/zernio-sdk/models/google_pmax_asset_group.rb', line 109

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#ad_strength ⇒ Object

Google ad strength, such as POOR, AVERAGE, GOOD or EXCELLENT.



40
41
42
# File 'lib/zernio-sdk/models/google_pmax_asset_group.rb', line 40

def ad_strength
  @ad_strength
end

#assets ⇒ Object

Returns the value of attribute assets.



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

def assets
  @assets
end

#campaign_id ⇒ Object

Returns the value of attribute campaign_id.



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

def campaign_id
  @campaign_id
end

#final_mobile_urls ⇒ Object

Returns the value of attribute final_mobile_urls.



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

def final_mobile_urls
  @final_mobile_urls
end

#final_urls ⇒ Object

Returns the value of attribute final_urls.



31
32
33
# File 'lib/zernio-sdk/models/google_pmax_asset_group.rb', line 31

def final_urls
  @final_urls
end

#id ⇒ Object

Stable Google asset group id. Use it in the asset-group endpoints below.



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

def id
  @id
end

#name ⇒ Object

Returns the value of attribute name.



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

def name
  @name
end

#path1 ⇒ Object

Returns the value of attribute path1.



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

def path1
  @path1
end

#path2 ⇒ Object

Returns the value of attribute path2.



37
38
39
# File 'lib/zernio-sdk/models/google_pmax_asset_group.rb', line 37

def path2
  @path2
end

#primary_status ⇒ Object

Why the group is or is not serving, such as ELIGIBLE, PAUSED or NOT_ELIGIBLE.



43
44
45
# File 'lib/zernio-sdk/models/google_pmax_asset_group.rb', line 43

def primary_status
  @primary_status
end

#primary_status_reasons ⇒ Object

Returns the value of attribute primary_status_reasons.



45
46
47
# File 'lib/zernio-sdk/models/google_pmax_asset_group.rb', line 45

def primary_status_reasons
  @primary_status_reasons
end

#resource_name ⇒ Object

customers/customerId/assetGroups/assetGroupId



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

def resource_name
  @resource_name
end

#status ⇒ Object

Asset-group status on Google. Campaign status independently controls delivery.



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

def status
  @status
end

Class Method Details

.acceptable_attribute_map ⇒ Object

Returns attribute mapping this model knows about



69
70
71
# File 'lib/zernio-sdk/models/google_pmax_asset_group.rb', line 69

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributes ⇒ Object

Returns all the JSON keys this model knows about



74
75
76
# File 'lib/zernio-sdk/models/google_pmax_asset_group.rb', line 74

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_map ⇒ Object

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



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/zernio-sdk/models/google_pmax_asset_group.rb', line 50

def self.attribute_map
  {
    :'id' => :'id',
    :'resource_name' => :'resourceName',
    :'campaign_id' => :'campaignId',
    :'name' => :'name',
    :'status' => :'status',
    :'final_urls' => :'finalUrls',
    :'final_mobile_urls' => :'finalMobileUrls',
    :'path1' => :'path1',
    :'path2' => :'path2',
    :'ad_strength' => :'adStrength',
    :'primary_status' => :'primaryStatus',
    :'primary_status_reasons' => :'primaryStatusReasons',
    :'assets' => :'assets'
  }
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



395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'lib/zernio-sdk/models/google_pmax_asset_group.rb', line 395

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



98
99
100
101
102
103
104
105
# File 'lib/zernio-sdk/models/google_pmax_asset_group.rb', line 98

def self.openapi_nullable
  Set.new([
    :'path1',
    :'path2',
    :'ad_strength',
    :'primary_status',
  ])
end

.openapi_types ⇒ Object

Attribute type mapping.



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/zernio-sdk/models/google_pmax_asset_group.rb', line 79

def self.openapi_types
  {
    :'id' => :'String',
    :'resource_name' => :'String',
    :'campaign_id' => :'String',
    :'name' => :'String',
    :'status' => :'String',
    :'final_urls' => :'Array<String>',
    :'final_mobile_urls' => :'Array<String>',
    :'path1' => :'String',
    :'path2' => :'String',
    :'ad_strength' => :'String',
    :'primary_status' => :'String',
    :'primary_status_reasons' => :'Array<String>',
    :'assets' => :'Array<GooglePmaxAssetGroupAssetsInner>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object) —

    to be compared



362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# File 'lib/zernio-sdk/models/google_pmax_asset_group.rb', line 362

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      resource_name == o.resource_name &&
      campaign_id == o.campaign_id &&
      name == o.name &&
      status == o.status &&
      final_urls == o.final_urls &&
      final_mobile_urls == o.final_mobile_urls &&
      path1 == o.path1 &&
      path2 == o.path2 &&
      ad_strength == o.ad_strength &&
      primary_status == o.primary_status &&
      primary_status_reasons == o.primary_status_reasons &&
      assets == o.assets
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object) —

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


382
383
384
# File 'lib/zernio-sdk/models/google_pmax_asset_group.rb', line 382

def eql?(o)
  self == o
end

#hash ⇒ Integer

Calculates hash code according to all attributes.

Returns:

  • (Integer) —

    Hash code



388
389
390
# File 'lib/zernio-sdk/models/google_pmax_asset_group.rb', line 388

def hash
  [id, resource_name, campaign_id, name, status, final_urls, final_mobile_urls, path1, path2, ad_strength, primary_status, primary_status_reasons, assets].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



212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/zernio-sdk/models/google_pmax_asset_group.rb', line 212

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

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

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

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

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

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

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

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

  if @assets.nil?
    invalid_properties.push('invalid value for "assets", assets cannot be nil.')
  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



417
418
419
420
421
422
423
424
425
426
427
428
429
# File 'lib/zernio-sdk/models/google_pmax_asset_group.rb', line 417

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



256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/zernio-sdk/models/google_pmax_asset_group.rb', line 256

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @id.nil?
  return false if @resource_name.nil?
  return false if @campaign_id.nil?
  return false if @name.nil?
  return false if @status.nil?
  return false if @final_urls.nil?
  return false if @final_mobile_urls.nil?
  return false if @primary_status_reasons.nil?
  return false if @assets.nil?
  true
end