Class: VisaAcceptanceMergedSpec::ShippingAddressListForCustomer
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- VisaAcceptanceMergedSpec::ShippingAddressListForCustomer
- Defined in:
- lib/visa_acceptance_merged_spec/models/shipping_address_list_for_customer.rb
Overview
A paginated container of Shipping Addresses.
Instance Attribute Summary collapse
-
#count ⇒ Integer
The number of Shipping Addresses returned in the array.
-
#embedded ⇒ Embedded8
The total number of Shipping Addresses associated with the Customer.
-
#limit ⇒ Integer
The limit parameter supplied in the request.
-
#links ⇒ Links66
TODO: Write general description for this method.
-
#offset ⇒ Integer
The offset parameter supplied in the request.
-
#total ⇒ Integer
The total number of Shipping Addresses associated with the Customer.
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, offset: 0, limit: 20, count: SKIP, total: SKIP, embedded: SKIP, additional_properties: nil) ⇒ ShippingAddressListForCustomer
constructor
A new instance of ShippingAddressListForCustomer.
-
#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, offset: 0, limit: 20, count: SKIP, total: SKIP, embedded: SKIP, additional_properties: nil) ⇒ ShippingAddressListForCustomer
Returns a new instance of ShippingAddressListForCustomer.
65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_address_list_for_customer.rb', line 65 def initialize(links: SKIP, offset: 0, limit: 20, count: SKIP, total: SKIP, embedded: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @links = links unless links == SKIP @offset = offset unless offset == SKIP @limit = limit unless limit == SKIP @count = count unless count == SKIP @total = total unless total == SKIP @embedded = unless == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#count ⇒ Integer
The number of Shipping Addresses returned in the array.
26 27 28 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_address_list_for_customer.rb', line 26 def count @count end |
#embedded ⇒ Embedded8
The total number of Shipping Addresses associated with the Customer.
34 35 36 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_address_list_for_customer.rb', line 34 def @embedded end |
#limit ⇒ Integer
The limit parameter supplied in the request.
22 23 24 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_address_list_for_customer.rb', line 22 def limit @limit end |
#links ⇒ Links66
TODO: Write general description for this method
14 15 16 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_address_list_for_customer.rb', line 14 def links @links end |
#offset ⇒ Integer
The offset parameter supplied in the request.
18 19 20 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_address_list_for_customer.rb', line 18 def offset @offset end |
#total ⇒ Integer
The total number of Shipping Addresses associated with the Customer.
30 31 32 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_address_list_for_customer.rb', line 30 def total @total end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
80 81 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/shipping_address_list_for_customer.rb', line 80 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. links = Links66.from_hash(hash['_links']) if hash['_links'] offset = hash['offset'] ||= 0 limit = hash['limit'] ||= 20 count = hash.key?('count') ? hash['count'] : SKIP total = hash.key?('total') ? hash['total'] : SKIP = Embedded8.from_hash(hash['_embedded']) if hash['_embedded'] # 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. ShippingAddressListForCustomer.new(links: links, offset: offset, limit: limit, count: count, total: total, embedded: , additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_address_list_for_customer.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['links'] = '_links' @_hash['offset'] = 'offset' @_hash['limit'] = 'limit' @_hash['count'] = 'count' @_hash['total'] = 'total' @_hash['embedded'] = '_embedded' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_address_list_for_customer.rb', line 61 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_address_list_for_customer.rb', line 49 def self.optionals %w[ links offset limit count total embedded ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
117 118 119 120 121 122 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_address_list_for_customer.rb', line 117 def inspect class_name = self.class.name.split('::').last "<#{class_name} links: #{@links.inspect}, offset: #{@offset.inspect}, limit:"\ " #{@limit.inspect}, count: #{@count.inspect}, total: #{@total.inspect}, embedded:"\ " #{@embedded.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
109 110 111 112 113 114 |
# File 'lib/visa_acceptance_merged_spec/models/shipping_address_list_for_customer.rb', line 109 def to_s class_name = self.class.name.split('::').last "<#{class_name} links: #{@links}, offset: #{@offset}, limit: #{@limit}, count: #{@count},"\ " total: #{@total}, embedded: #{@embedded}, additional_properties:"\ " #{@additional_properties}>" end |