Class: UspsApi::CancelIntelligentMailBarcodeResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UspsApi::CancelIntelligentMailBarcodeResponse
- Defined in:
- lib/usps_api/models/cancel_intelligent_mail_barcode_response.rb
Overview
Cancel Intelligent Mail Barcode (IMB) Response
Instance Attribute Summary collapse
-
#dispute_id ⇒ String
The Id of the submitted refund request.
-
#imb ⇒ String
The Human-readable form of the Intelligent Mail Barcode (IMB) that has been canceled or for which a refund request has been submitted.
-
#status ⇒ Status2
-
CANCELED indicates that the IMB has been successfully canceled.
-
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(imb: SKIP, status: SKIP, dispute_id: SKIP, additional_properties: nil) ⇒ CancelIntelligentMailBarcodeResponse
constructor
A new instance of CancelIntelligentMailBarcodeResponse.
-
#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(imb: SKIP, status: SKIP, dispute_id: SKIP, additional_properties: nil) ⇒ CancelIntelligentMailBarcodeResponse
Returns a new instance of CancelIntelligentMailBarcodeResponse.
60 61 62 63 64 65 66 67 68 69 |
# File 'lib/usps_api/models/cancel_intelligent_mail_barcode_response.rb', line 60 def initialize(imb: SKIP, status: SKIP, dispute_id: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @imb = imb unless imb == SKIP @status = status unless status == SKIP @dispute_id = dispute_id unless dispute_id == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#dispute_id ⇒ String
The Id of the submitted refund request. Note:
-
The disputeId field may not be returned for IMBs created prior to
8/27/2025.
-
If a refund request is successfully submitted, a disputeId will be
returned that can be used to then track the status of the refund request. The system will only give one unique disputeId per customer reference ID (CRID) per day. Duplicate submissions of the same label, for the same CRID, on the same day, will be rejected.
-
In some cases, a disputeId may be generated before the IMB is processed
for payment. If this occurs, please resubmit the IMB for cancellation the following day for a new disputeId.
35 36 37 |
# File 'lib/usps_api/models/cancel_intelligent_mail_barcode_response.rb', line 35 def dispute_id @dispute_id end |
#imb ⇒ String
The Human-readable form of the Intelligent Mail Barcode (IMB) that has been canceled or for which a refund request has been submitted.
15 16 17 |
# File 'lib/usps_api/models/cancel_intelligent_mail_barcode_response.rb', line 15 def imb @imb end |
#status ⇒ Status2
-
CANCELED indicates that the IMB has been successfully canceled.
-
DISPUTED indicates that a refund request has been submitted.
20 21 22 |
# File 'lib/usps_api/models/cancel_intelligent_mail_barcode_response.rb', line 20 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/usps_api/models/cancel_intelligent_mail_barcode_response.rb', line 72 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. imb = hash.key?('imb') ? hash['imb'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP dispute_id = hash.key?('disputeId') ? hash['disputeId'] : SKIP # 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. CancelIntelligentMailBarcodeResponse.new(imb: imb, status: status, dispute_id: dispute_id, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 |
# File 'lib/usps_api/models/cancel_intelligent_mail_barcode_response.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['imb'] = 'imb' @_hash['status'] = 'status' @_hash['dispute_id'] = 'disputeId' @_hash end |
.nullables ⇒ Object
An array for nullable fields
56 57 58 |
# File 'lib/usps_api/models/cancel_intelligent_mail_barcode_response.rb', line 56 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
47 48 49 50 51 52 53 |
# File 'lib/usps_api/models/cancel_intelligent_mail_barcode_response.rb', line 47 def self.optionals %w[ imb status dispute_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
102 103 104 105 106 |
# File 'lib/usps_api/models/cancel_intelligent_mail_barcode_response.rb', line 102 def inspect class_name = self.class.name.split('::').last "<#{class_name} imb: #{@imb.inspect}, status: #{@status.inspect}, dispute_id:"\ " #{@dispute_id.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
95 96 97 98 99 |
# File 'lib/usps_api/models/cancel_intelligent_mail_barcode_response.rb', line 95 def to_s class_name = self.class.name.split('::').last "<#{class_name} imb: #{@imb}, status: #{@status}, dispute_id: #{@dispute_id},"\ " additional_properties: #{@additional_properties}>" end |