Class: PinterestSdkClient::SSIOOrderLine
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- PinterestSdkClient::SSIOOrderLine
- Defined in:
- lib/pinterest_sdk/models/ssio_order_line.rb
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.
-
#ads_manager_order_line_id ⇒ Object
Ads manager OrderLineId.
-
#agency_link ⇒ Object
Agency link.
-
#bill_to_company_name ⇒ Object
Bill To Company name.
-
#billing_contact_email ⇒ Object
Billing contact email.
-
#billing_contact_firstname ⇒ Object
Billing contact first name.
-
#billing_contact_lastname ⇒ Object
Billing contact last name.
-
#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 the order line.
-
#estimated_monthly_spend ⇒ Object
If Ongoing (perpetual) order line, the estimated monthly spend.
-
#last_modified_date_time ⇒ Object
Last modified date.
-
#media_contact_email ⇒ Object
Billing media email.
-
#media_contact_firstname ⇒ Object
Billing contact first name.
-
#media_contact_lastname ⇒ Object
Billing contact first name.
-
#order_name ⇒ Object
The order name.
-
#pin_order_id ⇒ Object
The pin order id associated with the order line in SFDC.
-
#pmp_name ⇒ Object
The Pinterest marketing partner name.
-
#po_number ⇒ Object
The po number.
-
#salesforce_order_line_id ⇒ Object
OrderLineId in SFDC.
-
#start_date ⇒ Object
Start date of the order line.
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 = {}) ⇒ SSIOOrderLine
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 = {}) ⇒ SSIOOrderLine
Initializes the object
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 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 200 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `PinterestSdkClient::SSIOOrderLine` 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::SSIOOrderLine`. 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'] end if attributes.key?(:'accepted_terms_time') self.accepted_terms_time = attributes[:'accepted_terms_time'] 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?(:'agency_link') self.agency_link = attributes[:'agency_link'] end if attributes.key?(:'bill_to_company_name') self.bill_to_company_name = attributes[:'bill_to_company_name'] 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?(:'currency_info') self.currency_info = attributes[:'currency_info'] 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?(:'last_modified_date_time') self.last_modified_date_time = attributes[:'last_modified_date_time'] 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?(:'order_name') self.order_name = attributes[:'order_name'] end if attributes.key?(:'pin_order_id') self.pin_order_id = attributes[:'pin_order_id'] end if attributes.key?(:'pmp_name') self.pmp_name = attributes[:'pmp_name'] end if attributes.key?(:'po_number') self.po_number = attributes[:'po_number'] end if attributes.key?(:'salesforce_order_line_id') self.salesforce_order_line_id = attributes[:'salesforce_order_line_id'] end if attributes.key?(:'start_date') self.start_date = attributes[:'start_date'] end end |
Instance Attribute Details
#accepted_terms_id ⇒ Object
The SFDC id for the terms
19 20 21 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 19 def accepted_terms_id @accepted_terms_id end |
#accepted_terms_time ⇒ Object
The UTC timestamp (to the nearest sec) of when terms were accepted
22 23 24 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 22 def accepted_terms_time @accepted_terms_time end |
#ads_manager_order_line_id ⇒ Object
Ads manager OrderLineId
25 26 27 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 25 def ads_manager_order_line_id @ads_manager_order_line_id end |
#agency_link ⇒ Object
Agency link
28 29 30 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 28 def agency_link @agency_link end |
#bill_to_company_name ⇒ Object
Bill To Company name
31 32 33 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 31 def bill_to_company_name @bill_to_company_name end |
#billing_contact_email ⇒ Object
Billing contact email
34 35 36 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 34 def billing_contact_email @billing_contact_email end |
#billing_contact_firstname ⇒ Object
Billing contact first name
37 38 39 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 37 def billing_contact_firstname @billing_contact_firstname end |
#billing_contact_lastname ⇒ Object
Billing contact last name
40 41 42 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 40 def billing_contact_lastname @billing_contact_lastname end |
#budget_amount ⇒ Object
If Budget order line, the budget amount.
43 44 45 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 43 def budget_amount @budget_amount end |
#currency_info ⇒ Object
Returns the value of attribute currency_info.
45 46 47 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 45 def currency_info @currency_info end |
#end_date ⇒ Object
End date of the order line.
48 49 50 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 48 def end_date @end_date end |
#estimated_monthly_spend ⇒ Object
If Ongoing (perpetual) order line, the estimated monthly spend
51 52 53 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 51 def estimated_monthly_spend @estimated_monthly_spend end |
#last_modified_date_time ⇒ Object
Last modified date.
54 55 56 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 54 def last_modified_date_time @last_modified_date_time end |
#media_contact_email ⇒ Object
Billing media email
57 58 59 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 57 def media_contact_email @media_contact_email end |
#media_contact_firstname ⇒ Object
Billing contact first name
60 61 62 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 60 def media_contact_firstname @media_contact_firstname end |
#media_contact_lastname ⇒ Object
Billing contact first name
63 64 65 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 63 def media_contact_lastname @media_contact_lastname end |
#order_name ⇒ Object
The order name
66 67 68 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 66 def order_name @order_name end |
#pin_order_id ⇒ Object
The pin order id associated with the order line in SFDC
69 70 71 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 69 def pin_order_id @pin_order_id end |
#pmp_name ⇒ Object
The Pinterest marketing partner name
72 73 74 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 72 def pmp_name @pmp_name end |
#po_number ⇒ Object
The po number
75 76 77 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 75 def po_number @po_number end |
#salesforce_order_line_id ⇒ Object
OrderLineId in SFDC
78 79 80 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 78 def salesforce_order_line_id @salesforce_order_line_id end |
#start_date ⇒ Object
Start date of the order line.
81 82 83 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 81 def start_date @start_date end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
134 135 136 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 134 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
139 140 141 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 139 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 106 def self.attribute_map { :'accepted_terms_id' => :'accepted_terms_id', :'accepted_terms_time' => :'accepted_terms_time', :'ads_manager_order_line_id' => :'ads_manager_order_line_id', :'agency_link' => :'agency_link', :'bill_to_company_name' => :'bill_to_company_name', :'billing_contact_email' => :'billing_contact_email', :'billing_contact_firstname' => :'billing_contact_firstname', :'billing_contact_lastname' => :'billing_contact_lastname', :'budget_amount' => :'budget_amount', :'currency_info' => :'currency_info', :'end_date' => :'end_date', :'estimated_monthly_spend' => :'estimated_monthly_spend', :'last_modified_date_time' => :'last_modified_date_time', :'media_contact_email' => :'media_contact_email', :'media_contact_firstname' => :'media_contact_firstname', :'media_contact_lastname' => :'media_contact_lastname', :'order_name' => :'order_name', :'pin_order_id' => :'pin_order_id', :'pmp_name' => :'pmp_name', :'po_number' => :'po_number', :'salesforce_order_line_id' => :'salesforce_order_line_id', :'start_date' => :'start_date' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 396 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
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 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 172 def self.openapi_nullable Set.new([ :'accepted_terms_id', :'accepted_terms_time', :'ads_manager_order_line_id', :'agency_link', :'bill_to_company_name', :'billing_contact_email', :'billing_contact_firstname', :'billing_contact_lastname', :'budget_amount', :'end_date', :'estimated_monthly_spend', :'last_modified_date_time', :'media_contact_email', :'media_contact_firstname', :'media_contact_lastname', :'order_name', :'pin_order_id', :'pmp_name', :'po_number', :'salesforce_order_line_id', :'start_date' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 144 def self.openapi_types { :'accepted_terms_id' => :'String', :'accepted_terms_time' => :'String', :'ads_manager_order_line_id' => :'String', :'agency_link' => :'String', :'bill_to_company_name' => :'String', :'billing_contact_email' => :'String', :'billing_contact_firstname' => :'String', :'billing_contact_lastname' => :'String', :'budget_amount' => :'Float', :'currency_info' => :'Currency', :'end_date' => :'Date', :'estimated_monthly_spend' => :'Float', :'last_modified_date_time' => :'String', :'media_contact_email' => :'String', :'media_contact_firstname' => :'String', :'media_contact_lastname' => :'String', :'order_name' => :'String', :'pin_order_id' => :'String', :'pmp_name' => :'String', :'po_number' => :'String', :'salesforce_order_line_id' => :'String', :'start_date' => :'Date' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
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 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 354 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 && ads_manager_order_line_id == o.ads_manager_order_line_id && agency_link == o.agency_link && bill_to_company_name == o.bill_to_company_name && 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 && currency_info == o.currency_info && end_date == o.end_date && estimated_monthly_spend == o.estimated_monthly_spend && last_modified_date_time == o.last_modified_date_time && media_contact_email == o.media_contact_email && media_contact_firstname == o.media_contact_firstname && media_contact_lastname == o.media_contact_lastname && order_name == o.order_name && pin_order_id == o.pin_order_id && pmp_name == o.pmp_name && po_number == o.po_number && salesforce_order_line_id == o.salesforce_order_line_id && start_date == o.start_date end |
#eql?(o) ⇒ Boolean
383 384 385 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 383 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
389 390 391 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 389 def hash [accepted_terms_id, accepted_terms_time, ads_manager_order_line_id, agency_link, bill_to_company_name, billing_contact_email, billing_contact_firstname, billing_contact_lastname, budget_amount, currency_info, end_date, estimated_monthly_spend, last_modified_date_time, media_contact_email, media_contact_firstname, media_contact_lastname, order_name, pin_order_id, pmp_name, po_number, salesforce_order_line_id, start_date].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 305 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})T(\d{2}):(\d{2}):(\d{2}).(\d{3})Z$/) if !@accepted_terms_time.nil? && @accepted_terms_time !~ pattern invalid_properties.push("invalid value for \"accepted_terms_time\", must conform to the pattern #{pattern}.") end pattern = Regexp.new(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d{3})Z$/) if !@last_modified_date_time.nil? && @last_modified_date_time !~ pattern invalid_properties.push("invalid value for \"last_modified_date_time\", must conform to the pattern #{pattern}.") end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
418 419 420 421 422 423 424 425 426 427 428 429 430 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 418 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
323 324 325 326 327 328 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 323 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@accepted_terms_time.nil? && @accepted_terms_time !~ Regexp.new(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d{3})Z$/) return false if !@last_modified_date_time.nil? && @last_modified_date_time !~ Regexp.new(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d{3})Z$/) true end |