Class: UspsApi::InternationalLabelReprintResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UspsApi::InternationalLabelReprintResponse
- Defined in:
- lib/usps_api/models/international_label_reprint_response.rb
Overview
Response schema for International label reprint requests.
Instance Attribute Summary collapse
-
#label_image ⇒ String
Contains the Base64-encoded file contents of the label image.
-
#label_metadata ⇒ InternationalLabelMetadataResponse
Metadata information for an international label including tracking number, pricing details, postage, and extra services.
-
#reprint_info ⇒ InternationalLabelsReprintInfo
Schema containing reprint information for a label.
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(label_metadata: SKIP, label_image: SKIP, reprint_info: SKIP) ⇒ InternationalLabelReprintResponse
constructor
A new instance of InternationalLabelReprintResponse.
-
#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(label_metadata: SKIP, label_image: SKIP, reprint_info: SKIP) ⇒ InternationalLabelReprintResponse
Returns a new instance of InternationalLabelReprintResponse.
48 49 50 51 52 |
# File 'lib/usps_api/models/international_label_reprint_response.rb', line 48 def initialize(label_metadata: SKIP, label_image: SKIP, reprint_info: SKIP) @label_metadata = unless == SKIP @label_image = label_image unless label_image == SKIP @reprint_info = reprint_info unless reprint_info == SKIP end |
Instance Attribute Details
#label_image ⇒ String
Contains the Base64-encoded file contents of the label image.
19 20 21 |
# File 'lib/usps_api/models/international_label_reprint_response.rb', line 19 def label_image @label_image end |
#label_metadata ⇒ InternationalLabelMetadataResponse
Metadata information for an international label including tracking number, pricing details, postage, and extra services.
15 16 17 |
# File 'lib/usps_api/models/international_label_reprint_response.rb', line 15 def @label_metadata end |
#reprint_info ⇒ InternationalLabelsReprintInfo
Schema containing reprint information for a label.
23 24 25 |
# File 'lib/usps_api/models/international_label_reprint_response.rb', line 23 def reprint_info @reprint_info end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/usps_api/models/international_label_reprint_response.rb', line 55 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. = InternationalLabelMetadataResponse.from_hash(hash['labelMetadata']) if hash['labelMetadata'] label_image = hash.key?('labelImage') ? hash['labelImage'] : SKIP reprint_info = InternationalLabelsReprintInfo.from_hash(hash['reprintInfo']) if hash['reprintInfo'] # Create object from extracted values. InternationalLabelReprintResponse.new(label_metadata: , label_image: label_image, reprint_info: reprint_info) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 32 |
# File 'lib/usps_api/models/international_label_reprint_response.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['label_metadata'] = 'labelMetadata' @_hash['label_image'] = 'labelImage' @_hash['reprint_info'] = 'reprintInfo' @_hash end |
.nullables ⇒ Object
An array for nullable fields
44 45 46 |
# File 'lib/usps_api/models/international_label_reprint_response.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/international_label_reprint_response.rb', line 35 def self.optionals %w[ label_metadata label_image reprint_info ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
79 80 81 82 83 |
# File 'lib/usps_api/models/international_label_reprint_response.rb', line 79 def inspect class_name = self.class.name.split('::').last "<#{class_name} label_metadata: #{@label_metadata.inspect}, label_image:"\ " #{@label_image.inspect}, reprint_info: #{@reprint_info.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
72 73 74 75 76 |
# File 'lib/usps_api/models/international_label_reprint_response.rb', line 72 def to_s class_name = self.class.name.split('::').last "<#{class_name} label_metadata: #{@label_metadata}, label_image: #{@label_image},"\ " reprint_info: #{@reprint_info}>" end |