Class: NewStoreApi::ReservationDetailsResponseV2
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::ReservationDetailsResponseV2
- Defined in:
- lib/new_store_api/models/reservation_details_response_v2.rb
Overview
ReservationDetailsResponseV2 Model.
Instance Attribute Summary collapse
-
#associate_id ⇒ String
ID of the associate assigned to the reservation.
-
#created_at ⇒ DateTime
Date and time the reservation was created.
-
#customer_profile_id ⇒ String
Profile ID of the customer the reservation is for.
-
#display_id ⇒ String
Short, human-readable identifier for the reservation.
-
#expires_at ⇒ DateTime
Date and time the reservation expires.
-
#external_id ⇒ String
Identifier of the reservation in an external system.
-
#id ⇒ UUID | String
Unique identifier for the reservation.
-
#items ⇒ Array[ReservationItemDetailsResponse]
Items associated with the reservation.
-
#location_id ⇒ String
ID of the fulfillment location the reservation is for.
-
#status ⇒ ReservationStatusEnum
The status of a reservation.
-
#updated_at ⇒ DateTime
Date and time the reservation was updated.
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(associate_id = nil, created_at = nil, customer_profile_id = nil, display_id = nil, expires_at = nil, external_id = nil, id = nil, items = nil, location_id = nil, status = nil, updated_at = nil) ⇒ ReservationDetailsResponseV2
constructor
A new instance of ReservationDetailsResponseV2.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created_at ⇒ Object
- #to_custom_expires_at ⇒ Object
- #to_custom_updated_at ⇒ Object
-
#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(associate_id = nil, created_at = nil, customer_profile_id = nil, display_id = nil, expires_at = nil, external_id = nil, id = nil, items = nil, location_id = nil, status = nil, updated_at = nil) ⇒ ReservationDetailsResponseV2
Returns a new instance of ReservationDetailsResponseV2.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 90 def initialize(associate_id = nil, created_at = nil, customer_profile_id = nil, display_id = nil, expires_at = nil, external_id = nil, id = nil, items = nil, location_id = nil, status = nil, updated_at = nil) @associate_id = associate_id @created_at = created_at @customer_profile_id = customer_profile_id @display_id = display_id @expires_at = expires_at @external_id = external_id @id = id @items = items @location_id = location_id @status = status @updated_at = updated_at end |
Instance Attribute Details
#associate_id ⇒ String
ID of the associate assigned to the reservation
15 16 17 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 15 def associate_id @associate_id end |
#created_at ⇒ DateTime
Date and time the reservation was created
19 20 21 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 19 def created_at @created_at end |
#customer_profile_id ⇒ String
Profile ID of the customer the reservation is for
23 24 25 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 23 def customer_profile_id @customer_profile_id end |
#display_id ⇒ String
Short, human-readable identifier for the reservation. This field was previously called external_id in V1 of this API
28 29 30 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 28 def display_id @display_id end |
#expires_at ⇒ DateTime
Date and time the reservation expires
32 33 34 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 32 def expires_at @expires_at end |
#external_id ⇒ String
Identifier of the reservation in an external system. Will be null if not provided when the reservation was created. The field that was previously called external_id in V1 of this API has been renamed to display_id in V2
38 39 40 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 38 def external_id @external_id end |
#id ⇒ UUID | String
Unique identifier for the reservation
42 43 44 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 42 def id @id end |
#items ⇒ Array[ReservationItemDetailsResponse]
Items associated with the reservation
46 47 48 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 46 def items @items end |
#location_id ⇒ String
ID of the fulfillment location the reservation is for
50 51 52 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 50 def location_id @location_id end |
#status ⇒ ReservationStatusEnum
The status of a reservation.
54 55 56 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 54 def status @status end |
#updated_at ⇒ DateTime
Date and time the reservation was updated
58 59 60 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 58 def updated_at @updated_at end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 145 146 147 148 149 150 151 152 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 108 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. associate_id = hash.key?('associate_id') ? hash['associate_id'] : nil created_at = if hash.key?('created_at') (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) end customer_profile_id = hash.key?('customer_profile_id') ? hash['customer_profile_id'] : nil display_id = hash.key?('display_id') ? hash['display_id'] : nil expires_at = if hash.key?('expires_at') (DateTimeHelper.from_rfc3339(hash['expires_at']) if hash['expires_at']) end external_id = hash.key?('external_id') ? hash['external_id'] : nil id = hash.key?('id') ? hash['id'] : nil # Parameter is an array, so we need to iterate through it items = nil unless hash['items'].nil? items = [] hash['items'].each do |structure| items << (ReservationItemDetailsResponse.from_hash(structure) if structure) end end items = nil unless hash.key?('items') location_id = hash.key?('location_id') ? hash['location_id'] : nil status = hash.key?('status') ? hash['status'] : nil updated_at = if hash.key?('updated_at') (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at']) end # Create object from extracted values. ReservationDetailsResponseV2.new(associate_id, created_at, customer_profile_id, display_id, expires_at, external_id, id, items, location_id, status, updated_at) end |
.names ⇒ Object
A mapping from model property names to API property names.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 61 def self.names @_hash = {} if @_hash.nil? @_hash['associate_id'] = 'associate_id' @_hash['created_at'] = 'created_at' @_hash['customer_profile_id'] = 'customer_profile_id' @_hash['display_id'] = 'display_id' @_hash['expires_at'] = 'expires_at' @_hash['external_id'] = 'external_id' @_hash['id'] = 'id' @_hash['items'] = 'items' @_hash['location_id'] = 'location_id' @_hash['status'] = 'status' @_hash['updated_at'] = 'updated_at' @_hash end |
.nullables ⇒ Object
An array for nullable fields
83 84 85 86 87 88 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 83 def self.nullables %w[ associate_id external_id ] end |
.optionals ⇒ Object
An array for optional fields
78 79 80 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 78 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
176 177 178 179 180 181 182 183 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 176 def inspect class_name = self.class.name.split('::').last "<#{class_name} associate_id: #{@associate_id.inspect}, created_at: #{@created_at.inspect},"\ " customer_profile_id: #{@customer_profile_id.inspect}, display_id: #{@display_id.inspect},"\ " expires_at: #{@expires_at.inspect}, external_id: #{@external_id.inspect}, id:"\ " #{@id.inspect}, items: #{@items.inspect}, location_id: #{@location_id.inspect}, status:"\ " #{@status.inspect}, updated_at: #{@updated_at.inspect}>" end |
#to_custom_created_at ⇒ Object
154 155 156 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 154 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_custom_expires_at ⇒ Object
158 159 160 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 158 def to_custom_expires_at DateTimeHelper.to_rfc3339(expires_at) end |
#to_custom_updated_at ⇒ Object
162 163 164 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 162 def to_custom_updated_at DateTimeHelper.to_rfc3339(updated_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
167 168 169 170 171 172 173 |
# File 'lib/new_store_api/models/reservation_details_response_v2.rb', line 167 def to_s class_name = self.class.name.split('::').last "<#{class_name} associate_id: #{@associate_id}, created_at: #{@created_at},"\ " customer_profile_id: #{@customer_profile_id}, display_id: #{@display_id}, expires_at:"\ " #{@expires_at}, external_id: #{@external_id}, id: #{@id}, items: #{@items}, location_id:"\ " #{@location_id}, status: #{@status}, updated_at: #{@updated_at}>" end |