Class: CyberSourceMergedSpec::PatchCustomersShippingAddressResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::PatchCustomersShippingAddressResponse
- Defined in:
- lib/cyber_source_merged_spec/models/patch_customers_shipping_address_response.rb
Overview
PatchCustomersShippingAddressResponse 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 ⇒ Links26
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_element(root) ⇒ Object
-
.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) ⇒ PatchCustomersShippingAddressResponse
constructor
A new instance of PatchCustomersShippingAddressResponse.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
- #to_xml_element(doc, root_name) ⇒ 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) ⇒ PatchCustomersShippingAddressResponse
Returns a new instance of PatchCustomersShippingAddressResponse.
68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/cyber_source_merged_spec/models/patch_customers_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/cyber_source_merged_spec/models/patch_customers_shipping_address_response.rb', line 25 def default @default end |
#id ⇒ String
The Id of the Shipping Address Token.
18 19 20 |
# File 'lib/cyber_source_merged_spec/models/patch_customers_shipping_address_response.rb', line 18 def id @id end |
#links ⇒ Links26
TODO: Write general description for this method
14 15 16 |
# File 'lib/cyber_source_merged_spec/models/patch_customers_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/cyber_source_merged_spec/models/patch_customers_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/cyber_source_merged_spec/models/patch_customers_shipping_address_response.rb', line 32 def ship_to @ship_to end |
Class Method Details
.from_element(root) ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/cyber_source_merged_spec/models/patch_customers_shipping_address_response.rb', line 108 def self.from_element(root) links = XmlUtilities.from_element(root, 'Links26', Links26) id = XmlUtilities.from_element(root, 'id', String) default = XmlUtilities.from_element(root, 'default', TrueClass) ship_to = XmlUtilities.from_element(root, 'ShipTo14', ShipTo14) = XmlUtilities.from_element(root, 'Metadata4', Metadata4) new(links: links, id: id, default: default, ship_to: ship_to, metadata: , additional_properties: additional_properties) end |
.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/cyber_source_merged_spec/models/patch_customers_shipping_address_response.rb', line 82 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. links = Links26.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. PatchCustomersShippingAddressResponse.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/cyber_source_merged_spec/models/patch_customers_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/cyber_source_merged_spec/models/patch_customers_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/cyber_source_merged_spec/models/patch_customers_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.
145 146 147 148 149 150 |
# File 'lib/cyber_source_merged_spec/models/patch_customers_shipping_address_response.rb', line 145 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.
138 139 140 141 142 |
# File 'lib/cyber_source_merged_spec/models/patch_customers_shipping_address_response.rb', line 138 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 |
#to_xml_element(doc, root_name) ⇒ Object
123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/cyber_source_merged_spec/models/patch_customers_shipping_address_response.rb', line 123 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'Links26', links) XmlUtilities.add_as_subelement(doc, root, 'id', id) XmlUtilities.add_as_subelement(doc, root, 'default', default) XmlUtilities.add_as_subelement(doc, root, 'ShipTo14', ship_to) XmlUtilities.add_as_subelement(doc, root, 'Metadata4', ) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |