Class: UspsApi::CreateOdContainerResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UspsApi::CreateOdContainerResponse
- Defined in:
- lib/usps_api/models/create_od_container_response.rb
Overview
CreateOdContainerResponse Model.
Instance Attribute Summary collapse
-
#imcb_image ⇒ String
Contains the Base64-encoded file contents of the 99M IMcb image.
-
#label_image ⇒ String
Contains the Base64-encoded file contents of the IMpb label image.
-
#pmod_container_metadata ⇒ CreateOpenAndDistributeContainerMetadata
Create OD Container Response.
-
#receipt_image ⇒ String
Contains the Base64-encoded file contents of the label receipt image.
-
#warnings ⇒ Array[ContainersContainerWarnings]
Contains the Base64-encoded file contents of the label receipt image.
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(pmod_container_metadata: SKIP, label_image: SKIP, imcb_image: SKIP, receipt_image: SKIP, warnings: SKIP) ⇒ CreateOdContainerResponse
constructor
A new instance of CreateOdContainerResponse.
-
#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(pmod_container_metadata: SKIP, label_image: SKIP, imcb_image: SKIP, receipt_image: SKIP, warnings: SKIP) ⇒ CreateOdContainerResponse
Returns a new instance of CreateOdContainerResponse.
73 74 75 76 77 78 79 80 |
# File 'lib/usps_api/models/create_od_container_response.rb', line 73 def initialize(pmod_container_metadata: SKIP, label_image: SKIP, imcb_image: SKIP, receipt_image: SKIP, warnings: SKIP) @pmod_container_metadata = unless == SKIP @label_image = label_image unless label_image == SKIP @imcb_image = imcb_image unless imcb_image == SKIP @receipt_image = receipt_image unless receipt_image == SKIP @warnings = warnings unless warnings == SKIP end |
Instance Attribute Details
#imcb_image ⇒ String
Contains the Base64-encoded file contents of the 99M IMcb image. Provided only when ‘imageInfo.imageType` is not `NONE`.
24 25 26 |
# File 'lib/usps_api/models/create_od_container_response.rb', line 24 def imcb_image @imcb_image end |
#label_image ⇒ String
Contains the Base64-encoded file contents of the IMpb label image. Provided only when ‘imageInfo.imageType` is not `NONE`.
19 20 21 |
# File 'lib/usps_api/models/create_od_container_response.rb', line 19 def label_image @label_image end |
#pmod_container_metadata ⇒ CreateOpenAndDistributeContainerMetadata
Create OD Container Response
14 15 16 |
# File 'lib/usps_api/models/create_od_container_response.rb', line 14 def @pmod_container_metadata end |
#receipt_image ⇒ String
Contains the Base64-encoded file contents of the label receipt image. Provided only when ‘imageInfo.receiptOption` is `SEPARATE_PAGE`. Note:
-
When ‘imageInfo.imageType` is `ZPL203DPI` or `ZPL300DPI` and
‘imageInfo.receiptOption` is `SEPARATE_PAGE`, the receipt will be returned as an additional label segment within the single ZPL payload in `labelImage`. In this case, `receiptImage` will not be populated.
34 35 36 |
# File 'lib/usps_api/models/create_od_container_response.rb', line 34 def receipt_image @receipt_image end |
#warnings ⇒ Array[ContainersContainerWarnings]
Contains the Base64-encoded file contents of the label receipt image. Provided only when ‘imageInfo.receiptOption` is `SEPARATE_PAGE`. Note:
-
When ‘imageInfo.imageType` is `ZPL203DPI` or `ZPL300DPI` and
‘imageInfo.receiptOption` is `SEPARATE_PAGE`, the receipt will be returned as an additional label segment within the single ZPL payload in `labelImage`. In this case, `receiptImage` will not be populated.
44 45 46 |
# File 'lib/usps_api/models/create_od_container_response.rb', line 44 def warnings @warnings end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/usps_api/models/create_od_container_response.rb', line 83 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. if hash['pmodContainerMetadata'] = CreateOpenAndDistributeContainerMetadata.from_hash(hash['pmodContainerMetadata']) end label_image = hash.key?('labelImage') ? hash['labelImage'] : SKIP imcb_image = hash.key?('imcbImage') ? hash['imcbImage'] : SKIP receipt_image = hash.key?('receiptImage') ? hash['receiptImage'] : SKIP # Parameter is an array, so we need to iterate through it warnings = nil unless hash['warnings'].nil? warnings = [] hash['warnings'].each do |structure| warnings << (ContainersContainerWarnings.from_hash(structure) if structure) end end warnings = SKIP unless hash.key?('warnings') # Create object from extracted values. CreateOdContainerResponse.new(pmod_container_metadata: , label_image: label_image, imcb_image: imcb_image, receipt_image: receipt_image, warnings: warnings) end |
.names ⇒ Object
A mapping from model property names to API property names.
47 48 49 50 51 52 53 54 55 |
# File 'lib/usps_api/models/create_od_container_response.rb', line 47 def self.names @_hash = {} if @_hash.nil? @_hash['pmod_container_metadata'] = 'pmodContainerMetadata' @_hash['label_image'] = 'labelImage' @_hash['imcb_image'] = 'imcbImage' @_hash['receipt_image'] = 'receiptImage' @_hash['warnings'] = 'warnings' @_hash end |
.nullables ⇒ Object
An array for nullable fields
69 70 71 |
# File 'lib/usps_api/models/create_od_container_response.rb', line 69 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
58 59 60 61 62 63 64 65 66 |
# File 'lib/usps_api/models/create_od_container_response.rb', line 58 def self.optionals %w[ pmod_container_metadata label_image imcb_image receipt_image warnings ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
121 122 123 124 125 126 |
# File 'lib/usps_api/models/create_od_container_response.rb', line 121 def inspect class_name = self.class.name.split('::').last "<#{class_name} pmod_container_metadata: #{@pmod_container_metadata.inspect}, label_image:"\ " #{@label_image.inspect}, imcb_image: #{@imcb_image.inspect}, receipt_image:"\ " #{@receipt_image.inspect}, warnings: #{@warnings.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
113 114 115 116 117 118 |
# File 'lib/usps_api/models/create_od_container_response.rb', line 113 def to_s class_name = self.class.name.split('::').last "<#{class_name} pmod_container_metadata: #{@pmod_container_metadata}, label_image:"\ " #{@label_image}, imcb_image: #{@imcb_image}, receipt_image: #{@receipt_image}, warnings:"\ " #{@warnings}>" end |