Class: Raas::CreateOrderRequestModel
- Defined in:
- lib/raas/models/create_order_request_model.rb
Overview
Represents the request to place an order
Instance Attribute Summary collapse
-
#account_identifier ⇒ String
The account identifier.
-
#amount ⇒ Float
The order amount.
-
#campaign ⇒ String
An optional campaign identifier.
-
#customer_identifier ⇒ String
The customer identifier.
-
#email_subject ⇒ String
The subject of the gift email.
-
#etid ⇒ String
The email template identifier.
-
#external_ref_id ⇒ String
An optional external reference id.
-
#message ⇒ String
The gift message in the email.
-
#notes ⇒ String
Optional notes (not displayed to customer).
-
#recipient ⇒ NameEmailModel
The recipient’s information.
-
#send_email ⇒ Boolean
Indicates whether we should deliver this reward via email.
-
#sender ⇒ NameEmailModel
Optional sender information.
-
#utid ⇒ String
The UTID.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(account_identifier = nil, amount = nil, customer_identifier = nil, send_email = nil, utid = nil, campaign = nil, email_subject = nil, external_ref_id = nil, message = nil, recipient = nil, sender = nil, notes = nil, etid = nil) ⇒ CreateOrderRequestModel
constructor
A new instance of CreateOrderRequestModel.
Methods inherited from BaseModel
Constructor Details
#initialize(account_identifier = nil, amount = nil, customer_identifier = nil, send_email = nil, utid = nil, campaign = nil, email_subject = nil, external_ref_id = nil, message = nil, recipient = nil, sender = nil, notes = nil, etid = nil) ⇒ CreateOrderRequestModel
Returns a new instance of CreateOrderRequestModel.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/raas/models/create_order_request_model.rb', line 78 def initialize(account_identifier = nil, amount = nil, customer_identifier = nil, send_email = nil, utid = nil, campaign = nil, email_subject = nil, external_ref_id = nil, = nil, recipient = nil, sender = nil, notes = nil, etid = nil) @account_identifier = account_identifier @amount = amount @customer_identifier = customer_identifier @send_email = send_email @utid = utid @campaign = campaign @email_subject = email_subject @external_ref_id = external_ref_id @message = @recipient = recipient @sender = sender @notes = notes @etid = etid end |
Instance Attribute Details
#account_identifier ⇒ String
The account identifier
9 10 11 |
# File 'lib/raas/models/create_order_request_model.rb', line 9 def account_identifier @account_identifier end |
#amount ⇒ Float
The order amount
13 14 15 |
# File 'lib/raas/models/create_order_request_model.rb', line 13 def amount @amount end |
#campaign ⇒ String
An optional campaign identifier
29 30 31 |
# File 'lib/raas/models/create_order_request_model.rb', line 29 def campaign @campaign end |
#customer_identifier ⇒ String
The customer identifier
17 18 19 |
# File 'lib/raas/models/create_order_request_model.rb', line 17 def customer_identifier @customer_identifier end |
#email_subject ⇒ String
The subject of the gift email
33 34 35 |
# File 'lib/raas/models/create_order_request_model.rb', line 33 def email_subject @email_subject end |
#etid ⇒ String
The email template identifier
57 58 59 |
# File 'lib/raas/models/create_order_request_model.rb', line 57 def etid @etid end |
#external_ref_id ⇒ String
An optional external reference id
37 38 39 |
# File 'lib/raas/models/create_order_request_model.rb', line 37 def external_ref_id @external_ref_id end |
#message ⇒ String
The gift message in the email
41 42 43 |
# File 'lib/raas/models/create_order_request_model.rb', line 41 def @message end |
#notes ⇒ String
Optional notes (not displayed to customer)
53 54 55 |
# File 'lib/raas/models/create_order_request_model.rb', line 53 def notes @notes end |
#recipient ⇒ NameEmailModel
The recipient’s information
45 46 47 |
# File 'lib/raas/models/create_order_request_model.rb', line 45 def recipient @recipient end |
#send_email ⇒ Boolean
Indicates whether we should deliver this reward via email
21 22 23 |
# File 'lib/raas/models/create_order_request_model.rb', line 21 def send_email @send_email end |
#sender ⇒ NameEmailModel
Optional sender information
49 50 51 |
# File 'lib/raas/models/create_order_request_model.rb', line 49 def sender @sender end |
#utid ⇒ String
The UTID
25 26 27 |
# File 'lib/raas/models/create_order_request_model.rb', line 25 def utid @utid end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 133 134 135 136 137 138 139 140 |
# File 'lib/raas/models/create_order_request_model.rb', line 107 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_identifier = hash['accountIdentifier'] amount = hash['amount'] customer_identifier = hash['customerIdentifier'] send_email = hash['sendEmail'] utid = hash['utid'] campaign = hash['campaign'] email_subject = hash['emailSubject'] external_ref_id = hash['externalRefID'] = hash['message'] recipient = NameEmailModel.from_hash(hash['recipient']) if hash['recipient'] sender = NameEmailModel.from_hash(hash['sender']) if hash['sender'] notes = hash['notes'] etid = hash['etid'] # Create object from extracted values. CreateOrderRequestModel.new(account_identifier, amount, customer_identifier, send_email, utid, campaign, email_subject, external_ref_id, , recipient, sender, notes, etid) end |
.names ⇒ Object
A mapping from model property names to API property names.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/raas/models/create_order_request_model.rb', line 60 def self.names @_hash = {} if @_hash.nil? @_hash['account_identifier'] = 'accountIdentifier' @_hash['amount'] = 'amount' @_hash['customer_identifier'] = 'customerIdentifier' @_hash['send_email'] = 'sendEmail' @_hash['utid'] = 'utid' @_hash['campaign'] = 'campaign' @_hash['email_subject'] = 'emailSubject' @_hash['external_ref_id'] = 'externalRefID' @_hash['message'] = 'message' @_hash['recipient'] = 'recipient' @_hash['sender'] = 'sender' @_hash['notes'] = 'notes' @_hash['etid'] = 'etid' @_hash end |