Class: SwaggerClient::PurchaseGiftCardRequest
- Inherits:
-
Object
- Object
- SwaggerClient::PurchaseGiftCardRequest
- Defined in:
- lib/swagger_client/models/purchase_gift_card_request.rb
Instance Attribute Summary collapse
-
#delivery_date ⇒ Object
The date that the gift card’s image is to be delivered to the recipient.
-
#gift_card_id ⇒ Object
The product ID of the gift card being purchased.
-
#gift_message ⇒ Object
A personal message to include in the gift card.<br /> Maximum length: 300.
-
#layout_id ⇒ Object
The ID of the layout used for the gift card’s image.
-
#location_id ⇒ Object
The ID of the location where the gift card is being sold.
-
#payment_info ⇒ Object
Contains information about the payment.
-
#purchaser_client_id ⇒ Object
The RSSID of the client who is purchasing the gift card.
-
#recipient_email ⇒ Object
The email address to send the gift card image to.
-
#recipient_name ⇒ Object
The name of the person who is to receive the gift card.
-
#send_email_receipt ⇒ Object
When ‘true`, indicates that a purchase receipt email should be sent to the purchasing client, if all settings are correctly configured.<br /> When `false`, no email is sent to the purchaser.
-
#test ⇒ Object
When ‘true`, allows you to test the request without affecting the database.<br /> When `false`, the request is carried out and the database is affected.
-
#title ⇒ Object
The text to use as the title of the gift card, for example: Happy Birthday, Maria! This parameter is required if the ‘LayoutId` is not 0.<br /> Maximum length: 20.
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 = {}) ⇒ PurchaseGiftCardRequest
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 = {}) ⇒ PurchaseGiftCardRequest
Initializes the object
91 92 93 94 95 96 97 98 99 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 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 91 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?(:'Test') self.test = attributes[:'Test'] end if attributes.has_key?(:'LocationId') self.location_id = attributes[:'LocationId'] end if attributes.has_key?(:'LayoutId') self.layout_id = attributes[:'LayoutId'] end if attributes.has_key?(:'PurchaserClientId') self.purchaser_client_id = attributes[:'PurchaserClientId'] end if attributes.has_key?(:'GiftCardId') self.gift_card_id = attributes[:'GiftCardId'] end if attributes.has_key?(:'SendEmailReceipt') self.send_email_receipt = attributes[:'SendEmailReceipt'] end if attributes.has_key?(:'RecipientEmail') self.recipient_email = attributes[:'RecipientEmail'] end if attributes.has_key?(:'RecipientName') self.recipient_name = attributes[:'RecipientName'] end if attributes.has_key?(:'Title') self.title = attributes[:'Title'] end if attributes.has_key?(:'GiftMessage') self. = attributes[:'GiftMessage'] end if attributes.has_key?(:'DeliveryDate') self.delivery_date = attributes[:'DeliveryDate'] end if attributes.has_key?(:'PaymentInfo') self.payment_info = attributes[:'PaymentInfo'] end end |
Instance Attribute Details
#delivery_date ⇒ Object
The date that the gift card’s image is to be delivered to the recipient. This parameter cannot be set to a date in the past. This parameter is required if the ‘LayoutId` is not 0. Default: today Minimum: today
48 49 50 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 48 def delivery_date @delivery_date end |
#gift_card_id ⇒ Object
The product ID of the gift card being purchased.
30 31 32 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 30 def gift_card_id @gift_card_id end |
#gift_message ⇒ Object
A personal message to include in the gift card.<br /> Maximum length: 300
45 46 47 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 45 def @gift_message end |
#layout_id ⇒ Object
The ID of the layout used for the gift card’s image.
24 25 26 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 24 def layout_id @layout_id end |
#location_id ⇒ Object
The ID of the location where the gift card is being sold.
21 22 23 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 21 def location_id @location_id end |
#payment_info ⇒ Object
Contains information about the payment.
51 52 53 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 51 def payment_info @payment_info end |
#purchaser_client_id ⇒ Object
The RSSID of the client who is purchasing the gift card.
27 28 29 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 27 def purchaser_client_id @purchaser_client_id end |
#recipient_email ⇒ Object
The email address to send the gift card image to. This parameter is required if the ‘LayoutId` is not 0.<br /> Maximum length: 100
36 37 38 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 36 def recipient_email @recipient_email end |
#recipient_name ⇒ Object
The name of the person who is to receive the gift card. This parameter is required if the ‘LayoutId` is not 0.<br /> Maximum length: 20
39 40 41 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 39 def recipient_name @recipient_name end |
#send_email_receipt ⇒ Object
When ‘true`, indicates that a purchase receipt email should be sent to the purchasing client, if all settings are correctly configured.<br /> When `false`, no email is sent to the purchaser.
33 34 35 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 33 def send_email_receipt @send_email_receipt end |
#test ⇒ Object
When ‘true`, allows you to test the request without affecting the database.<br /> When `false`, the request is carried out and the database is affected.
18 19 20 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 18 def test @test end |
#title ⇒ Object
The text to use as the title of the gift card, for example: Happy Birthday, Maria! This parameter is required if the ‘LayoutId` is not 0.<br /> Maximum length: 20
42 43 44 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 42 def title @title end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 54 def self.attribute_map { :'test' => :'Test', :'location_id' => :'LocationId', :'layout_id' => :'LayoutId', :'purchaser_client_id' => :'PurchaserClientId', :'gift_card_id' => :'GiftCardId', :'send_email_receipt' => :'SendEmailReceipt', :'recipient_email' => :'RecipientEmail', :'recipient_name' => :'RecipientName', :'title' => :'Title', :'gift_message' => :'GiftMessage', :'delivery_date' => :'DeliveryDate', :'payment_info' => :'PaymentInfo' } end |
.swagger_types ⇒ Object
Attribute type mapping.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 72 def self.swagger_types { :'test' => :'BOOLEAN', :'location_id' => :'Integer', :'layout_id' => :'Integer', :'purchaser_client_id' => :'String', :'gift_card_id' => :'Integer', :'send_email_receipt' => :'BOOLEAN', :'recipient_email' => :'String', :'recipient_name' => :'String', :'title' => :'String', :'gift_message' => :'String', :'delivery_date' => :'DateTime', :'payment_info' => :'CheckoutPaymentInfo' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 176 def ==(o) return true if self.equal?(o) self.class == o.class && test == o.test && location_id == o.location_id && layout_id == o.layout_id && purchaser_client_id == o.purchaser_client_id && gift_card_id == o.gift_card_id && send_email_receipt == o.send_email_receipt && recipient_email == o.recipient_email && recipient_name == o.recipient_name && title == o.title && == o. && delivery_date == o.delivery_date && payment_info == o.payment_info end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 229 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
295 296 297 298 299 300 301 302 303 304 305 306 307 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 295 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
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 208 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 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
195 196 197 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 195 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
201 202 203 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 201 def hash [test, location_id, layout_id, purchaser_client_id, gift_card_id, send_email_receipt, recipient_email, recipient_name, title, , delivery_date, payment_info].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 148 def list_invalid_properties invalid_properties = Array.new if @location_id.nil? invalid_properties.push('invalid value for "location_id", location_id cannot be nil.') end if @purchaser_client_id.nil? invalid_properties.push('invalid value for "purchaser_client_id", purchaser_client_id cannot be nil.') end if @gift_card_id.nil? invalid_properties.push('invalid value for "gift_card_id", gift_card_id cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
275 276 277 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 275 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
281 282 283 284 285 286 287 288 289 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 281 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
269 270 271 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 269 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
167 168 169 170 171 172 |
# File 'lib/swagger_client/models/purchase_gift_card_request.rb', line 167 def valid? return false if @location_id.nil? return false if @purchaser_client_id.nil? return false if @gift_card_id.nil? true end |