Class: PaypalServerSdk::OrderTrackerResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::OrderTrackerResponse
- Defined in:
- lib/paypal_server_sdk/models/order_tracker_response.rb
Overview
The tracking response on creation of tracker.
Instance Attribute Summary collapse
-
#create_time ⇒ String
The date and time, in [Internet date and time format](tools.ietf.org/html/rfc3339#section-5.6).
-
#id ⇒ String
The tracker id.
-
#items ⇒ Array[OrderTrackerItem]
An array of details of items in the shipment.
-
#links ⇒ Array[LinkDescription]
An array of request-related HATEOAS links.
-
#status ⇒ OrderTrackerStatus
The status of the item shipment.
-
#update_time ⇒ String
The date and time, in [Internet date and time format](tools.ietf.org/html/rfc3339#section-5.6).
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: SKIP, status: SKIP, items: SKIP, links: SKIP, create_time: SKIP, update_time: SKIP) ⇒ OrderTrackerResponse
constructor
A new instance of OrderTrackerResponse.
-
#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: SKIP, status: SKIP, items: SKIP, links: SKIP, create_time: SKIP, update_time: SKIP) ⇒ OrderTrackerResponse
Returns a new instance of OrderTrackerResponse.
71 72 73 74 75 76 77 78 79 |
# File 'lib/paypal_server_sdk/models/order_tracker_response.rb', line 71 def initialize(id: SKIP, status: SKIP, items: SKIP, links: SKIP, create_time: SKIP, update_time: SKIP) @id = id unless id == SKIP @status = status unless status == SKIP @items = items unless items == SKIP @links = links unless links == SKIP @create_time = create_time unless create_time == SKIP @update_time = update_time unless update_time == SKIP end |
Instance Attribute Details
#create_time ⇒ String
The date and time, in [Internet date and time format](tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.
33 34 35 |
# File 'lib/paypal_server_sdk/models/order_tracker_response.rb', line 33 def create_time @create_time end |
#id ⇒ String
The tracker id.
14 15 16 |
# File 'lib/paypal_server_sdk/models/order_tracker_response.rb', line 14 def id @id end |
#items ⇒ Array[OrderTrackerItem]
An array of details of items in the shipment.
22 23 24 |
# File 'lib/paypal_server_sdk/models/order_tracker_response.rb', line 22 def items @items end |
#links ⇒ Array[LinkDescription]
An array of request-related HATEOAS links.
26 27 28 |
# File 'lib/paypal_server_sdk/models/order_tracker_response.rb', line 26 def links @links end |
#status ⇒ OrderTrackerStatus
The status of the item shipment.
18 19 20 |
# File 'lib/paypal_server_sdk/models/order_tracker_response.rb', line 18 def status @status end |
#update_time ⇒ String
The date and time, in [Internet date and time format](tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.
40 41 42 |
# File 'lib/paypal_server_sdk/models/order_tracker_response.rb', line 40 def update_time @update_time 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 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/paypal_server_sdk/models/order_tracker_response.rb', line 82 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP # Parameter is an array, so we need to iterate through it items = nil unless hash['items'].nil? items = [] hash['items'].each do |structure| items << (OrderTrackerItem.from_hash(structure) if structure) end end items = SKIP unless hash.key?('items') # Parameter is an array, so we need to iterate through it links = nil unless hash['links'].nil? links = [] hash['links'].each do |structure| links << (LinkDescription.from_hash(structure) if structure) end end links = SKIP unless hash.key?('links') create_time = hash.key?('create_time') ? hash['create_time'] : SKIP update_time = hash.key?('update_time') ? hash['update_time'] : SKIP # Create object from extracted values. OrderTrackerResponse.new(id: id, status: status, items: items, links: links, create_time: create_time, update_time: update_time) end |
.names ⇒ Object
A mapping from model property names to API property names.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/paypal_server_sdk/models/order_tracker_response.rb', line 43 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['status'] = 'status' @_hash['items'] = 'items' @_hash['links'] = 'links' @_hash['create_time'] = 'create_time' @_hash['update_time'] = 'update_time' @_hash end |
.nullables ⇒ Object
An array for nullable fields
67 68 69 |
# File 'lib/paypal_server_sdk/models/order_tracker_response.rb', line 67 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/paypal_server_sdk/models/order_tracker_response.rb', line 55 def self.optionals %w[ id status items links create_time update_time ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
128 129 130 131 132 133 |
# File 'lib/paypal_server_sdk/models/order_tracker_response.rb', line 128 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, status: #{@status.inspect}, items: #{@items.inspect},"\ " links: #{@links.inspect}, create_time: #{@create_time.inspect}, update_time:"\ " #{@update_time.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
121 122 123 124 125 |
# File 'lib/paypal_server_sdk/models/order_tracker_response.rb', line 121 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, status: #{@status}, items: #{@items}, links: #{@links},"\ " create_time: #{@create_time}, update_time: #{@update_time}>" end |