Class: PaypalServerSdk::OrderUpdateCallbackShippingOption
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::OrderUpdateCallbackShippingOption
- Defined in:
- lib/paypal_server_sdk/models/order_update_callback_shipping_option.rb
Overview
The options that the payee or merchant offers to the payer to ship or pick up their items.
Instance Attribute Summary collapse
-
#amount ⇒ Money
The currency and amount for a financial transaction, such as a balance or payment due.
-
#id ⇒ String
A unique ID that identifies a payer-selected shipping option.
-
#label ⇒ String
A description that the payer sees, which helps them choose an appropriate shipping option.
-
#type ⇒ ShippingType
A classification for the method of purchase fulfillment.
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.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(id:, label:, type: SKIP, amount: SKIP) ⇒ OrderUpdateCallbackShippingOption
constructor
A new instance of OrderUpdateCallbackShippingOption.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(id:, label:, type: SKIP, amount: SKIP) ⇒ OrderUpdateCallbackShippingOption
Returns a new instance of OrderUpdateCallbackShippingOption.
56 57 58 59 60 61 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_option.rb', line 56 def initialize(id:, label:, type: SKIP, amount: SKIP) @id = id @label = label @type = type unless type == SKIP @amount = amount unless amount == SKIP end |
Instance Attribute Details
#amount ⇒ Money
The currency and amount for a financial transaction, such as a balance or payment due.
31 32 33 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_option.rb', line 31 def amount @amount end |
#id ⇒ String
A unique ID that identifies a payer-selected shipping option.
15 16 17 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_option.rb', line 15 def id @id end |
#label ⇒ String
A description that the payer sees, which helps them choose an appropriate shipping option. For example, ‘Free Shipping`, `USPS Priority Shipping`, `Expédition prioritaire USPS`, or `USPS yōuxiān fā huò`. Localize this description to the payer’s locale.
22 23 24 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_option.rb', line 22 def label @label end |
#type ⇒ ShippingType
A classification for the method of purchase fulfillment.
26 27 28 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_option.rb', line 26 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_option.rb', line 64 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil label = hash.key?('label') ? hash['label'] : nil type = hash.key?('type') ? hash['type'] : SKIP amount = Money.from_hash(hash['amount']) if hash['amount'] # Create object from extracted values. OrderUpdateCallbackShippingOption.new(id: id, label: label, type: type, amount: amount) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_option.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['label'] = 'label' @_hash['type'] = 'type' @_hash['amount'] = 'amount' @_hash end |
.nullables ⇒ Object
An array for nullable fields
52 53 54 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_option.rb', line 52 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_option.rb', line 44 def self.optionals %w[ type amount ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
87 88 89 90 91 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_option.rb', line 87 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, label: #{@label.inspect}, type: #{@type.inspect},"\ " amount: #{@amount.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
81 82 83 84 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_option.rb', line 81 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, label: #{@label}, type: #{@type}, amount: #{@amount}>" end |