Class: UspsApi::DisputeValidationResult
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UspsApi::DisputeValidationResult
- Defined in:
- lib/usps_api/models/dispute_validation_result.rb
Overview
DisputeValidationResult Model.
Instance Attribute Summary collapse
-
#acct_mgmt_response ⇒ MgmtResponse
Account management response details, if available.
-
#crid ⇒ String
Customer Registration ID (CRID) of the mail owner.
-
#dispute_valid ⇒ Business
Indicates if the dispute can be created.
-
#eps_transaction_id ⇒ String
EPS Transaction ID for the Census charge.
-
#payment_response ⇒ PaymentResponse
Payment validation response details, if available.
-
#tracking_id ⇒ String
IMpb barcode for the package.
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(tracking_id: SKIP, eps_transaction_id: SKIP, crid: SKIP, dispute_valid: Business::N, payment_response: SKIP, acct_mgmt_response: SKIP, additional_properties: nil) ⇒ DisputeValidationResult
constructor
A new instance of DisputeValidationResult.
-
#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(tracking_id: SKIP, eps_transaction_id: SKIP, crid: SKIP, dispute_valid: Business::N, payment_response: SKIP, acct_mgmt_response: SKIP, additional_properties: nil) ⇒ DisputeValidationResult
Returns a new instance of DisputeValidationResult.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/usps_api/models/dispute_validation_result.rb', line 65 def initialize(tracking_id: SKIP, eps_transaction_id: SKIP, crid: SKIP, dispute_valid: Business::N, payment_response: SKIP, acct_mgmt_response: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @tracking_id = tracking_id unless tracking_id == SKIP @eps_transaction_id = eps_transaction_id unless eps_transaction_id == SKIP @crid = crid unless crid == SKIP @dispute_valid = dispute_valid unless dispute_valid == SKIP @payment_response = payment_response unless payment_response == SKIP @acct_mgmt_response = acct_mgmt_response unless acct_mgmt_response == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#acct_mgmt_response ⇒ MgmtResponse
Account management response details, if available.
34 35 36 |
# File 'lib/usps_api/models/dispute_validation_result.rb', line 34 def acct_mgmt_response @acct_mgmt_response end |
#crid ⇒ String
Customer Registration ID (CRID) of the mail owner.
22 23 24 |
# File 'lib/usps_api/models/dispute_validation_result.rb', line 22 def crid @crid end |
#dispute_valid ⇒ Business
Indicates if the dispute can be created. āYā for yes, āNā for no.
26 27 28 |
# File 'lib/usps_api/models/dispute_validation_result.rb', line 26 def dispute_valid @dispute_valid end |
#eps_transaction_id ⇒ String
EPS Transaction ID for the Census charge.
18 19 20 |
# File 'lib/usps_api/models/dispute_validation_result.rb', line 18 def eps_transaction_id @eps_transaction_id end |
#payment_response ⇒ PaymentResponse
Payment validation response details, if available.
30 31 32 |
# File 'lib/usps_api/models/dispute_validation_result.rb', line 30 def payment_response @payment_response end |
#tracking_id ⇒ String
IMpb barcode for the package.
14 15 16 |
# File 'lib/usps_api/models/dispute_validation_result.rb', line 14 def tracking_id @tracking_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
81 82 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/dispute_validation_result.rb', line 81 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. tracking_id = hash.key?('trackingID') ? hash['trackingID'] : SKIP eps_transaction_id = hash.key?('EPSTransactionID') ? hash['EPSTransactionID'] : SKIP crid = hash.key?('CRID') ? hash['CRID'] : SKIP dispute_valid = hash['disputeValid'] ||= Business::N payment_response = PaymentResponse.from_hash(hash['paymentResponse']) if hash['paymentResponse'] acct_mgmt_response = MgmtResponse.from_hash(hash['AcctMgmtResponse']) if hash['AcctMgmtResponse'] # 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. DisputeValidationResult.new(tracking_id: tracking_id, eps_transaction_id: eps_transaction_id, crid: crid, dispute_valid: dispute_valid, payment_response: payment_response, acct_mgmt_response: acct_mgmt_response, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/usps_api/models/dispute_validation_result.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['tracking_id'] = 'trackingID' @_hash['eps_transaction_id'] = 'EPSTransactionID' @_hash['crid'] = 'CRID' @_hash['dispute_valid'] = 'disputeValid' @_hash['payment_response'] = 'paymentResponse' @_hash['acct_mgmt_response'] = 'AcctMgmtResponse' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 |
# File 'lib/usps_api/models/dispute_validation_result.rb', line 61 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/usps_api/models/dispute_validation_result.rb', line 49 def self.optionals %w[ tracking_id eps_transaction_id crid dispute_valid payment_response acct_mgmt_response ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
122 123 124 125 126 127 128 129 |
# File 'lib/usps_api/models/dispute_validation_result.rb', line 122 def inspect class_name = self.class.name.split('::').last "<#{class_name} tracking_id: #{@tracking_id.inspect}, eps_transaction_id:"\ " #{@eps_transaction_id.inspect}, crid: #{@crid.inspect}, dispute_valid:"\ " #{@dispute_valid.inspect}, payment_response: #{@payment_response.inspect},"\ " acct_mgmt_response: #{@acct_mgmt_response.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
113 114 115 116 117 118 119 |
# File 'lib/usps_api/models/dispute_validation_result.rb', line 113 def to_s class_name = self.class.name.split('::').last "<#{class_name} tracking_id: #{@tracking_id}, eps_transaction_id: #{@eps_transaction_id},"\ " crid: #{@crid}, dispute_valid: #{@dispute_valid}, payment_response: #{@payment_response},"\ " acct_mgmt_response: #{@acct_mgmt_response}, additional_properties:"\ " #{@additional_properties}>" end |