Class: PinterestSdkClient::QualityComponents

Inherits:
ApiModelBase show all
Defined in:
lib/pinterest_sdk/models/quality_components.rb

Overview

Set of quality components, with each component containing a event coverage and details.

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



96
97
98
99
100
101
102
103
104
105
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/pinterest_sdk/models/quality_components.rb', line 96

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#advertiser_external_idObject

Returns the value of attribute advertiser_external_id.



19
20
21
# File 'lib/pinterest_sdk/models/quality_components.rb', line 19

def advertiser_external_id
  @advertiser_external_id
end

#click_id_epikObject

Returns the value of attribute click_id_epik.



21
22
23
# File 'lib/pinterest_sdk/models/quality_components.rb', line 21

def click_id_epik
  @click_id_epik
end

#external_event_idObject

Dedup components.



24
25
26
# File 'lib/pinterest_sdk/models/quality_components.rb', line 24

def external_event_id
  @external_event_id
end

#hashed_emailObject

User matching identifiers.



27
28
29
# File 'lib/pinterest_sdk/models/quality_components.rb', line 27

def hashed_email
  @hashed_email
end

#hashed_maidObject

Returns the value of attribute hashed_maid.



29
30
31
# File 'lib/pinterest_sdk/models/quality_components.rb', line 29

def hashed_maid
  @hashed_maid
end

#ip_addressObject

Returns the value of attribute ip_address.



31
32
33
# File 'lib/pinterest_sdk/models/quality_components.rb', line 31

def ip_address
  @ip_address
end

#order_idObject

Returns the value of attribute order_id.



33
34
35
# File 'lib/pinterest_sdk/models/quality_components.rb', line 33

def order_id
  @order_id
end

#order_valueObject

Returns the value of attribute order_value.



35
36
37
# File 'lib/pinterest_sdk/models/quality_components.rb', line 35

def order_value
  @order_value
end

#product_idObject

Product/event metadata.



38
39
40
# File 'lib/pinterest_sdk/models/quality_components.rb', line 38

def product_id
  @product_id
end

#source_urlObject

Returns the value of attribute source_url.



40
41
42
# File 'lib/pinterest_sdk/models/quality_components.rb', line 40

def source_url
  @source_url
end

#user_agentObject

Returns the value of attribute user_agent.



42
43
44
# File 'lib/pinterest_sdk/models/quality_components.rb', line 42

def user_agent
  @user_agent
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



62
63
64
# File 'lib/pinterest_sdk/models/quality_components.rb', line 62

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



67
68
69
# File 'lib/pinterest_sdk/models/quality_components.rb', line 67

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/pinterest_sdk/models/quality_components.rb', line 45

def self.attribute_map
  {
    :'advertiser_external_id' => :'advertiser_external_id',
    :'click_id_epik' => :'click_id_epik',
    :'external_event_id' => :'external_event_id',
    :'hashed_email' => :'hashed_email',
    :'hashed_maid' => :'hashed_maid',
    :'ip_address' => :'ip_address',
    :'order_id' => :'order_id',
    :'order_value' => :'order_value',
    :'product_id' => :'product_id',
    :'source_url' => :'source_url',
    :'user_agent' => :'user_agent'
  }
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



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/pinterest_sdk/models/quality_components.rb', line 225

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



89
90
91
92
# File 'lib/pinterest_sdk/models/quality_components.rb', line 89

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

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'advertiser_external_id' => :'Hash<String, QualityComponentDetails>',
    :'click_id_epik' => :'Hash<String, QualityComponentDetails>',
    :'external_event_id' => :'Hash<String, QualityComponentDetails>',
    :'hashed_email' => :'Hash<String, QualityComponentDetails>',
    :'hashed_maid' => :'Hash<String, QualityComponentDetails>',
    :'ip_address' => :'Hash<String, QualityComponentDetails>',
    :'order_id' => :'Hash<String, QualityComponentDetails>',
    :'order_value' => :'Hash<String, QualityComponentDetails>',
    :'product_id' => :'Hash<String, QualityComponentDetails>',
    :'source_url' => :'Hash<String, QualityComponentDetails>',
    :'user_agent' => :'Hash<String, QualityComponentDetails>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/pinterest_sdk/models/quality_components.rb', line 194

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      advertiser_external_id == o.advertiser_external_id &&
      click_id_epik == o.click_id_epik &&
      external_event_id == o.external_event_id &&
      hashed_email == o.hashed_email &&
      hashed_maid == o.hashed_maid &&
      ip_address == o.ip_address &&
      order_id == o.order_id &&
      order_value == o.order_value &&
      product_id == o.product_id &&
      source_url == o.source_url &&
      user_agent == o.user_agent
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


212
213
214
# File 'lib/pinterest_sdk/models/quality_components.rb', line 212

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



218
219
220
# File 'lib/pinterest_sdk/models/quality_components.rb', line 218

def hash
  [advertiser_external_id, click_id_epik, external_event_id, hashed_email, hashed_maid, ip_address, order_id, order_value, product_id, source_url, user_agent].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



179
180
181
182
183
# File 'lib/pinterest_sdk/models/quality_components.rb', line 179

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/pinterest_sdk/models/quality_components.rb', line 247

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



187
188
189
190
# File 'lib/pinterest_sdk/models/quality_components.rb', line 187

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end