Class: UspsApi::DetailInfo1
- Defined in:
- lib/usps_api/models/detail_info1.rb
Overview
Details of the appointment for the availability request.
Instance Attribute Summary collapse
-
#consignee_container_grouping_id ⇒ String
Consigner Container Grouping ID.
-
#shipper_container_grouping_id ⇒ String
Shipper Container Grouping ID.
-
#usps_summary ⇒ Array[UspsSummary1]
Additional details of the Appointment.
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(consignee_container_grouping_id: SKIP, shipper_container_grouping_id: SKIP, usps_summary: SKIP, additional_properties: nil) ⇒ DetailInfo1
constructor
A new instance of DetailInfo1.
-
#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(consignee_container_grouping_id: SKIP, shipper_container_grouping_id: SKIP, usps_summary: SKIP, additional_properties: nil) ⇒ DetailInfo1
Returns a new instance of DetailInfo1.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/usps_api/models/detail_info1.rb', line 48 def initialize(consignee_container_grouping_id: SKIP, shipper_container_grouping_id: SKIP, usps_summary: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? unless consignee_container_grouping_id == SKIP @consignee_container_grouping_id = consignee_container_grouping_id end unless shipper_container_grouping_id == SKIP @shipper_container_grouping_id = shipper_container_grouping_id end @usps_summary = usps_summary unless usps_summary == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#consignee_container_grouping_id ⇒ String
Consigner Container Grouping ID
14 15 16 |
# File 'lib/usps_api/models/detail_info1.rb', line 14 def consignee_container_grouping_id @consignee_container_grouping_id end |
#shipper_container_grouping_id ⇒ String
Shipper Container Grouping ID
18 19 20 |
# File 'lib/usps_api/models/detail_info1.rb', line 18 def shipper_container_grouping_id @shipper_container_grouping_id end |
#usps_summary ⇒ Array[UspsSummary1]
Additional details of the Appointment.
22 23 24 |
# File 'lib/usps_api/models/detail_info1.rb', line 22 def usps_summary @usps_summary end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/usps_api/models/detail_info1.rb', line 67 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. consignee_container_grouping_id = hash.key?('consigneeContainerGroupingID') ? hash['consigneeContainerGroupingID'] : SKIP shipper_container_grouping_id = hash.key?('shipperContainerGroupingID') ? hash['shipperContainerGroupingID'] : SKIP # Parameter is an array, so we need to iterate through it usps_summary = nil unless hash['uspsSummary'].nil? usps_summary = [] hash['uspsSummary'].each do |structure| usps_summary << (UspsSummary1.from_hash(structure) if structure) end end usps_summary = SKIP unless hash.key?('uspsSummary') # 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. DetailInfo1.new(consignee_container_grouping_id: consignee_container_grouping_id, shipper_container_grouping_id: shipper_container_grouping_id, usps_summary: usps_summary, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 32 |
# File 'lib/usps_api/models/detail_info1.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['consignee_container_grouping_id'] = 'consigneeContainerGroupingID' @_hash['shipper_container_grouping_id'] = 'shipperContainerGroupingID' @_hash['usps_summary'] = 'uspsSummary' @_hash end |
.nullables ⇒ Object
An array for nullable fields
44 45 46 |
# File 'lib/usps_api/models/detail_info1.rb', line 44 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
35 36 37 38 39 40 41 |
# File 'lib/usps_api/models/detail_info1.rb', line 35 def self.optionals %w[ consignee_container_grouping_id shipper_container_grouping_id usps_summary ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
109 110 111 112 113 114 115 |
# File 'lib/usps_api/models/detail_info1.rb', line 109 def inspect class_name = self.class.name.split('::').last "<#{class_name} consignee_container_grouping_id:"\ " #{@consignee_container_grouping_id.inspect}, shipper_container_grouping_id:"\ " #{@shipper_container_grouping_id.inspect}, usps_summary: #{@usps_summary.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
101 102 103 104 105 106 |
# File 'lib/usps_api/models/detail_info1.rb', line 101 def to_s class_name = self.class.name.split('::').last "<#{class_name} consignee_container_grouping_id: #{@consignee_container_grouping_id},"\ " shipper_container_grouping_id: #{@shipper_container_grouping_id}, usps_summary:"\ " #{@usps_summary}, additional_properties: #{@additional_properties}>" end |