Class: UspsApi::DisputeCreateRequest
- Defined in:
- lib/usps_api/models/dispute_create_request.rb
Overview
DisputeCreateRequest Model.
Instance Attribute Summary collapse
-
#crid ⇒ String
Customer Registration ID (CRID) of the mail owner.
-
#description ⇒ String
Free text describing the dispute.
-
#dispute_count ⇒ String
Number of times a dispute has been opened.
-
#eps_transaction_id ⇒ String
EPS Transaction ID for the Census charge.
-
#name ⇒ String
Name of the individual or entity submitting the dispute.
-
#reason ⇒ Reason
Reason for the dispute.
-
#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(eps_transaction_id:, tracking_id:, crid:, reason:, description:, name:, dispute_count:, additional_properties: nil) ⇒ DisputeCreateRequest
constructor
A new instance of DisputeCreateRequest.
-
#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(eps_transaction_id:, tracking_id:, crid:, reason:, description:, name:, dispute_count:, additional_properties: nil) ⇒ DisputeCreateRequest
Returns a new instance of DisputeCreateRequest.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/usps_api/models/dispute_create_request.rb', line 63 def initialize(eps_transaction_id:, tracking_id:, crid:, reason:, description:, name:, dispute_count:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @eps_transaction_id = eps_transaction_id @tracking_id = tracking_id @crid = crid @reason = reason @description = description @name = name @dispute_count = dispute_count @additional_properties = additional_properties end |
Instance Attribute Details
#crid ⇒ String
Customer Registration ID (CRID) of the mail owner.
22 23 24 |
# File 'lib/usps_api/models/dispute_create_request.rb', line 22 def crid @crid end |
#description ⇒ String
Free text describing the dispute.
30 31 32 |
# File 'lib/usps_api/models/dispute_create_request.rb', line 30 def description @description end |
#dispute_count ⇒ String
Number of times a dispute has been opened.
38 39 40 |
# File 'lib/usps_api/models/dispute_create_request.rb', line 38 def dispute_count @dispute_count end |
#eps_transaction_id ⇒ String
EPS Transaction ID for the Census charge.
14 15 16 |
# File 'lib/usps_api/models/dispute_create_request.rb', line 14 def eps_transaction_id @eps_transaction_id end |
#name ⇒ String
Name of the individual or entity submitting the dispute.
34 35 36 |
# File 'lib/usps_api/models/dispute_create_request.rb', line 34 def name @name end |
#reason ⇒ Reason
Reason for the dispute.
26 27 28 |
# File 'lib/usps_api/models/dispute_create_request.rb', line 26 def reason @reason end |
#tracking_id ⇒ String
IMpb barcode for the package.
18 19 20 |
# File 'lib/usps_api/models/dispute_create_request.rb', line 18 def tracking_id @tracking_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
80 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 |
# File 'lib/usps_api/models/dispute_create_request.rb', line 80 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. eps_transaction_id = hash.key?('EPSTransactionID') ? hash['EPSTransactionID'] : nil tracking_id = hash.key?('trackingID') ? hash['trackingID'] : nil crid = hash.key?('CRID') ? hash['CRID'] : nil reason = hash.key?('reason') ? hash['reason'] : nil description = hash.key?('description') ? hash['description'] : nil name = hash.key?('name') ? hash['name'] : nil dispute_count = hash.key?('disputeCount') ? hash['disputeCount'] : nil # 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. DisputeCreateRequest.new(eps_transaction_id: eps_transaction_id, tracking_id: tracking_id, crid: crid, reason: reason, description: description, name: name, dispute_count: dispute_count, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/usps_api/models/dispute_create_request.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['eps_transaction_id'] = 'EPSTransactionID' @_hash['tracking_id'] = 'trackingID' @_hash['crid'] = 'CRID' @_hash['reason'] = 'reason' @_hash['description'] = 'description' @_hash['name'] = 'name' @_hash['dispute_count'] = 'disputeCount' @_hash end |
.nullables ⇒ Object
An array for nullable fields
59 60 61 |
# File 'lib/usps_api/models/dispute_create_request.rb', line 59 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 |
# File 'lib/usps_api/models/dispute_create_request.rb', line 54 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
120 121 122 123 124 125 126 |
# File 'lib/usps_api/models/dispute_create_request.rb', line 120 def inspect class_name = self.class.name.split('::').last "<#{class_name} eps_transaction_id: #{@eps_transaction_id.inspect}, tracking_id:"\ " #{@tracking_id.inspect}, crid: #{@crid.inspect}, reason: #{@reason.inspect}, description:"\ " #{@description.inspect}, name: #{@name.inspect}, dispute_count: #{@dispute_count.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
112 113 114 115 116 117 |
# File 'lib/usps_api/models/dispute_create_request.rb', line 112 def to_s class_name = self.class.name.split('::').last "<#{class_name} eps_transaction_id: #{@eps_transaction_id}, tracking_id: #{@tracking_id},"\ " crid: #{@crid}, reason: #{@reason}, description: #{@description}, name: #{@name},"\ " dispute_count: #{@dispute_count}, additional_properties: #{@additional_properties}>" end |