Class: SwaggerClient::OrderRequestJson
- Inherits:
-
Object
- Object
- SwaggerClient::OrderRequestJson
- Defined in:
- lib/swagger_client/models/order_request_json.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#approval_segment_id ⇒ Object
Returns the value of attribute approval_segment_id.
-
#attachment_id ⇒ Object
Returns the value of attribute attachment_id.
-
#auto_renew ⇒ Object
Returns the value of attribute auto_renew.
-
#billing_anchor_date ⇒ Object
Returns the value of attribute billing_anchor_date.
-
#billing_contact_id ⇒ Object
Returns the value of attribute billing_contact_id.
-
#billing_cycle ⇒ Object
Returns the value of attribute billing_cycle.
-
#billing_term ⇒ Object
Returns the value of attribute billing_term.
-
#custom_fields ⇒ Object
Returns the value of attribute custom_fields.
-
#document_custom_content ⇒ Object
Returns the value of attribute document_custom_content.
-
#document_master_template_id ⇒ Object
Returns the value of attribute document_master_template_id.
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#entity_id ⇒ Object
Returns the value of attribute entity_id.
-
#executed_on ⇒ Object
Returns the value of attribute executed_on.
-
#expires_on ⇒ Object
Returns the value of attribute expires_on.
-
#external_id ⇒ Object
Returns the value of attribute external_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_primary_order_for_sfdc_opportunity ⇒ Object
Returns the value of attribute is_primary_order_for_sfdc_opportunity.
-
#line_items ⇒ Object
Returns the value of attribute line_items.
-
#name ⇒ Object
Returns the value of attribute name.
-
#opportunity_crm_type ⇒ Object
Returns the value of attribute opportunity_crm_type.
-
#order_form_template_ids ⇒ Object
Returns the value of attribute order_form_template_ids.
-
#order_type ⇒ Object
Returns the value of attribute order_type.
-
#owner_id ⇒ Object
Returns the value of attribute owner_id.
-
#payment_term ⇒ Object
Returns the value of attribute payment_term.
-
#predefined_discounts ⇒ Object
Returns the value of attribute predefined_discounts.
-
#purchase_order_number ⇒ Object
Returns the value of attribute purchase_order_number.
-
#purchase_order_required_for_invoicing ⇒ Object
Returns the value of attribute purchase_order_required_for_invoicing.
-
#ramp_interval ⇒ Object
Returns the value of attribute ramp_interval.
-
#renewal_for_subscription_id ⇒ Object
Returns the value of attribute renewal_for_subscription_id.
-
#sfdc_opportunity_id ⇒ Object
Returns the value of attribute sfdc_opportunity_id.
-
#sfdc_opportunity_name ⇒ Object
Returns the value of attribute sfdc_opportunity_name.
-
#sfdc_opportunity_stage ⇒ Object
Returns the value of attribute sfdc_opportunity_stage.
-
#sfdc_opportunity_type ⇒ Object
Returns the value of attribute sfdc_opportunity_type.
-
#shipping_contact_id ⇒ Object
Returns the value of attribute shipping_contact_id.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#start_date_type ⇒ Object
Returns the value of attribute start_date_type.
-
#subscription_id ⇒ Object
Returns the value of attribute subscription_id.
-
#term_length ⇒ Object
Returns the value of attribute term_length.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ OrderRequestJson
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ OrderRequestJson
Initializes the object
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 314 315 316 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 |
# File 'lib/swagger_client/models/order_request_json.rb', line 209 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'id') self.id = attributes[:'id'] end if attributes.has_key?(:'externalId') self.external_id = attributes[:'externalId'] end if attributes.has_key?(:'name') self.name = attributes[:'name'] end if attributes.has_key?(:'accountId') self.account_id = attributes[:'accountId'] end if attributes.has_key?(:'orderType') self.order_type = attributes[:'orderType'] end if attributes.has_key?(:'paymentTerm') self.payment_term = attributes[:'paymentTerm'] end if attributes.has_key?(:'subscriptionId') self.subscription_id = attributes[:'subscriptionId'] end if attributes.has_key?(:'shippingContactId') self.shipping_contact_id = attributes[:'shippingContactId'] end if attributes.has_key?(:'billingContactId') self.billing_contact_id = attributes[:'billingContactId'] end if attributes.has_key?(:'predefinedDiscounts') if (value = attributes[:'predefinedDiscounts']).is_a?(Array) self.predefined_discounts = value end end if attributes.has_key?(:'lineItems') if (value = attributes[:'lineItems']).is_a?(Array) self.line_items = value end end if attributes.has_key?(:'startDate') self.start_date = attributes[:'startDate'] end if attributes.has_key?(:'endDate') self.end_date = attributes[:'endDate'] end if attributes.has_key?(:'executedOn') self.executed_on = attributes[:'executedOn'] end if attributes.has_key?(:'termLength') self.term_length = attributes[:'termLength'] end if attributes.has_key?(:'billingCycle') self.billing_cycle = attributes[:'billingCycle'] end if attributes.has_key?(:'billingTerm') self.billing_term = attributes[:'billingTerm'] end if attributes.has_key?(:'billingAnchorDate') self.billing_anchor_date = attributes[:'billingAnchorDate'] end if attributes.has_key?(:'rampInterval') if (value = attributes[:'rampInterval']).is_a?(Array) self.ramp_interval = value end end if attributes.has_key?(:'orderFormTemplateIds') if (value = attributes[:'orderFormTemplateIds']).is_a?(Array) self.order_form_template_ids = value end end if attributes.has_key?(:'sfdcOpportunityId') self.sfdc_opportunity_id = attributes[:'sfdcOpportunityId'] end if attributes.has_key?(:'isPrimaryOrderForSfdcOpportunity') self.is_primary_order_for_sfdc_opportunity = attributes[:'isPrimaryOrderForSfdcOpportunity'] end if attributes.has_key?(:'sfdcOpportunityName') self.sfdc_opportunity_name = attributes[:'sfdcOpportunityName'] end if attributes.has_key?(:'sfdcOpportunityType') self.sfdc_opportunity_type = attributes[:'sfdcOpportunityType'] end if attributes.has_key?(:'sfdcOpportunityStage') self.sfdc_opportunity_stage = attributes[:'sfdcOpportunityStage'] end if attributes.has_key?(:'opportunityCrmType') self.opportunity_crm_type = attributes[:'opportunityCrmType'] end if attributes.has_key?(:'ownerId') self.owner_id = attributes[:'ownerId'] end if attributes.has_key?(:'renewalForSubscriptionId') self.renewal_for_subscription_id = attributes[:'renewalForSubscriptionId'] end if attributes.has_key?(:'documentMasterTemplateId') self.document_master_template_id = attributes[:'documentMasterTemplateId'] end if attributes.has_key?(:'documentCustomContent') self.document_custom_content = attributes[:'documentCustomContent'] end if attributes.has_key?(:'purchaseOrderNumber') self.purchase_order_number = attributes[:'purchaseOrderNumber'] end if attributes.has_key?(:'purchaseOrderRequiredForInvoicing') self.purchase_order_required_for_invoicing = attributes[:'purchaseOrderRequiredForInvoicing'] end if attributes.has_key?(:'autoRenew') self.auto_renew = attributes[:'autoRenew'] end if attributes.has_key?(:'approvalSegmentId') self.approval_segment_id = attributes[:'approvalSegmentId'] end if attributes.has_key?(:'attachmentId') self. = attributes[:'attachmentId'] end if attributes.has_key?(:'expiresOn') self.expires_on = attributes[:'expiresOn'] end if attributes.has_key?(:'entityId') self.entity_id = attributes[:'entityId'] end if attributes.has_key?(:'customFields') if (value = attributes[:'customFields']).is_a?(Array) self.custom_fields = value end end if attributes.has_key?(:'startDateType') self.start_date_type = attributes[:'startDateType'] end end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
23 24 25 |
# File 'lib/swagger_client/models/order_request_json.rb', line 23 def account_id @account_id end |
#approval_segment_id ⇒ Object
Returns the value of attribute approval_segment_id.
83 84 85 |
# File 'lib/swagger_client/models/order_request_json.rb', line 83 def approval_segment_id @approval_segment_id end |
#attachment_id ⇒ Object
Returns the value of attribute attachment_id.
85 86 87 |
# File 'lib/swagger_client/models/order_request_json.rb', line 85 def @attachment_id end |
#auto_renew ⇒ Object
Returns the value of attribute auto_renew.
81 82 83 |
# File 'lib/swagger_client/models/order_request_json.rb', line 81 def auto_renew @auto_renew end |
#billing_anchor_date ⇒ Object
Returns the value of attribute billing_anchor_date.
51 52 53 |
# File 'lib/swagger_client/models/order_request_json.rb', line 51 def billing_anchor_date @billing_anchor_date end |
#billing_contact_id ⇒ Object
Returns the value of attribute billing_contact_id.
33 34 35 |
# File 'lib/swagger_client/models/order_request_json.rb', line 33 def billing_contact_id @billing_contact_id end |
#billing_cycle ⇒ Object
Returns the value of attribute billing_cycle.
47 48 49 |
# File 'lib/swagger_client/models/order_request_json.rb', line 47 def billing_cycle @billing_cycle end |
#billing_term ⇒ Object
Returns the value of attribute billing_term.
49 50 51 |
# File 'lib/swagger_client/models/order_request_json.rb', line 49 def billing_term @billing_term end |
#custom_fields ⇒ Object
Returns the value of attribute custom_fields.
91 92 93 |
# File 'lib/swagger_client/models/order_request_json.rb', line 91 def custom_fields @custom_fields end |
#document_custom_content ⇒ Object
Returns the value of attribute document_custom_content.
75 76 77 |
# File 'lib/swagger_client/models/order_request_json.rb', line 75 def document_custom_content @document_custom_content end |
#document_master_template_id ⇒ Object
Returns the value of attribute document_master_template_id.
73 74 75 |
# File 'lib/swagger_client/models/order_request_json.rb', line 73 def document_master_template_id @document_master_template_id end |
#end_date ⇒ Object
Returns the value of attribute end_date.
41 42 43 |
# File 'lib/swagger_client/models/order_request_json.rb', line 41 def end_date @end_date end |
#entity_id ⇒ Object
Returns the value of attribute entity_id.
89 90 91 |
# File 'lib/swagger_client/models/order_request_json.rb', line 89 def entity_id @entity_id end |
#executed_on ⇒ Object
Returns the value of attribute executed_on.
43 44 45 |
# File 'lib/swagger_client/models/order_request_json.rb', line 43 def executed_on @executed_on end |
#expires_on ⇒ Object
Returns the value of attribute expires_on.
87 88 89 |
# File 'lib/swagger_client/models/order_request_json.rb', line 87 def expires_on @expires_on end |
#external_id ⇒ Object
Returns the value of attribute external_id.
19 20 21 |
# File 'lib/swagger_client/models/order_request_json.rb', line 19 def external_id @external_id end |
#id ⇒ Object
Returns the value of attribute id.
17 18 19 |
# File 'lib/swagger_client/models/order_request_json.rb', line 17 def id @id end |
#is_primary_order_for_sfdc_opportunity ⇒ Object
Returns the value of attribute is_primary_order_for_sfdc_opportunity.
59 60 61 |
# File 'lib/swagger_client/models/order_request_json.rb', line 59 def is_primary_order_for_sfdc_opportunity @is_primary_order_for_sfdc_opportunity end |
#line_items ⇒ Object
Returns the value of attribute line_items.
37 38 39 |
# File 'lib/swagger_client/models/order_request_json.rb', line 37 def line_items @line_items end |
#name ⇒ Object
Returns the value of attribute name.
21 22 23 |
# File 'lib/swagger_client/models/order_request_json.rb', line 21 def name @name end |
#opportunity_crm_type ⇒ Object
Returns the value of attribute opportunity_crm_type.
67 68 69 |
# File 'lib/swagger_client/models/order_request_json.rb', line 67 def opportunity_crm_type @opportunity_crm_type end |
#order_form_template_ids ⇒ Object
Returns the value of attribute order_form_template_ids.
55 56 57 |
# File 'lib/swagger_client/models/order_request_json.rb', line 55 def order_form_template_ids @order_form_template_ids end |
#order_type ⇒ Object
Returns the value of attribute order_type.
25 26 27 |
# File 'lib/swagger_client/models/order_request_json.rb', line 25 def order_type @order_type end |
#owner_id ⇒ Object
Returns the value of attribute owner_id.
69 70 71 |
# File 'lib/swagger_client/models/order_request_json.rb', line 69 def owner_id @owner_id end |
#payment_term ⇒ Object
Returns the value of attribute payment_term.
27 28 29 |
# File 'lib/swagger_client/models/order_request_json.rb', line 27 def payment_term @payment_term end |
#predefined_discounts ⇒ Object
Returns the value of attribute predefined_discounts.
35 36 37 |
# File 'lib/swagger_client/models/order_request_json.rb', line 35 def predefined_discounts @predefined_discounts end |
#purchase_order_number ⇒ Object
Returns the value of attribute purchase_order_number.
77 78 79 |
# File 'lib/swagger_client/models/order_request_json.rb', line 77 def purchase_order_number @purchase_order_number end |
#purchase_order_required_for_invoicing ⇒ Object
Returns the value of attribute purchase_order_required_for_invoicing.
79 80 81 |
# File 'lib/swagger_client/models/order_request_json.rb', line 79 def purchase_order_required_for_invoicing @purchase_order_required_for_invoicing end |
#ramp_interval ⇒ Object
Returns the value of attribute ramp_interval.
53 54 55 |
# File 'lib/swagger_client/models/order_request_json.rb', line 53 def ramp_interval @ramp_interval end |
#renewal_for_subscription_id ⇒ Object
Returns the value of attribute renewal_for_subscription_id.
71 72 73 |
# File 'lib/swagger_client/models/order_request_json.rb', line 71 def renewal_for_subscription_id @renewal_for_subscription_id end |
#sfdc_opportunity_id ⇒ Object
Returns the value of attribute sfdc_opportunity_id.
57 58 59 |
# File 'lib/swagger_client/models/order_request_json.rb', line 57 def sfdc_opportunity_id @sfdc_opportunity_id end |
#sfdc_opportunity_name ⇒ Object
Returns the value of attribute sfdc_opportunity_name.
61 62 63 |
# File 'lib/swagger_client/models/order_request_json.rb', line 61 def sfdc_opportunity_name @sfdc_opportunity_name end |
#sfdc_opportunity_stage ⇒ Object
Returns the value of attribute sfdc_opportunity_stage.
65 66 67 |
# File 'lib/swagger_client/models/order_request_json.rb', line 65 def sfdc_opportunity_stage @sfdc_opportunity_stage end |
#sfdc_opportunity_type ⇒ Object
Returns the value of attribute sfdc_opportunity_type.
63 64 65 |
# File 'lib/swagger_client/models/order_request_json.rb', line 63 def sfdc_opportunity_type @sfdc_opportunity_type end |
#shipping_contact_id ⇒ Object
Returns the value of attribute shipping_contact_id.
31 32 33 |
# File 'lib/swagger_client/models/order_request_json.rb', line 31 def shipping_contact_id @shipping_contact_id end |
#start_date ⇒ Object
Returns the value of attribute start_date.
39 40 41 |
# File 'lib/swagger_client/models/order_request_json.rb', line 39 def start_date @start_date end |
#start_date_type ⇒ Object
Returns the value of attribute start_date_type.
93 94 95 |
# File 'lib/swagger_client/models/order_request_json.rb', line 93 def start_date_type @start_date_type end |
#subscription_id ⇒ Object
Returns the value of attribute subscription_id.
29 30 31 |
# File 'lib/swagger_client/models/order_request_json.rb', line 29 def subscription_id @subscription_id end |
#term_length ⇒ Object
Returns the value of attribute term_length.
45 46 47 |
# File 'lib/swagger_client/models/order_request_json.rb', line 45 def term_length @term_length end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/swagger_client/models/order_request_json.rb', line 118 def self.attribute_map { :'id' => :'id', :'external_id' => :'externalId', :'name' => :'name', :'account_id' => :'accountId', :'order_type' => :'orderType', :'payment_term' => :'paymentTerm', :'subscription_id' => :'subscriptionId', :'shipping_contact_id' => :'shippingContactId', :'billing_contact_id' => :'billingContactId', :'predefined_discounts' => :'predefinedDiscounts', :'line_items' => :'lineItems', :'start_date' => :'startDate', :'end_date' => :'endDate', :'executed_on' => :'executedOn', :'term_length' => :'termLength', :'billing_cycle' => :'billingCycle', :'billing_term' => :'billingTerm', :'billing_anchor_date' => :'billingAnchorDate', :'ramp_interval' => :'rampInterval', :'order_form_template_ids' => :'orderFormTemplateIds', :'sfdc_opportunity_id' => :'sfdcOpportunityId', :'is_primary_order_for_sfdc_opportunity' => :'isPrimaryOrderForSfdcOpportunity', :'sfdc_opportunity_name' => :'sfdcOpportunityName', :'sfdc_opportunity_type' => :'sfdcOpportunityType', :'sfdc_opportunity_stage' => :'sfdcOpportunityStage', :'opportunity_crm_type' => :'opportunityCrmType', :'owner_id' => :'ownerId', :'renewal_for_subscription_id' => :'renewalForSubscriptionId', :'document_master_template_id' => :'documentMasterTemplateId', :'document_custom_content' => :'documentCustomContent', :'purchase_order_number' => :'purchaseOrderNumber', :'purchase_order_required_for_invoicing' => :'purchaseOrderRequiredForInvoicing', :'auto_renew' => :'autoRenew', :'approval_segment_id' => :'approvalSegmentId', :'attachment_id' => :'attachmentId', :'expires_on' => :'expiresOn', :'entity_id' => :'entityId', :'custom_fields' => :'customFields', :'start_date_type' => :'startDateType' } end |
.swagger_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/swagger_client/models/order_request_json.rb', line 163 def self.swagger_types { :'id' => :'String', :'external_id' => :'String', :'name' => :'String', :'account_id' => :'String', :'order_type' => :'String', :'payment_term' => :'String', :'subscription_id' => :'String', :'shipping_contact_id' => :'String', :'billing_contact_id' => :'String', :'predefined_discounts' => :'Array<TenantDiscountJson>', :'line_items' => :'Array<OrderLineItemRequestJson>', :'start_date' => :'Integer', :'end_date' => :'Integer', :'executed_on' => :'Integer', :'term_length' => :'RecurrenceJson', :'billing_cycle' => :'RecurrenceJson', :'billing_term' => :'String', :'billing_anchor_date' => :'Integer', :'ramp_interval' => :'Array<Integer>', :'order_form_template_ids' => :'Array<String>', :'sfdc_opportunity_id' => :'String', :'is_primary_order_for_sfdc_opportunity' => :'BOOLEAN', :'sfdc_opportunity_name' => :'String', :'sfdc_opportunity_type' => :'String', :'sfdc_opportunity_stage' => :'String', :'opportunity_crm_type' => :'String', :'owner_id' => :'String', :'renewal_for_subscription_id' => :'String', :'document_master_template_id' => :'String', :'document_custom_content' => :'DocumentCustomContent', :'purchase_order_number' => :'String', :'purchase_order_required_for_invoicing' => :'BOOLEAN', :'auto_renew' => :'BOOLEAN', :'approval_segment_id' => :'String', :'attachment_id' => :'String', :'expires_on' => :'Integer', :'entity_id' => :'String', :'custom_fields' => :'Array<CustomFieldEntry>', :'start_date_type' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 |
# File 'lib/swagger_client/models/order_request_json.rb', line 455 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && external_id == o.external_id && name == o.name && account_id == o.account_id && order_type == o.order_type && payment_term == o.payment_term && subscription_id == o.subscription_id && shipping_contact_id == o.shipping_contact_id && billing_contact_id == o.billing_contact_id && predefined_discounts == o.predefined_discounts && line_items == o.line_items && start_date == o.start_date && end_date == o.end_date && executed_on == o.executed_on && term_length == o.term_length && billing_cycle == o.billing_cycle && billing_term == o.billing_term && billing_anchor_date == o.billing_anchor_date && ramp_interval == o.ramp_interval && order_form_template_ids == o.order_form_template_ids && sfdc_opportunity_id == o.sfdc_opportunity_id && is_primary_order_for_sfdc_opportunity == o.is_primary_order_for_sfdc_opportunity && sfdc_opportunity_name == o.sfdc_opportunity_name && sfdc_opportunity_type == o.sfdc_opportunity_type && sfdc_opportunity_stage == o.sfdc_opportunity_stage && opportunity_crm_type == o.opportunity_crm_type && owner_id == o.owner_id && renewal_for_subscription_id == o.renewal_for_subscription_id && document_master_template_id == o.document_master_template_id && document_custom_content == o.document_custom_content && purchase_order_number == o.purchase_order_number && purchase_order_required_for_invoicing == o.purchase_order_required_for_invoicing && auto_renew == o.auto_renew && approval_segment_id == o.approval_segment_id && == o. && expires_on == o.expires_on && entity_id == o.entity_id && custom_fields == o.custom_fields && start_date_type == o.start_date_type end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 |
# File 'lib/swagger_client/models/order_request_json.rb', line 535 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = SwaggerClient.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
601 602 603 604 605 606 607 608 609 610 611 612 613 |
# File 'lib/swagger_client/models/order_request_json.rb', line 601 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 |
# File 'lib/swagger_client/models/order_request_json.rb', line 514 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if 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[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
501 502 503 |
# File 'lib/swagger_client/models/order_request_json.rb', line 501 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
507 508 509 |
# File 'lib/swagger_client/models/order_request_json.rb', line 507 def hash [id, external_id, name, account_id, order_type, payment_term, subscription_id, shipping_contact_id, billing_contact_id, predefined_discounts, line_items, start_date, end_date, executed_on, term_length, billing_cycle, billing_term, billing_anchor_date, ramp_interval, order_form_template_ids, sfdc_opportunity_id, is_primary_order_for_sfdc_opportunity, sfdc_opportunity_name, sfdc_opportunity_type, sfdc_opportunity_stage, opportunity_crm_type, owner_id, renewal_for_subscription_id, document_master_template_id, document_custom_content, purchase_order_number, purchase_order_required_for_invoicing, auto_renew, approval_segment_id, , expires_on, entity_id, custom_fields, start_date_type].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
384 385 386 387 388 389 390 391 392 393 394 395 |
# File 'lib/swagger_client/models/order_request_json.rb', line 384 def list_invalid_properties invalid_properties = Array.new if @order_type.nil? invalid_properties.push('invalid value for "order_type", order_type cannot be nil.') end if @start_date.nil? invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
581 582 583 |
# File 'lib/swagger_client/models/order_request_json.rb', line 581 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
587 588 589 590 591 592 593 594 595 |
# File 'lib/swagger_client/models/order_request_json.rb', line 587 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
575 576 577 |
# File 'lib/swagger_client/models/order_request_json.rb', line 575 def to_s to_hash.to_s 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 |
# File 'lib/swagger_client/models/order_request_json.rb', line 399 def valid? return false if @order_type.nil? order_type_validator = EnumAttributeValidator.new('String', ['NEW', 'AMENDMENT', 'CANCEL', 'RENEWAL', 'RESTRUCTURE']) return false unless order_type_validator.valid?(@order_type) return false if @start_date.nil? billing_term_validator = EnumAttributeValidator.new('String', ['UP_FRONT', 'IN_ARREARS']) return false unless billing_term_validator.valid?(@billing_term) opportunity_crm_type_validator = EnumAttributeValidator.new('String', ['SALESFORCE', 'HUBSPOT']) return false unless opportunity_crm_type_validator.valid?(@opportunity_crm_type) start_date_type_validator = EnumAttributeValidator.new('String', ['FIXED', 'EXECUTION_DATE']) return false unless start_date_type_validator.valid?(@start_date_type) true end |