Class: PinterestSdkClient::SSIOEditInsertionOrderRequest

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/pinterest_sdk/models/ssio_edit_insertion_order_request.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 = {}) ⇒ SSIOEditInsertionOrderRequest

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
209
210
211
212
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 135

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#ads_manager_order_line_idObject

Ads manager OrderLineId



55
56
57
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 55

def ads_manager_order_line_id
  @ads_manager_order_line_id
end

URL link for agency



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

def agency_link
  @agency_link
end

#billing_contact_emailObject

The billing contact email



22
23
24
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 22

def billing_contact_email
  @billing_contact_email
end

#billing_contact_firstnameObject

The billing contact first name



25
26
27
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 25

def billing_contact_firstname
  @billing_contact_firstname
end

#billing_contact_lastnameObject

The billing contact last name



28
29
30
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 28

def billing_contact_lastname
  @billing_contact_lastname
end

#budget_amountObject

If Budget order line, the budget amount.



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

def budget_amount
  @budget_amount
end

#end_dateObject

End date of time period. Format: YYYY-MM-DD



34
35
36
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 34

def end_date
  @end_date
end

#media_contact_emailObject

The media contact email



37
38
39
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 37

def media_contact_email
  @media_contact_email
end

#media_contact_firstnameObject

The media contact first name



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

def media_contact_firstname
  @media_contact_firstname
end

#media_contact_lastnameObject

The media contact last name



43
44
45
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 43

def media_contact_lastname
  @media_contact_lastname
end

#oracle_line_idObject

LineId in the Oracle DB



58
59
60
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 58

def oracle_line_id
  @oracle_line_id
end

#po_numberObject

The po number



46
47
48
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 46

def po_number
  @po_number
end

#salesforce_order_idObject

OrderId in SFDC



61
62
63
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 61

def salesforce_order_id
  @salesforce_order_id
end

#salesforce_order_line_idObject

OrderLineId in SFDC



64
65
66
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 64

def salesforce_order_line_id
  @salesforce_order_line_id
end

#start_dateObject

Starting date of time period. Format: YYYY-MM-DD



49
50
51
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 49

def start_date
  @start_date
end

#user_emailObject

The email of user submitting the insertion order



52
53
54
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 52

def user_email
  @user_email
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



89
90
91
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_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/pinterest_sdk/models/ssio_edit_insertion_order_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.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 67

def self.attribute_map
  {
    :'agency_link' => :'agency_link',
    :'billing_contact_email' => :'billing_contact_email',
    :'billing_contact_firstname' => :'billing_contact_firstname',
    :'billing_contact_lastname' => :'billing_contact_lastname',
    :'budget_amount' => :'budget_amount',
    :'end_date' => :'end_date',
    :'media_contact_email' => :'media_contact_email',
    :'media_contact_firstname' => :'media_contact_firstname',
    :'media_contact_lastname' => :'media_contact_lastname',
    :'po_number' => :'po_number',
    :'start_date' => :'start_date',
    :'user_email' => :'user_email',
    :'ads_manager_order_line_id' => :'ads_manager_order_line_id',
    :'oracle_line_id' => :'oracle_line_id',
    :'salesforce_order_id' => :'salesforce_order_id',
    :'salesforce_order_line_id' => :'salesforce_order_line_id'
  }
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



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 309

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_all_ofObject

List of class defined in allOf (OpenAPI v3)



127
128
129
130
131
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 127

def self.openapi_all_of
  [
  :'SSIOInsertionOrderCommon'
  ]
end

.openapi_nullableObject

List of attributes with nullable: true



121
122
123
124
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 121

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
114
115
116
117
118
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 99

def self.openapi_types
  {
    :'agency_link' => :'String',
    :'billing_contact_email' => :'String',
    :'billing_contact_firstname' => :'String',
    :'billing_contact_lastname' => :'String',
    :'budget_amount' => :'Float',
    :'end_date' => :'String',
    :'media_contact_email' => :'String',
    :'media_contact_firstname' => :'String',
    :'media_contact_lastname' => :'String',
    :'po_number' => :'String',
    :'start_date' => :'String',
    :'user_email' => :'String',
    :'ads_manager_order_line_id' => :'String',
    :'oracle_line_id' => :'String',
    :'salesforce_order_id' => :'String',
    :'salesforce_order_line_id' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 273

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      agency_link == o.agency_link &&
      billing_contact_email == o.billing_contact_email &&
      billing_contact_firstname == o.billing_contact_firstname &&
      billing_contact_lastname == o.billing_contact_lastname &&
      budget_amount == o.budget_amount &&
      end_date == o.end_date &&
      media_contact_email == o.media_contact_email &&
      media_contact_firstname == o.media_contact_firstname &&
      media_contact_lastname == o.media_contact_lastname &&
      po_number == o.po_number &&
      start_date == o.start_date &&
      user_email == o.user_email &&
      ads_manager_order_line_id == o.ads_manager_order_line_id &&
      oracle_line_id == o.oracle_line_id &&
      salesforce_order_id == o.salesforce_order_id &&
      salesforce_order_line_id == o.salesforce_order_line_id
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


296
297
298
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 296

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



302
303
304
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 302

def hash
  [agency_link, billing_contact_email, billing_contact_firstname, billing_contact_lastname, budget_amount, end_date, media_contact_email, media_contact_firstname, media_contact_lastname, po_number, start_date, user_email, ads_manager_order_line_id, oracle_line_id, salesforce_order_id, salesforce_order_line_id].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 216

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  pattern = Regexp.new(/^(\d{4})-(\d{2})-(\d{2})$/)
  if !@end_date.nil? && @end_date !~ pattern
    invalid_properties.push("invalid value for \"end_date\", must conform to the pattern #{pattern}.")
  end

  pattern = Regexp.new(/^(\d{4})-(\d{2})-(\d{2})$/)
  if !@start_date.nil? && @start_date !~ pattern
    invalid_properties.push("invalid value for \"start_date\", must conform to the pattern #{pattern}.")
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



331
332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 331

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



234
235
236
237
238
239
# File 'lib/pinterest_sdk/models/ssio_edit_insertion_order_request.rb', line 234

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if !@end_date.nil? && @end_date !~ Regexp.new(/^(\d{4})-(\d{2})-(\d{2})$/)
  return false if !@start_date.nil? && @start_date !~ Regexp.new(/^(\d{4})-(\d{2})-(\d{2})$/)
  true
end