Class: UspsApi::TransactionRoles
- Defined in:
- lib/usps_api/models/transaction_roles.rb
Overview
Role each party plays in the transaction
Instance Attribute Summary collapse
-
#account_number ⇒ String
The Enterprise Payment Account number or PC Postage meter number to use for payment.
-
#account_type ⇒ AccountType2
The type of payment account.
-
#crid ⇒ String
A Customer Registration Identification number (CRID) is a USPS-generated numeric code that uniquely identifies a business at a location.
-
#manifest_mid ⇒ String
The unique mailer identifier designated for the manifest.
-
#mid ⇒ String
The Mailer Identifier (MID) is a field within the Intelligent Mail barcode that is used to identify mailers.
-
#non_profit_status ⇒ TrueClass | FalseClass
This status is applicable only for permits and indicates whether the permit has been issued to a non-profit organization.
-
#permit_number ⇒ String
The permit number or Federal Agency Number to use for payment.
-
#permit_zip ⇒ String
The ZIP Code™ associated to the permit number.
-
#role_name ⇒ RoleName
-
PAYER - Payer of the Postage * RATE_HOLDER - Owner of the Contracted Postage Rates * LABEL_OWNER - Party supplying Label MIDs used for generating tracking numbers printed on physical label * SHIPPER - Party entering package into the mailstream * PLATFORM - Platform used * RETURN_LABEL_PAYER - Payer of the Postage for the return label in a combined outbound/return request.
-
-
#sufficient_funds ⇒ TrueClass | FalseClass
This attribute is relevant only when an amount parameter is provided, and it informs the API caller whether the payment account holds sufficient funds to process the payment.
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(role_name: SKIP, crid: SKIP, mid: SKIP, manifest_mid: SKIP, account_type: SKIP, account_number: SKIP, permit_number: SKIP, permit_zip: SKIP, non_profit_status: SKIP, sufficient_funds: SKIP, additional_properties: nil) ⇒ TransactionRoles
constructor
A new instance of TransactionRoles.
-
#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(role_name: SKIP, crid: SKIP, mid: SKIP, manifest_mid: SKIP, account_type: SKIP, account_number: SKIP, permit_number: SKIP, permit_zip: SKIP, non_profit_status: SKIP, sufficient_funds: SKIP, additional_properties: nil) ⇒ TransactionRoles
Returns a new instance of TransactionRoles.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/usps_api/models/transaction_roles.rb', line 124 def initialize(role_name: SKIP, crid: SKIP, mid: SKIP, manifest_mid: SKIP, account_type: SKIP, account_number: SKIP, permit_number: SKIP, permit_zip: SKIP, non_profit_status: SKIP, sufficient_funds: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @role_name = role_name unless role_name == SKIP @crid = crid unless crid == SKIP @mid = mid unless mid == SKIP @manifest_mid = manifest_mid unless manifest_mid == SKIP @account_type = account_type unless account_type == SKIP @account_number = account_number unless account_number == SKIP @permit_number = permit_number unless permit_number == SKIP @permit_zip = permit_zip unless permit_zip == SKIP @non_profit_status = non_profit_status unless non_profit_status == SKIP @sufficient_funds = sufficient_funds unless sufficient_funds == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_number ⇒ String
The Enterprise Payment Account number or PC Postage meter number to use for payment. Required when ‘accountType` is `EPS` or `METER`.
64 65 66 |
# File 'lib/usps_api/models/transaction_roles.rb', line 64 def account_number @account_number end |
#account_type ⇒ AccountType2
The type of payment account. METER pricing is only available to PC Postage providers.
59 60 61 |
# File 'lib/usps_api/models/transaction_roles.rb', line 59 def account_type @account_type end |
#crid ⇒ String
A Customer Registration Identification number (CRID) is a USPS-generated numeric code that uniquely identifies a business at a location.
44 45 46 |
# File 'lib/usps_api/models/transaction_roles.rb', line 44 def crid @crid end |
#manifest_mid ⇒ String
The unique mailer identifier designated for the manifest.
54 55 56 |
# File 'lib/usps_api/models/transaction_roles.rb', line 54 def manifest_mid @manifest_mid end |
#mid ⇒ String
The Mailer Identifier (MID) is a field within the Intelligent Mail barcode that is used to identify mailers. MIDs are assigned by the USPS® to a Mail Owner, Mailing Agent or other service providers who request them.
50 51 52 |
# File 'lib/usps_api/models/transaction_roles.rb', line 50 def mid @mid end |
#non_profit_status ⇒ TrueClass | FalseClass
This status is applicable only for permits and indicates whether the permit has been issued to a non-profit organization.
79 80 81 |
# File 'lib/usps_api/models/transaction_roles.rb', line 79 def non_profit_status @non_profit_status end |
#permit_number ⇒ String
The permit number or Federal Agency Number to use for payment. Required when ‘accountType` is `PERMIT` or `OMAS`.
69 70 71 |
# File 'lib/usps_api/models/transaction_roles.rb', line 69 def permit_number @permit_number end |
#permit_zip ⇒ String
The ZIP Code™ associated to the permit number. Required when ‘accountType` is `PERMIT` or `OMAS`.
74 75 76 |
# File 'lib/usps_api/models/transaction_roles.rb', line 74 def permit_zip @permit_zip end |
#role_name ⇒ RoleName
-
PAYER - Payer of the Postage
-
RATE_HOLDER - Owner of the Contracted Postage Rates
-
LABEL_OWNER - Party supplying Label MIDs used for generating tracking
numbers printed on physical label
-
SHIPPER - Party entering package into the mailstream
-
PLATFORM - Platform used
-
RETURN_LABEL_PAYER - Payer of the Postage for the return label in a
combined outbound/return request. Optional if outbound and return label payer are the same.
-
RETURN_LABEL_RATE_HOLDER - Owner of the Contracted Postage Rates for the
return label in a combined outbound/return request. Optional if outbound and return label rate holder are the same.
-
RETURN_LABEL_OWNER - Party supplying Label MIDs used for generating
tracking numbers printed on physical label for the return label in a combined outbound/return request. Optional if outbound and return label owner are the same.
-
MAIL_OWNER - This role is used to specify who owns the package contents.
When using the MAIL_OWNER role, the CRID must be specified. This does not populate the mail owner field in the D1 record of the Shipping Service File (SSF). Please use the ‘packageDescription.mailerOwnerMID` field to populate the D1 field.
-
LABEL_PROVIDER - This role is used to specify the label provider for the
transaction. When using the LABEL_PROVIDER role, the CRID, accountNumber, and accountType must be specified and the only supported accountType is ‘EPS’. The accountNumber must be active in the Enterprise Payment System (EPS).
39 40 41 |
# File 'lib/usps_api/models/transaction_roles.rb', line 39 def role_name @role_name end |
#sufficient_funds ⇒ TrueClass | FalseClass
This attribute is relevant only when an amount parameter is provided, and it informs the API caller whether the payment account holds sufficient funds to process the payment.
85 86 87 |
# File 'lib/usps_api/models/transaction_roles.rb', line 85 def sufficient_funds @sufficient_funds end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/usps_api/models/transaction_roles.rb', line 146 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. role_name = hash.key?('roleName') ? hash['roleName'] : SKIP crid = hash.key?('CRID') ? hash['CRID'] : SKIP mid = hash.key?('MID') ? hash['MID'] : SKIP manifest_mid = hash.key?('manifestMID') ? hash['manifestMID'] : SKIP account_type = hash.key?('accountType') ? hash['accountType'] : SKIP account_number = hash.key?('accountNumber') ? hash['accountNumber'] : SKIP permit_number = hash.key?('permitNumber') ? hash['permitNumber'] : SKIP permit_zip = hash.key?('permitZIP') ? hash['permitZIP'] : SKIP non_profit_status = hash.key?('nonProfitStatus') ? hash['nonProfitStatus'] : SKIP sufficient_funds = hash.key?('sufficientFunds') ? hash['sufficientFunds'] : 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. TransactionRoles.new(role_name: role_name, crid: crid, mid: mid, manifest_mid: manifest_mid, account_type: account_type, account_number: account_number, permit_number: permit_number, permit_zip: permit_zip, non_profit_status: non_profit_status, sufficient_funds: sufficient_funds, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/usps_api/models/transaction_roles.rb', line 88 def self.names @_hash = {} if @_hash.nil? @_hash['role_name'] = 'roleName' @_hash['crid'] = 'CRID' @_hash['mid'] = 'MID' @_hash['manifest_mid'] = 'manifestMID' @_hash['account_type'] = 'accountType' @_hash['account_number'] = 'accountNumber' @_hash['permit_number'] = 'permitNumber' @_hash['permit_zip'] = 'permitZIP' @_hash['non_profit_status'] = 'nonProfitStatus' @_hash['sufficient_funds'] = 'sufficientFunds' @_hash end |
.nullables ⇒ Object
An array for nullable fields
120 121 122 |
# File 'lib/usps_api/models/transaction_roles.rb', line 120 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/usps_api/models/transaction_roles.rb', line 104 def self.optionals %w[ role_name crid mid manifest_mid account_type account_number permit_number permit_zip non_profit_status sufficient_funds ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
195 196 197 198 199 200 201 202 203 |
# File 'lib/usps_api/models/transaction_roles.rb', line 195 def inspect class_name = self.class.name.split('::').last "<#{class_name} role_name: #{@role_name.inspect}, crid: #{@crid.inspect}, mid:"\ " #{@mid.inspect}, manifest_mid: #{@manifest_mid.inspect}, account_type:"\ " #{@account_type.inspect}, account_number: #{@account_number.inspect}, permit_number:"\ " #{@permit_number.inspect}, permit_zip: #{@permit_zip.inspect}, non_profit_status:"\ " #{@non_profit_status.inspect}, sufficient_funds: #{@sufficient_funds.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
185 186 187 188 189 190 191 192 |
# File 'lib/usps_api/models/transaction_roles.rb', line 185 def to_s class_name = self.class.name.split('::').last "<#{class_name} role_name: #{@role_name}, crid: #{@crid}, mid: #{@mid}, manifest_mid:"\ " #{@manifest_mid}, account_type: #{@account_type}, account_number: #{@account_number},"\ " permit_number: #{@permit_number}, permit_zip: #{@permit_zip}, non_profit_status:"\ " #{@non_profit_status}, sufficient_funds: #{@sufficient_funds}, additional_properties:"\ " #{@additional_properties}>" end |