Class: PinterestSdkClient::SSIOOrderLine
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- PinterestSdkClient::SSIOOrderLine
- Defined in:
- lib/pinterest_sdk/models/ssio_order_line.rb
Overview
A Salesforce SSIO order line.
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 second) when terms were accepted.
-
#ads_manager_order_line_id ⇒ Object
Ads manager order line id.
-
#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 media contact first name.
-
#media_contact_lastname ⇒ Object
Billing media contact last 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
Order line id 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
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 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 201 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
20 21 22 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 20 def accepted_terms_id @accepted_terms_id end |
#accepted_terms_time ⇒ Object
The UTC timestamp (to the nearest second) when terms were accepted.
23 24 25 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 23 def accepted_terms_time @accepted_terms_time end |
#ads_manager_order_line_id ⇒ Object
Ads manager order line id
26 27 28 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 26 def ads_manager_order_line_id @ads_manager_order_line_id end |
#agency_link ⇒ Object
Agency link
29 30 31 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 29 def agency_link @agency_link end |
#bill_to_company_name ⇒ Object
Bill-to company name
32 33 34 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 32 def bill_to_company_name @bill_to_company_name end |
#billing_contact_email ⇒ Object
Billing contact email
35 36 37 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 35 def billing_contact_email @billing_contact_email end |
#billing_contact_firstname ⇒ Object
Billing contact first name
38 39 40 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 38 def billing_contact_firstname @billing_contact_firstname end |
#billing_contact_lastname ⇒ Object
Billing contact last name
41 42 43 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 41 def billing_contact_lastname @billing_contact_lastname end |
#budget_amount ⇒ Object
If budget order line, the budget amount.
44 45 46 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 44 def budget_amount @budget_amount end |
#currency_info ⇒ Object
Returns the value of attribute currency_info.
46 47 48 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 46 def currency_info @currency_info end |
#end_date ⇒ Object
End date of the order line.
49 50 51 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 49 def end_date @end_date end |
#estimated_monthly_spend ⇒ Object
If ongoing (perpetual) order line, the estimated monthly spend.
52 53 54 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 52 def estimated_monthly_spend @estimated_monthly_spend end |
#last_modified_date_time ⇒ Object
Last modified date.
55 56 57 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 55 def last_modified_date_time @last_modified_date_time end |
#media_contact_email ⇒ Object
Billing media email
58 59 60 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 58 def media_contact_email @media_contact_email end |
#media_contact_firstname ⇒ Object
Billing media contact first name
61 62 63 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 61 def media_contact_firstname @media_contact_firstname end |
#media_contact_lastname ⇒ Object
Billing media contact last name
64 65 66 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 64 def media_contact_lastname @media_contact_lastname end |
#order_name ⇒ Object
The order name
67 68 69 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 67 def order_name @order_name end |
#pin_order_id ⇒ Object
The pin order id associated with the order line in SFDC
70 71 72 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 70 def pin_order_id @pin_order_id end |
#pmp_name ⇒ Object
The Pinterest marketing partner name
73 74 75 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 73 def pmp_name @pmp_name end |
#po_number ⇒ Object
The PO number
76 77 78 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 76 def po_number @po_number end |
#salesforce_order_line_id ⇒ Object
Order line id in SFDC
79 80 81 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 79 def salesforce_order_line_id @salesforce_order_line_id end |
#start_date ⇒ Object
Start date of the order line.
82 83 84 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 82 def start_date @start_date end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
135 136 137 |
# File 'lib/pinterest_sdk/models/ssio_order_line.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_order_line.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_order_line.rb', line 107 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
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 397 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 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 173 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.
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_order_line.rb', line 145 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.
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 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 355 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
384 385 386 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 384 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
390 391 392 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 390 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?
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 306 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
419 420 421 422 423 424 425 426 427 428 429 430 431 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 419 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
324 325 326 327 328 329 |
# File 'lib/pinterest_sdk/models/ssio_order_line.rb', line 324 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 |