Class: UspsApi::IndiciaImbResponse
- Defined in:
- lib/usps_api/models/indicia_imb_response.rb
Overview
IndiciaImbResponse Model.
Instance Attribute Summary collapse
-
#indicia_image ⇒ String
Contains the Base64-encoded file contents of the indicia image.
-
#indicia_metadata ⇒ IndiciaMetadata11
Metadata for indicia.
-
#receipt_image ⇒ String
Contains the Base64-encoded file contents of the indicia 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(indicia_metadata: SKIP, indicia_image: SKIP, receipt_image: SKIP) ⇒ IndiciaImbResponse
constructor
A new instance of IndiciaImbResponse.
-
#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(indicia_metadata: SKIP, indicia_image: SKIP, receipt_image: SKIP) ⇒ IndiciaImbResponse
Returns a new instance of IndiciaImbResponse.
49 50 51 52 53 54 |
# File 'lib/usps_api/models/indicia_imb_response.rb', line 49 def initialize(indicia_metadata: SKIP, indicia_image: SKIP, receipt_image: SKIP) @indicia_metadata = unless == SKIP @indicia_image = indicia_image unless indicia_image == SKIP @receipt_image = receipt_image unless receipt_image == SKIP end |
Instance Attribute Details
#indicia_image ⇒ String
Contains the Base64-encoded file contents of the indicia image. Provided only when ‘imageInfo.labelType` is not `IMI_DATA_ONLY`.
19 20 21 |
# File 'lib/usps_api/models/indicia_imb_response.rb', line 19 def indicia_image @indicia_image end |
#indicia_metadata ⇒ IndiciaMetadata11
Metadata for indicia
14 15 16 |
# File 'lib/usps_api/models/indicia_imb_response.rb', line 14 def @indicia_metadata end |
#receipt_image ⇒ String
Contains the Base64-encoded file contents of the indicia receipt image. Provided only when ‘imageInfo.receiptOption` is `SEPARATE_PAGE`.
24 25 26 |
# File 'lib/usps_api/models/indicia_imb_response.rb', line 24 def receipt_image @receipt_image end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/usps_api/models/indicia_imb_response.rb', line 57 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. = IndiciaMetadata11.from_hash(hash['indiciaMetadata']) if hash['indiciaMetadata'] indicia_image = hash.key?('indiciaImage') ? hash['indiciaImage'] : SKIP receipt_image = hash.key?('receiptImage') ? hash['receiptImage'] : SKIP # Create object from extracted values. IndiciaImbResponse.new(indicia_metadata: , indicia_image: indicia_image, receipt_image: receipt_image) end |
.names ⇒ Object
A mapping from model property names to API property names.
27 28 29 30 31 32 33 |
# File 'lib/usps_api/models/indicia_imb_response.rb', line 27 def self.names @_hash = {} if @_hash.nil? @_hash['indicia_metadata'] = 'indiciaMetadata' @_hash['indicia_image'] = 'indiciaImage' @_hash['receipt_image'] = 'receiptImage' @_hash end |
.nullables ⇒ Object
An array for nullable fields
45 46 47 |
# File 'lib/usps_api/models/indicia_imb_response.rb', line 45 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
36 37 38 39 40 41 42 |
# File 'lib/usps_api/models/indicia_imb_response.rb', line 36 def self.optionals %w[ indicia_metadata indicia_image receipt_image ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
80 81 82 83 84 |
# File 'lib/usps_api/models/indicia_imb_response.rb', line 80 def inspect class_name = self.class.name.split('::').last "<#{class_name} indicia_metadata: #{@indicia_metadata.inspect}, indicia_image:"\ " #{@indicia_image.inspect}, receipt_image: #{@receipt_image.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
73 74 75 76 77 |
# File 'lib/usps_api/models/indicia_imb_response.rb', line 73 def to_s class_name = self.class.name.split('::').last "<#{class_name} indicia_metadata: #{@indicia_metadata}, indicia_image: #{@indicia_image},"\ " receipt_image: #{@receipt_image}>" end |