Class: Raas::CreateOrderRequestModel
- Defined in:
- lib/raas/models/create_order_request_model.rb
Instance Attribute Summary collapse
-
#account_identifier ⇒ String
Account Identifier.
-
#amount ⇒ Float
Amount.
-
#campaign ⇒ String
Campaign.
-
#customer_identifier ⇒ String
Customer Identifier.
-
#email_subject ⇒ String
Email Subject.
-
#external_ref_id ⇒ String
External Reference ID.
-
#message ⇒ String
Email Message.
-
#notes ⇒ String
Notes.
-
#recipient ⇒ NameEmailModel
Recipient.
-
#send_email ⇒ Boolean
Send Email.
-
#sender ⇒ NameEmailModel
Sender.
-
#utid ⇒ String
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) ⇒ 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) ⇒ CreateOrderRequestModel
Returns a new instance of CreateOrderRequestModel.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/raas/models/create_order_request_model.rb', line 73 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) @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 end |
Instance Attribute Details
#account_identifier ⇒ String
Account Identifier
7 8 9 |
# File 'lib/raas/models/create_order_request_model.rb', line 7 def account_identifier @account_identifier end |
#amount ⇒ Float
Amount
11 12 13 |
# File 'lib/raas/models/create_order_request_model.rb', line 11 def amount @amount end |
#campaign ⇒ String
Campaign
27 28 29 |
# File 'lib/raas/models/create_order_request_model.rb', line 27 def campaign @campaign end |
#customer_identifier ⇒ String
Customer Identifier
15 16 17 |
# File 'lib/raas/models/create_order_request_model.rb', line 15 def customer_identifier @customer_identifier end |
#email_subject ⇒ String
Email Subject
31 32 33 |
# File 'lib/raas/models/create_order_request_model.rb', line 31 def email_subject @email_subject end |
#external_ref_id ⇒ String
External Reference ID
35 36 37 |
# File 'lib/raas/models/create_order_request_model.rb', line 35 def external_ref_id @external_ref_id end |
#message ⇒ String
Email Message
39 40 41 |
# File 'lib/raas/models/create_order_request_model.rb', line 39 def @message end |
#notes ⇒ String
Notes
51 52 53 |
# File 'lib/raas/models/create_order_request_model.rb', line 51 def notes @notes end |
#recipient ⇒ NameEmailModel
Recipient
43 44 45 |
# File 'lib/raas/models/create_order_request_model.rb', line 43 def recipient @recipient end |
#send_email ⇒ Boolean
Send Email
19 20 21 |
# File 'lib/raas/models/create_order_request_model.rb', line 19 def send_email @send_email end |
#sender ⇒ NameEmailModel
Sender
47 48 49 |
# File 'lib/raas/models/create_order_request_model.rb', line 47 def sender @sender end |
#utid ⇒ String
UTID
23 24 25 |
# File 'lib/raas/models/create_order_request_model.rb', line 23 def utid @utid end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash
100 101 102 103 104 105 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 |
# File 'lib/raas/models/create_order_request_model.rb', line 100 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'] # Create object from extracted values CreateOrderRequestModel.new(account_identifier, amount, customer_identifier, send_email, utid, campaign, email_subject, external_ref_id, , recipient, sender, notes) end |
.names ⇒ Object
A mapping from model property names to API property names
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/raas/models/create_order_request_model.rb', line 54 def self.names if @_hash.nil? @_hash = {} @_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" end @_hash end |