Class: VisaAcceptanceMergedSpec::GetCustomerShippingAddressResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- VisaAcceptanceMergedSpec::GetCustomerShippingAddressResponse
- Defined in:
- lib/visa_acceptance_merged_spec/models/get_customer_shipping_address_response.rb
Overview
GetCustomerShippingAddressResponse Model.
Instance Attribute Summary collapse
-
#default ⇒ TrueClass | FalseClass
Flag that indicates whether customer shipping address is the dafault.
-
#id ⇒ String
The Id of the Shipping Address Token.
-
#links ⇒ Links27
TODO: Write general description for this method.
-
#metadata ⇒ Metadata4
Flag that indicates whether customer shipping address is the dafault.
-
#ship_to ⇒ ShipTo14
Flag that indicates whether customer shipping address is the dafault.
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(links: SKIP, id: SKIP, default: SKIP, ship_to: SKIP, metadata: SKIP, additional_properties: nil) ⇒ GetCustomerShippingAddressResponse
constructor
A new instance of GetCustomerShippingAddressResponse.
-
#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(links: SKIP, id: SKIP, default: SKIP, ship_to: SKIP, metadata: SKIP, additional_properties: nil) ⇒ GetCustomerShippingAddressResponse
Returns a new instance of GetCustomerShippingAddressResponse.
68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/visa_acceptance_merged_spec/models/get_customer_shipping_address_response.rb', line 68 def initialize(links: SKIP, id: SKIP, default: SKIP, ship_to: SKIP, metadata: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @links = links unless links == SKIP @id = id unless id == SKIP @default = default unless default == SKIP @ship_to = ship_to unless ship_to == SKIP @metadata = unless == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#default ⇒ TrueClass | FalseClass
Flag that indicates whether customer shipping address is the dafault. Possible Values:
true: Shipping Address is customer's default.false: Shipping Address is not customer's default.
25 26 27 |
# File 'lib/visa_acceptance_merged_spec/models/get_customer_shipping_address_response.rb', line 25 def default @default end |
#id ⇒ String
The Id of the Shipping Address Token.
18 19 20 |
# File 'lib/visa_acceptance_merged_spec/models/get_customer_shipping_address_response.rb', line 18 def id @id end |
#links ⇒ Links27
TODO: Write general description for this method
14 15 16 |
# File 'lib/visa_acceptance_merged_spec/models/get_customer_shipping_address_response.rb', line 14 def links @links end |
#metadata ⇒ Metadata4
Flag that indicates whether customer shipping address is the dafault. Possible Values:
true: Shipping Address is customer's default.false: Shipping Address is not customer's default.
39 40 41 |
# File 'lib/visa_acceptance_merged_spec/models/get_customer_shipping_address_response.rb', line 39 def @metadata end |
#ship_to ⇒ ShipTo14
Flag that indicates whether customer shipping address is the dafault. Possible Values:
true: Shipping Address is customer's default.false: Shipping Address is not customer's default.
32 33 34 |
# File 'lib/visa_acceptance_merged_spec/models/get_customer_shipping_address_response.rb', line 32 def ship_to @ship_to end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/visa_acceptance_merged_spec/models/get_customer_shipping_address_response.rb', line 82 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. links = Links27.from_hash(hash['_links']) if hash['_links'] id = hash.key?('id') ? hash['id'] : SKIP default = hash.key?('default') ? hash['default'] : SKIP ship_to = ShipTo14.from_hash(hash['shipTo']) if hash['shipTo'] = Metadata4.from_hash(hash['metadata']) if hash['metadata'] # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. GetCustomerShippingAddressResponse.new(links: links, id: id, default: default, ship_to: ship_to, metadata: , additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
42 43 44 45 46 47 48 49 50 |
# File 'lib/visa_acceptance_merged_spec/models/get_customer_shipping_address_response.rb', line 42 def self.names @_hash = {} if @_hash.nil? @_hash['links'] = '_links' @_hash['id'] = 'id' @_hash['default'] = 'default' @_hash['ship_to'] = 'shipTo' @_hash['metadata'] = 'metadata' @_hash end |
.nullables ⇒ Object
An array for nullable fields
64 65 66 |
# File 'lib/visa_acceptance_merged_spec/models/get_customer_shipping_address_response.rb', line 64 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
53 54 55 56 57 58 59 60 61 |
# File 'lib/visa_acceptance_merged_spec/models/get_customer_shipping_address_response.rb', line 53 def self.optionals %w[ links id default ship_to metadata ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
116 117 118 119 120 121 |
# File 'lib/visa_acceptance_merged_spec/models/get_customer_shipping_address_response.rb', line 116 def inspect class_name = self.class.name.split('::').last "<#{class_name} links: #{@links.inspect}, id: #{@id.inspect}, default: #{@default.inspect},"\ " ship_to: #{@ship_to.inspect}, metadata: #{@metadata.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
109 110 111 112 113 |
# File 'lib/visa_acceptance_merged_spec/models/get_customer_shipping_address_response.rb', line 109 def to_s class_name = self.class.name.split('::').last "<#{class_name} links: #{@links}, id: #{@id}, default: #{@default}, ship_to: #{@ship_to},"\ " metadata: #{@metadata}, additional_properties: #{@additional_properties}>" end |