Class: PinterestSdkClient::SSIOInsertionOrderCreate
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- PinterestSdkClient::SSIOInsertionOrderCreate
- Defined in:
- lib/pinterest_sdk/models/ssio_insertion_order_create.rb
Overview
Resource create operation model.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#accepted_terms_id ⇒ Object
The SFDC id for the terms.
-
#accepted_terms_time ⇒ Object
The UTC timestamp (to the nearest sec) of when terms were accepted.
-
#agency_link ⇒ Object
URL link for agency.
-
#billing_contact_email ⇒ Object
The billing contact email.
-
#billing_contact_firstname ⇒ Object
The billing contact first name.
-
#billing_contact_lastname ⇒ Object
The billing contact last name.
-
#billto_billing_address_id ⇒ Object
The bill-to billing address id.
-
#billto_business_address_id ⇒ Object
The bill-to business address id.
-
#billto_company_id ⇒ Object
The bill-to company id.
-
#budget_amount ⇒ Object
If Budget order line, the budget amount.
-
#currency_info ⇒ Object
Returns the value of attribute currency_info.
-
#end_date ⇒ Object
End date of time period.
-
#estimated_monthly_spend ⇒ Object
If Ongoing (perpetual) order line, the estimated monthly spend.
-
#media_contact_email ⇒ Object
The media contact email.
-
#media_contact_firstname ⇒ Object
The media contact first name.
-
#media_contact_lastname ⇒ Object
The media contact last name.
-
#order_line_type ⇒ Object
Type can be Budget or Perpetual.
-
#order_name ⇒ Object
The order name.
-
#pmp_id ⇒ Object
The pmp id.
-
#po_number ⇒ Object
The po number.
-
#start_date ⇒ Object
Starting date of time period.
-
#user_email ⇒ Object
The email of user submitting the insertion order.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ SSIOInsertionOrderCreate
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ SSIOInsertionOrderCreate
Initializes the object
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 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 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 180 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `PinterestSdkClient::SSIOInsertionOrderCreate` 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::SSIOInsertionOrderCreate`. 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?(:'accepted_terms_id') self.accepted_terms_id = attributes[:'accepted_terms_id'] else self.accepted_terms_id = nil end if attributes.key?(:'accepted_terms_time') self.accepted_terms_time = attributes[:'accepted_terms_time'] end 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'] else self.billing_contact_email = nil end if attributes.key?(:'billing_contact_firstname') self.billing_contact_firstname = attributes[:'billing_contact_firstname'] else self.billing_contact_firstname = nil end if attributes.key?(:'billing_contact_lastname') self.billing_contact_lastname = attributes[:'billing_contact_lastname'] else self.billing_contact_lastname = nil end if attributes.key?(:'billto_billing_address_id') self.billto_billing_address_id = attributes[:'billto_billing_address_id'] else self.billto_billing_address_id = nil end if attributes.key?(:'billto_business_address_id') self.billto_business_address_id = attributes[:'billto_business_address_id'] else self.billto_business_address_id = nil end if attributes.key?(:'billto_company_id') self.billto_company_id = attributes[:'billto_company_id'] else self.billto_company_id = nil end if attributes.key?(:'budget_amount') self.budget_amount = attributes[:'budget_amount'] end if attributes.key?(:'currency_info') self.currency_info = attributes[:'currency_info'] else self.currency_info = nil end if attributes.key?(:'end_date') self.end_date = attributes[:'end_date'] end if attributes.key?(:'estimated_monthly_spend') self.estimated_monthly_spend = attributes[:'estimated_monthly_spend'] end if attributes.key?(:'media_contact_email') self.media_contact_email = attributes[:'media_contact_email'] else self.media_contact_email = nil end if attributes.key?(:'media_contact_firstname') self.media_contact_firstname = attributes[:'media_contact_firstname'] else self.media_contact_firstname = nil end if attributes.key?(:'media_contact_lastname') self.media_contact_lastname = attributes[:'media_contact_lastname'] else self.media_contact_lastname = nil end if attributes.key?(:'order_line_type') self.order_line_type = attributes[:'order_line_type'] else self.order_line_type = nil end if attributes.key?(:'order_name') self.order_name = attributes[:'order_name'] else self.order_name = nil end if attributes.key?(:'pmp_id') self.pmp_id = attributes[:'pmp_id'] else self.pmp_id = nil end if attributes.key?(:'po_number') self.po_number = attributes[:'po_number'] else self.po_number = nil end if attributes.key?(:'start_date') self.start_date = attributes[:'start_date'] else self.start_date = nil end if attributes.key?(:'user_email') self.user_email = attributes[:'user_email'] end end |
Instance Attribute Details
#accepted_terms_id ⇒ Object
The SFDC id for the terms
20 21 22 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 20 def accepted_terms_id @accepted_terms_id end |
#accepted_terms_time ⇒ Object
The UTC timestamp (to the nearest sec) of when terms were accepted
23 24 25 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 23 def accepted_terms_time @accepted_terms_time end |
#agency_link ⇒ Object
URL link for agency
26 27 28 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 26 def agency_link @agency_link end |
#billing_contact_email ⇒ Object
The billing contact email
29 30 31 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 29 def billing_contact_email @billing_contact_email end |
#billing_contact_firstname ⇒ Object
The billing contact first name
32 33 34 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 32 def billing_contact_firstname @billing_contact_firstname end |
#billing_contact_lastname ⇒ Object
The billing contact last name
35 36 37 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 35 def billing_contact_lastname @billing_contact_lastname end |
#billto_billing_address_id ⇒ Object
The bill-to billing address id
38 39 40 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 38 def billto_billing_address_id @billto_billing_address_id end |
#billto_business_address_id ⇒ Object
The bill-to business address id
41 42 43 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 41 def billto_business_address_id @billto_business_address_id end |
#billto_company_id ⇒ Object
The bill-to company id
44 45 46 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 44 def billto_company_id @billto_company_id end |
#budget_amount ⇒ Object
If Budget order line, the budget amount.
47 48 49 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 47 def budget_amount @budget_amount end |
#currency_info ⇒ Object
Returns the value of attribute currency_info.
49 50 51 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 49 def currency_info @currency_info end |
#end_date ⇒ Object
End date of time period. Format: YYYY-MM-DD
52 53 54 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 52 def end_date @end_date end |
#estimated_monthly_spend ⇒ Object
If Ongoing (perpetual) order line, the estimated monthly spend
55 56 57 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 55 def estimated_monthly_spend @estimated_monthly_spend end |
#media_contact_email ⇒ Object
The media contact email
58 59 60 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 58 def media_contact_email @media_contact_email end |
#media_contact_firstname ⇒ Object
The media contact first name
61 62 63 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 61 def media_contact_firstname @media_contact_firstname end |
#media_contact_lastname ⇒ Object
The media contact last name
64 65 66 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 64 def media_contact_lastname @media_contact_lastname end |
#order_line_type ⇒ Object
Type can be Budget or Perpetual
67 68 69 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 67 def order_line_type @order_line_type end |
#order_name ⇒ Object
The order name
70 71 72 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 70 def order_name @order_name end |
#pmp_id ⇒ Object
The pmp id
73 74 75 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 73 def pmp_id @pmp_id end |
#po_number ⇒ Object
The po number
76 77 78 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 76 def po_number @po_number end |
#start_date ⇒ Object
Starting date of time period. Format: YYYY-MM-DD
79 80 81 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 79 def start_date @start_date end |
#user_email ⇒ Object
The email of user submitting the insertion order
82 83 84 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 82 def user_email @user_email end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
135 136 137 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 135 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
140 141 142 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 140 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 107 def self.attribute_map { :'accepted_terms_id' => :'accepted_terms_id', :'accepted_terms_time' => :'accepted_terms_time', :'agency_link' => :'agency_link', :'billing_contact_email' => :'billing_contact_email', :'billing_contact_firstname' => :'billing_contact_firstname', :'billing_contact_lastname' => :'billing_contact_lastname', :'billto_billing_address_id' => :'billto_billing_address_id', :'billto_business_address_id' => :'billto_business_address_id', :'billto_company_id' => :'billto_company_id', :'budget_amount' => :'budget_amount', :'currency_info' => :'currency_info', :'end_date' => :'end_date', :'estimated_monthly_spend' => :'estimated_monthly_spend', :'media_contact_email' => :'media_contact_email', :'media_contact_firstname' => :'media_contact_firstname', :'media_contact_lastname' => :'media_contact_lastname', :'order_line_type' => :'order_line_type', :'order_name' => :'order_name', :'pmp_id' => :'pmp_id', :'po_number' => :'po_number', :'start_date' => :'start_date', :'user_email' => :'user_email' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 646 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
173 174 175 176 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 173 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 145 def self.openapi_types { :'accepted_terms_id' => :'String', :'accepted_terms_time' => :'Integer', :'agency_link' => :'String', :'billing_contact_email' => :'String', :'billing_contact_firstname' => :'String', :'billing_contact_lastname' => :'String', :'billto_billing_address_id' => :'String', :'billto_business_address_id' => :'String', :'billto_company_id' => :'String', :'budget_amount' => :'Float', :'currency_info' => :'Currency', :'end_date' => :'String', :'estimated_monthly_spend' => :'Float', :'media_contact_email' => :'String', :'media_contact_firstname' => :'String', :'media_contact_lastname' => :'String', :'order_line_type' => :'SSIOOrderLineType', :'order_name' => :'String', :'pmp_id' => :'String', :'po_number' => :'String', :'start_date' => :'String', :'user_email' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 604 def ==(o) return true if self.equal?(o) self.class == o.class && accepted_terms_id == o.accepted_terms_id && accepted_terms_time == o.accepted_terms_time && 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 && billto_billing_address_id == o.billto_billing_address_id && billto_business_address_id == o.billto_business_address_id && billto_company_id == o.billto_company_id && budget_amount == o.budget_amount && currency_info == o.currency_info && end_date == o.end_date && estimated_monthly_spend == o.estimated_monthly_spend && media_contact_email == o.media_contact_email && media_contact_firstname == o.media_contact_firstname && media_contact_lastname == o.media_contact_lastname && order_line_type == o.order_line_type && order_name == o.order_name && pmp_id == o.pmp_id && po_number == o.po_number && start_date == o.start_date && user_email == o.user_email end |
#eql?(o) ⇒ Boolean
633 634 635 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 633 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
639 640 641 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 639 def hash [accepted_terms_id, accepted_terms_time, agency_link, billing_contact_email, billing_contact_firstname, billing_contact_lastname, billto_billing_address_id, billto_business_address_id, billto_company_id, budget_amount, currency_info, end_date, estimated_monthly_spend, media_contact_email, media_contact_firstname, media_contact_lastname, order_line_type, order_name, pmp_id, po_number, start_date, user_email].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 317 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @accepted_terms_id.nil? invalid_properties.push('invalid value for "accepted_terms_id", accepted_terms_id cannot be nil.') end if @billing_contact_email.nil? invalid_properties.push('invalid value for "billing_contact_email", billing_contact_email cannot be nil.') end if @billing_contact_firstname.nil? invalid_properties.push('invalid value for "billing_contact_firstname", billing_contact_firstname cannot be nil.') end if @billing_contact_lastname.nil? invalid_properties.push('invalid value for "billing_contact_lastname", billing_contact_lastname cannot be nil.') end if @billto_billing_address_id.nil? invalid_properties.push('invalid value for "billto_billing_address_id", billto_billing_address_id cannot be nil.') end if @billto_business_address_id.nil? invalid_properties.push('invalid value for "billto_business_address_id", billto_business_address_id cannot be nil.') end if @billto_company_id.nil? invalid_properties.push('invalid value for "billto_company_id", billto_company_id cannot be nil.') end if @currency_info.nil? invalid_properties.push('invalid value for "currency_info", currency_info cannot be nil.') end 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 if @media_contact_email.nil? invalid_properties.push('invalid value for "media_contact_email", media_contact_email cannot be nil.') end if @media_contact_firstname.nil? invalid_properties.push('invalid value for "media_contact_firstname", media_contact_firstname cannot be nil.') end if @media_contact_lastname.nil? invalid_properties.push('invalid value for "media_contact_lastname", media_contact_lastname cannot be nil.') end if @order_line_type.nil? invalid_properties.push('invalid value for "order_line_type", order_line_type cannot be nil.') end if @order_name.nil? invalid_properties.push('invalid value for "order_name", order_name cannot be nil.') end if @pmp_id.nil? invalid_properties.push('invalid value for "pmp_id", pmp_id cannot be nil.') end if @po_number.nil? invalid_properties.push('invalid value for "po_number", po_number cannot be nil.') end if @start_date.nil? invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') end pattern = Regexp.new(/^\d{4}-\d{2}-\d{2}$/) if @start_date !~ pattern invalid_properties.push("invalid value for \"start_date\", must conform to the pattern #{pattern}.") end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
668 669 670 671 672 673 674 675 676 677 678 679 680 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 668 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
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 |
# File 'lib/pinterest_sdk/models/ssio_insertion_order_create.rb', line 399 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @accepted_terms_id.nil? return false if @billing_contact_email.nil? return false if @billing_contact_firstname.nil? return false if @billing_contact_lastname.nil? return false if @billto_billing_address_id.nil? return false if @billto_business_address_id.nil? return false if @billto_company_id.nil? return false if @currency_info.nil? return false if !@end_date.nil? && @end_date !~ Regexp.new(/^\d{4}-\d{2}-\d{2}$/) return false if @media_contact_email.nil? return false if @media_contact_firstname.nil? return false if @media_contact_lastname.nil? return false if @order_line_type.nil? return false if @order_name.nil? return false if @pmp_id.nil? return false if @po_number.nil? return false if @start_date.nil? return false if @start_date !~ Regexp.new(/^\d{4}-\d{2}-\d{2}$/) true end |