apimatic-tql-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +210 -0
- data/bin/console +15 -0
- data/lib/tql_otr_factoring_data_exchange/api_helper.rb +10 -0
- data/lib/tql_otr_factoring_data_exchange/apis/assignments_api.rb +45 -0
- data/lib/tql_otr_factoring_data_exchange/apis/base_api.rb +67 -0
- data/lib/tql_otr_factoring_data_exchange/apis/documents_api.rb +82 -0
- data/lib/tql_otr_factoring_data_exchange/apis/invoices_api.rb +114 -0
- data/lib/tql_otr_factoring_data_exchange/apis/loads_api.rb +68 -0
- data/lib/tql_otr_factoring_data_exchange/apis/oauth_authorization_api.rb +44 -0
- data/lib/tql_otr_factoring_data_exchange/client.rb +104 -0
- data/lib/tql_otr_factoring_data_exchange/configuration.rb +164 -0
- data/lib/tql_otr_factoring_data_exchange/exceptions/api_exception.rb +21 -0
- data/lib/tql_otr_factoring_data_exchange/exceptions/oauth_provider_exception.rb +64 -0
- data/lib/tql_otr_factoring_data_exchange/exceptions/problem_details_error_exception.rb +58 -0
- data/lib/tql_otr_factoring_data_exchange/http/api_response.rb +19 -0
- data/lib/tql_otr_factoring_data_exchange/http/auth/oauth_2.rb +156 -0
- data/lib/tql_otr_factoring_data_exchange/http/http_call_back.rb +10 -0
- data/lib/tql_otr_factoring_data_exchange/http/http_method_enum.rb +10 -0
- data/lib/tql_otr_factoring_data_exchange/http/http_request.rb +10 -0
- data/lib/tql_otr_factoring_data_exchange/http/http_response.rb +10 -0
- data/lib/tql_otr_factoring_data_exchange/http/proxy_settings.rb +22 -0
- data/lib/tql_otr_factoring_data_exchange/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/tql_otr_factoring_data_exchange/logging/sdk_logger.rb +17 -0
- data/lib/tql_otr_factoring_data_exchange/models/assignment_request.rb +140 -0
- data/lib/tql_otr_factoring_data_exchange/models/assignment_response.rb +126 -0
- data/lib/tql_otr_factoring_data_exchange/models/assignment_status.rb +36 -0
- data/lib/tql_otr_factoring_data_exchange/models/base64_document.rb +118 -0
- data/lib/tql_otr_factoring_data_exchange/models/base64_document_upload_request.rb +107 -0
- data/lib/tql_otr_factoring_data_exchange/models/base_model.rb +110 -0
- data/lib/tql_otr_factoring_data_exchange/models/carrier.rb +98 -0
- data/lib/tql_otr_factoring_data_exchange/models/carrier1.rb +98 -0
- data/lib/tql_otr_factoring_data_exchange/models/carrier2.rb +98 -0
- data/lib/tql_otr_factoring_data_exchange/models/carrier_input.rb +123 -0
- data/lib/tql_otr_factoring_data_exchange/models/carrier_input1.rb +123 -0
- data/lib/tql_otr_factoring_data_exchange/models/charge_code.rb +126 -0
- data/lib/tql_otr_factoring_data_exchange/models/charge_code_origin.rb +49 -0
- data/lib/tql_otr_factoring_data_exchange/models/charge_input.rb +146 -0
- data/lib/tql_otr_factoring_data_exchange/models/document.rb +86 -0
- data/lib/tql_otr_factoring_data_exchange/models/document_type.rb +288 -0
- data/lib/tql_otr_factoring_data_exchange/models/document_upload_metadata.rb +111 -0
- data/lib/tql_otr_factoring_data_exchange/models/document_upload_response.rb +137 -0
- data/lib/tql_otr_factoring_data_exchange/models/exception_severity.rb +40 -0
- data/lib/tql_otr_factoring_data_exchange/models/factoring_company_input.rb +117 -0
- data/lib/tql_otr_factoring_data_exchange/models/invoice.rb +223 -0
- data/lib/tql_otr_factoring_data_exchange/models/invoice_exception.rb +136 -0
- data/lib/tql_otr_factoring_data_exchange/models/invoice_item_input.rb +165 -0
- data/lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb +242 -0
- data/lib/tql_otr_factoring_data_exchange/models/invoice_search_response.rb +124 -0
- data/lib/tql_otr_factoring_data_exchange/models/invoice_status.rb +74 -0
- data/lib/tql_otr_factoring_data_exchange/models/invoice_status_response.rb +193 -0
- data/lib/tql_otr_factoring_data_exchange/models/invoice_type.rb +50 -0
- data/lib/tql_otr_factoring_data_exchange/models/load.rb +110 -0
- data/lib/tql_otr_factoring_data_exchange/models/load_detail.rb +140 -0
- data/lib/tql_otr_factoring_data_exchange/models/load_search_request.rb +205 -0
- data/lib/tql_otr_factoring_data_exchange/models/load_search_response.rb +124 -0
- data/lib/tql_otr_factoring_data_exchange/models/load_status.rb +56 -0
- data/lib/tql_otr_factoring_data_exchange/models/location.rb +149 -0
- data/lib/tql_otr_factoring_data_exchange/models/oauth_provider_error.rb +62 -0
- data/lib/tql_otr_factoring_data_exchange/models/oauth_scope.rb +36 -0
- data/lib/tql_otr_factoring_data_exchange/models/oauth_token.rb +96 -0
- data/lib/tql_otr_factoring_data_exchange/models/payment.rb +108 -0
- data/lib/tql_otr_factoring_data_exchange/models/problem_details.rb +96 -0
- data/lib/tql_otr_factoring_data_exchange/models/reference_number_input.rb +109 -0
- data/lib/tql_otr_factoring_data_exchange/models/reference_type.rb +90 -0
- data/lib/tql_otr_factoring_data_exchange/models/status.rb +44 -0
- data/lib/tql_otr_factoring_data_exchange/models/stop_input.rb +121 -0
- data/lib/tql_otr_factoring_data_exchange/models/stop_type.rb +62 -0
- data/lib/tql_otr_factoring_data_exchange/models/submit_invoice_request.rb +326 -0
- data/lib/tql_otr_factoring_data_exchange/models/submit_invoice_response.rb +107 -0
- data/lib/tql_otr_factoring_data_exchange/models/weight_unit.rb +36 -0
- data/lib/tql_otr_factoring_data_exchange/utilities/date_time_helper.rb +11 -0
- data/lib/tql_otr_factoring_data_exchange/utilities/file_wrapper.rb +28 -0
- data/lib/tql_otr_factoring_data_exchange/utilities/union_type_lookup.rb +29 -0
- data/lib/tql_otr_factoring_data_exchange.rb +107 -0
- metadata +160 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# tql_otr_factoring_data_exchange
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
require 'date'
|
|
7
|
+
module TqlOtrFactoringDataExchange
|
|
8
|
+
# An invoice object. Properties are organized into logical groups:
|
|
9
|
+
# invoice-level fields at the top, with nested `carrier`, `load`, `payment`,
|
|
10
|
+
# and `documents` objects.
|
|
11
|
+
class Invoice < BaseModel
|
|
12
|
+
SKIP = Object.new
|
|
13
|
+
private_constant :SKIP
|
|
14
|
+
|
|
15
|
+
# Direct URI to retrieve the full invoice status via GET.
|
|
16
|
+
# @return [String]
|
|
17
|
+
attr_accessor :uri
|
|
18
|
+
|
|
19
|
+
# The factoring company's invoice number.
|
|
20
|
+
# @return [String]
|
|
21
|
+
attr_accessor :invoice_number
|
|
22
|
+
|
|
23
|
+
# Name of the factoring company that submitted this invoice.
|
|
24
|
+
# @return [String]
|
|
25
|
+
attr_accessor :factoring_company_name
|
|
26
|
+
|
|
27
|
+
# Identifier of the factoring company, if provided during submission.
|
|
28
|
+
# @return [String]
|
|
29
|
+
attr_accessor :factoring_company_id
|
|
30
|
+
|
|
31
|
+
# Processing and payment status of an invoice. The lifecycle typically
|
|
32
|
+
# flows: `Received` → `Validating` → `Processing` → `Approved` → `NotPaid` →
|
|
33
|
+
# `Paid`. Branches include `AwaitingDocuments`, `PendingExceptions`, and
|
|
34
|
+
# `Rejected`.
|
|
35
|
+
# @return [InvoiceStatus]
|
|
36
|
+
attr_accessor :status
|
|
37
|
+
|
|
38
|
+
# UTC timestamp when the invoice was originally submitted.
|
|
39
|
+
# @return [DateTime]
|
|
40
|
+
attr_accessor :submitted_at
|
|
41
|
+
|
|
42
|
+
# UTC timestamp of the most recent update to this invoice.
|
|
43
|
+
# @return [DateTime]
|
|
44
|
+
attr_accessor :last_updated_at
|
|
45
|
+
|
|
46
|
+
# Whether a cargo claim has been filed against this invoice.
|
|
47
|
+
# @return [TrueClass | FalseClass]
|
|
48
|
+
attr_accessor :has_claim
|
|
49
|
+
|
|
50
|
+
# Carrier details associated with this invoice.
|
|
51
|
+
# @return [Carrier]
|
|
52
|
+
attr_accessor :carrier
|
|
53
|
+
|
|
54
|
+
# TQL load details associated with this invoice.
|
|
55
|
+
# @return [Load]
|
|
56
|
+
attr_accessor :load
|
|
57
|
+
|
|
58
|
+
# Payment and billing details for this invoice.
|
|
59
|
+
# @return [Payment]
|
|
60
|
+
attr_accessor :payment
|
|
61
|
+
|
|
62
|
+
# List of documents associated with this invoice. Each entry includes the
|
|
63
|
+
# document ID and its document type.
|
|
64
|
+
# @return [Array[Document]]
|
|
65
|
+
attr_accessor :documents
|
|
66
|
+
|
|
67
|
+
# A mapping from model property names to API property names.
|
|
68
|
+
def self.names
|
|
69
|
+
@_hash = {} if @_hash.nil?
|
|
70
|
+
@_hash['uri'] = 'uri'
|
|
71
|
+
@_hash['invoice_number'] = 'invoiceNumber'
|
|
72
|
+
@_hash['factoring_company_name'] = 'factoringCompanyName'
|
|
73
|
+
@_hash['factoring_company_id'] = 'factoringCompanyId'
|
|
74
|
+
@_hash['status'] = 'status'
|
|
75
|
+
@_hash['submitted_at'] = 'submittedAt'
|
|
76
|
+
@_hash['last_updated_at'] = 'lastUpdatedAt'
|
|
77
|
+
@_hash['has_claim'] = 'hasClaim'
|
|
78
|
+
@_hash['carrier'] = 'carrier'
|
|
79
|
+
@_hash['load'] = 'load'
|
|
80
|
+
@_hash['payment'] = 'payment'
|
|
81
|
+
@_hash['documents'] = 'documents'
|
|
82
|
+
@_hash
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# An array for optional fields
|
|
86
|
+
def self.optionals
|
|
87
|
+
%w[
|
|
88
|
+
uri
|
|
89
|
+
invoice_number
|
|
90
|
+
factoring_company_name
|
|
91
|
+
factoring_company_id
|
|
92
|
+
status
|
|
93
|
+
submitted_at
|
|
94
|
+
last_updated_at
|
|
95
|
+
has_claim
|
|
96
|
+
carrier
|
|
97
|
+
load
|
|
98
|
+
payment
|
|
99
|
+
documents
|
|
100
|
+
]
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# An array for nullable fields
|
|
104
|
+
def self.nullables
|
|
105
|
+
%w[
|
|
106
|
+
factoring_company_id
|
|
107
|
+
]
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
def initialize(uri: SKIP, invoice_number: SKIP,
|
|
111
|
+
factoring_company_name: SKIP, factoring_company_id: SKIP,
|
|
112
|
+
status: SKIP, submitted_at: SKIP, last_updated_at: SKIP,
|
|
113
|
+
has_claim: SKIP, carrier: SKIP, load: SKIP, payment: SKIP,
|
|
114
|
+
documents: SKIP, additional_properties: nil)
|
|
115
|
+
# Add additional model properties to the instance
|
|
116
|
+
additional_properties = {} if additional_properties.nil?
|
|
117
|
+
|
|
118
|
+
@uri = uri unless uri == SKIP
|
|
119
|
+
@invoice_number = invoice_number unless invoice_number == SKIP
|
|
120
|
+
@factoring_company_name = factoring_company_name unless factoring_company_name == SKIP
|
|
121
|
+
@factoring_company_id = factoring_company_id unless factoring_company_id == SKIP
|
|
122
|
+
@status = status unless status == SKIP
|
|
123
|
+
@submitted_at = submitted_at unless submitted_at == SKIP
|
|
124
|
+
@last_updated_at = last_updated_at unless last_updated_at == SKIP
|
|
125
|
+
@has_claim = has_claim unless has_claim == SKIP
|
|
126
|
+
@carrier = carrier unless carrier == SKIP
|
|
127
|
+
@load = load unless load == SKIP
|
|
128
|
+
@payment = payment unless payment == SKIP
|
|
129
|
+
@documents = documents unless documents == SKIP
|
|
130
|
+
@additional_properties = additional_properties
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Creates an instance of the object from a hash.
|
|
134
|
+
def self.from_hash(hash)
|
|
135
|
+
return nil unless hash
|
|
136
|
+
|
|
137
|
+
# Extract variables from the hash.
|
|
138
|
+
uri = hash.key?('uri') ? hash['uri'] : SKIP
|
|
139
|
+
invoice_number = hash.key?('invoiceNumber') ? hash['invoiceNumber'] : SKIP
|
|
140
|
+
factoring_company_name =
|
|
141
|
+
hash.key?('factoringCompanyName') ? hash['factoringCompanyName'] : SKIP
|
|
142
|
+
factoring_company_id =
|
|
143
|
+
hash.key?('factoringCompanyId') ? hash['factoringCompanyId'] : SKIP
|
|
144
|
+
status = hash.key?('status') ? hash['status'] : SKIP
|
|
145
|
+
submitted_at = if hash.key?('submittedAt')
|
|
146
|
+
(DateTimeHelper.from_rfc3339(hash['submittedAt']) if hash['submittedAt'])
|
|
147
|
+
else
|
|
148
|
+
SKIP
|
|
149
|
+
end
|
|
150
|
+
last_updated_at = if hash.key?('lastUpdatedAt')
|
|
151
|
+
(DateTimeHelper.from_rfc3339(hash['lastUpdatedAt']) if hash['lastUpdatedAt'])
|
|
152
|
+
else
|
|
153
|
+
SKIP
|
|
154
|
+
end
|
|
155
|
+
has_claim = hash.key?('hasClaim') ? hash['hasClaim'] : SKIP
|
|
156
|
+
carrier = Carrier.from_hash(hash['carrier']) if hash['carrier']
|
|
157
|
+
load = Load.from_hash(hash['load']) if hash['load']
|
|
158
|
+
payment = Payment.from_hash(hash['payment']) if hash['payment']
|
|
159
|
+
# Parameter is an array, so we need to iterate through it
|
|
160
|
+
documents = nil
|
|
161
|
+
unless hash['documents'].nil?
|
|
162
|
+
documents = []
|
|
163
|
+
hash['documents'].each do |structure|
|
|
164
|
+
documents << (Document.from_hash(structure) if structure)
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
documents = SKIP unless hash.key?('documents')
|
|
169
|
+
|
|
170
|
+
# Create a new hash for additional properties, removing known properties.
|
|
171
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
172
|
+
|
|
173
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
174
|
+
new_hash, proc { |value| value }
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
# Create object from extracted values.
|
|
178
|
+
Invoice.new(uri: uri,
|
|
179
|
+
invoice_number: invoice_number,
|
|
180
|
+
factoring_company_name: factoring_company_name,
|
|
181
|
+
factoring_company_id: factoring_company_id,
|
|
182
|
+
status: status,
|
|
183
|
+
submitted_at: submitted_at,
|
|
184
|
+
last_updated_at: last_updated_at,
|
|
185
|
+
has_claim: has_claim,
|
|
186
|
+
carrier: carrier,
|
|
187
|
+
load: load,
|
|
188
|
+
payment: payment,
|
|
189
|
+
documents: documents,
|
|
190
|
+
additional_properties: additional_properties)
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
def to_custom_submitted_at
|
|
194
|
+
DateTimeHelper.to_rfc3339(submitted_at)
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
def to_custom_last_updated_at
|
|
198
|
+
DateTimeHelper.to_rfc3339(last_updated_at)
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Provides a human-readable string representation of the object.
|
|
202
|
+
def to_s
|
|
203
|
+
class_name = self.class.name.split('::').last
|
|
204
|
+
"<#{class_name} uri: #{@uri}, invoice_number: #{@invoice_number}, factoring_company_name:"\
|
|
205
|
+
" #{@factoring_company_name}, factoring_company_id: #{@factoring_company_id}, status:"\
|
|
206
|
+
" #{@status}, submitted_at: #{@submitted_at}, last_updated_at: #{@last_updated_at},"\
|
|
207
|
+
" has_claim: #{@has_claim}, carrier: #{@carrier}, load: #{@load}, payment: #{@payment},"\
|
|
208
|
+
" documents: #{@documents}, additional_properties: #{@additional_properties}>"
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
212
|
+
def inspect
|
|
213
|
+
class_name = self.class.name.split('::').last
|
|
214
|
+
"<#{class_name} uri: #{@uri.inspect}, invoice_number: #{@invoice_number.inspect},"\
|
|
215
|
+
" factoring_company_name: #{@factoring_company_name.inspect}, factoring_company_id:"\
|
|
216
|
+
" #{@factoring_company_id.inspect}, status: #{@status.inspect}, submitted_at:"\
|
|
217
|
+
" #{@submitted_at.inspect}, last_updated_at: #{@last_updated_at.inspect}, has_claim:"\
|
|
218
|
+
" #{@has_claim.inspect}, carrier: #{@carrier.inspect}, load: #{@load.inspect}, payment:"\
|
|
219
|
+
" #{@payment.inspect}, documents: #{@documents.inspect}, additional_properties:"\
|
|
220
|
+
" #{@additional_properties}>"
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
end
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# tql_otr_factoring_data_exchange
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
require 'date'
|
|
7
|
+
module TqlOtrFactoringDataExchange
|
|
8
|
+
# A processing exception or discrepancy found during invoice validation.
|
|
9
|
+
class InvoiceException < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# Unique identifier for this exception.
|
|
14
|
+
# @return [UUID | String]
|
|
15
|
+
attr_accessor :exception_id
|
|
16
|
+
|
|
17
|
+
# Machine-readable exception code.
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :code
|
|
20
|
+
|
|
21
|
+
# Severity level of a processing exception.
|
|
22
|
+
# @return [ExceptionSeverity]
|
|
23
|
+
attr_accessor :severity
|
|
24
|
+
|
|
25
|
+
# Human-readable description of the exception.
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :message
|
|
28
|
+
|
|
29
|
+
# The field or area that triggered the exception, if applicable.
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :field
|
|
32
|
+
|
|
33
|
+
# When the exception was identified.
|
|
34
|
+
# @return [DateTime]
|
|
35
|
+
attr_accessor :created_at
|
|
36
|
+
|
|
37
|
+
# A mapping from model property names to API property names.
|
|
38
|
+
def self.names
|
|
39
|
+
@_hash = {} if @_hash.nil?
|
|
40
|
+
@_hash['exception_id'] = 'exceptionId'
|
|
41
|
+
@_hash['code'] = 'code'
|
|
42
|
+
@_hash['severity'] = 'severity'
|
|
43
|
+
@_hash['message'] = 'message'
|
|
44
|
+
@_hash['field'] = 'field'
|
|
45
|
+
@_hash['created_at'] = 'createdAt'
|
|
46
|
+
@_hash
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# An array for optional fields
|
|
50
|
+
def self.optionals
|
|
51
|
+
%w[
|
|
52
|
+
exception_id
|
|
53
|
+
code
|
|
54
|
+
severity
|
|
55
|
+
message
|
|
56
|
+
field
|
|
57
|
+
created_at
|
|
58
|
+
]
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# An array for nullable fields
|
|
62
|
+
def self.nullables
|
|
63
|
+
%w[
|
|
64
|
+
field
|
|
65
|
+
]
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def initialize(exception_id: SKIP, code: SKIP, severity: SKIP,
|
|
69
|
+
message: SKIP, field: SKIP, created_at: SKIP,
|
|
70
|
+
additional_properties: nil)
|
|
71
|
+
# Add additional model properties to the instance
|
|
72
|
+
additional_properties = {} if additional_properties.nil?
|
|
73
|
+
|
|
74
|
+
@exception_id = exception_id unless exception_id == SKIP
|
|
75
|
+
@code = code unless code == SKIP
|
|
76
|
+
@severity = severity unless severity == SKIP
|
|
77
|
+
@message = message unless message == SKIP
|
|
78
|
+
@field = field unless field == SKIP
|
|
79
|
+
@created_at = created_at unless created_at == SKIP
|
|
80
|
+
@additional_properties = additional_properties
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Creates an instance of the object from a hash.
|
|
84
|
+
def self.from_hash(hash)
|
|
85
|
+
return nil unless hash
|
|
86
|
+
|
|
87
|
+
# Extract variables from the hash.
|
|
88
|
+
exception_id = hash.key?('exceptionId') ? hash['exceptionId'] : SKIP
|
|
89
|
+
code = hash.key?('code') ? hash['code'] : SKIP
|
|
90
|
+
severity = hash.key?('severity') ? hash['severity'] : SKIP
|
|
91
|
+
message = hash.key?('message') ? hash['message'] : SKIP
|
|
92
|
+
field = hash.key?('field') ? hash['field'] : SKIP
|
|
93
|
+
created_at = if hash.key?('createdAt')
|
|
94
|
+
(DateTimeHelper.from_rfc3339(hash['createdAt']) if hash['createdAt'])
|
|
95
|
+
else
|
|
96
|
+
SKIP
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Create a new hash for additional properties, removing known properties.
|
|
100
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
101
|
+
|
|
102
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
103
|
+
new_hash, proc { |value| value }
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
# Create object from extracted values.
|
|
107
|
+
InvoiceException.new(exception_id: exception_id,
|
|
108
|
+
code: code,
|
|
109
|
+
severity: severity,
|
|
110
|
+
message: message,
|
|
111
|
+
field: field,
|
|
112
|
+
created_at: created_at,
|
|
113
|
+
additional_properties: additional_properties)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def to_custom_created_at
|
|
117
|
+
DateTimeHelper.to_rfc3339(created_at)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Provides a human-readable string representation of the object.
|
|
121
|
+
def to_s
|
|
122
|
+
class_name = self.class.name.split('::').last
|
|
123
|
+
"<#{class_name} exception_id: #{@exception_id}, code: #{@code}, severity: #{@severity},"\
|
|
124
|
+
" message: #{@message}, field: #{@field}, created_at: #{@created_at}, additional_properties:"\
|
|
125
|
+
" #{@additional_properties}>"
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
129
|
+
def inspect
|
|
130
|
+
class_name = self.class.name.split('::').last
|
|
131
|
+
"<#{class_name} exception_id: #{@exception_id.inspect}, code: #{@code.inspect}, severity:"\
|
|
132
|
+
" #{@severity.inspect}, message: #{@message.inspect}, field: #{@field.inspect}, created_at:"\
|
|
133
|
+
" #{@created_at.inspect}, additional_properties: #{@additional_properties}>"
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
end
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# tql_otr_factoring_data_exchange
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module TqlOtrFactoringDataExchange
|
|
7
|
+
# A physical line item on the invoice describing a commodity or handling unit
|
|
8
|
+
# being shipped. Items represent the freight itself — what was physically
|
|
9
|
+
# moved — as opposed to charges, which represent the monetary billing.
|
|
10
|
+
# Including item details enables freight audit and rate verification.
|
|
11
|
+
class InvoiceItemInput < BaseModel
|
|
12
|
+
SKIP = Object.new
|
|
13
|
+
private_constant :SKIP
|
|
14
|
+
|
|
15
|
+
# Caller-assigned identifier for this item. Referenced by
|
|
16
|
+
# `ChargeInput.itemId` to link a charge to a specific item.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :item_id
|
|
19
|
+
|
|
20
|
+
# Free-text description of the commodity or goods.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :description
|
|
23
|
+
|
|
24
|
+
# Type of handling unit. Common values: Pallet, Drum, Bag, Barrels, Crates,
|
|
25
|
+
# Bundles, Pieces, Loose, Boxes, Cases, Carton, Totes.
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :handling_unit
|
|
28
|
+
|
|
29
|
+
# Number of handling units for this line item.
|
|
30
|
+
# @return [Integer]
|
|
31
|
+
attr_accessor :handling_unit_count
|
|
32
|
+
|
|
33
|
+
# Weight of this line item.
|
|
34
|
+
# @return [Float]
|
|
35
|
+
attr_accessor :weight
|
|
36
|
+
|
|
37
|
+
# Unit of measure for `weight`. Typically LBS or KG.
|
|
38
|
+
# @return [WeightUnit]
|
|
39
|
+
attr_accessor :weight_unit
|
|
40
|
+
|
|
41
|
+
# NMFC freight class (e.g., 50, 55, 60, 65, 70, 77.5, 85, 92.5, 100, 110,
|
|
42
|
+
# 125, 150, 175, 200, 250, 300, 400, 500). Used for LTL rating and audit.
|
|
43
|
+
# @return [Float]
|
|
44
|
+
attr_accessor :freight_class
|
|
45
|
+
|
|
46
|
+
# A mapping from model property names to API property names.
|
|
47
|
+
def self.names
|
|
48
|
+
@_hash = {} if @_hash.nil?
|
|
49
|
+
@_hash['item_id'] = 'itemId'
|
|
50
|
+
@_hash['description'] = 'description'
|
|
51
|
+
@_hash['handling_unit'] = 'handlingUnit'
|
|
52
|
+
@_hash['handling_unit_count'] = 'handlingUnitCount'
|
|
53
|
+
@_hash['weight'] = 'weight'
|
|
54
|
+
@_hash['weight_unit'] = 'weightUnit'
|
|
55
|
+
@_hash['freight_class'] = 'freightClass'
|
|
56
|
+
@_hash
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# An array for optional fields
|
|
60
|
+
def self.optionals
|
|
61
|
+
%w[
|
|
62
|
+
description
|
|
63
|
+
handling_unit
|
|
64
|
+
handling_unit_count
|
|
65
|
+
weight
|
|
66
|
+
weight_unit
|
|
67
|
+
freight_class
|
|
68
|
+
]
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# An array for nullable fields
|
|
72
|
+
def self.nullables
|
|
73
|
+
%w[
|
|
74
|
+
description
|
|
75
|
+
handling_unit
|
|
76
|
+
handling_unit_count
|
|
77
|
+
weight
|
|
78
|
+
weight_unit
|
|
79
|
+
freight_class
|
|
80
|
+
]
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def initialize(item_id:, description: SKIP, handling_unit: SKIP,
|
|
84
|
+
handling_unit_count: SKIP, weight: SKIP,
|
|
85
|
+
weight_unit: WeightUnit::LBS, freight_class: SKIP,
|
|
86
|
+
additional_properties: nil)
|
|
87
|
+
# Add additional model properties to the instance
|
|
88
|
+
additional_properties = {} if additional_properties.nil?
|
|
89
|
+
|
|
90
|
+
@item_id = item_id
|
|
91
|
+
@description = description unless description == SKIP
|
|
92
|
+
@handling_unit = handling_unit unless handling_unit == SKIP
|
|
93
|
+
@handling_unit_count = handling_unit_count unless handling_unit_count == SKIP
|
|
94
|
+
@weight = weight unless weight == SKIP
|
|
95
|
+
@weight_unit = weight_unit unless weight_unit == SKIP
|
|
96
|
+
@freight_class = freight_class unless freight_class == SKIP
|
|
97
|
+
@additional_properties = additional_properties
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Creates an instance of the object from a hash.
|
|
101
|
+
def self.from_hash(hash)
|
|
102
|
+
return nil unless hash
|
|
103
|
+
|
|
104
|
+
# Extract variables from the hash.
|
|
105
|
+
item_id = hash.key?('itemId') ? hash['itemId'] : nil
|
|
106
|
+
description = hash.key?('description') ? hash['description'] : SKIP
|
|
107
|
+
handling_unit = hash.key?('handlingUnit') ? hash['handlingUnit'] : SKIP
|
|
108
|
+
handling_unit_count =
|
|
109
|
+
hash.key?('handlingUnitCount') ? hash['handlingUnitCount'] : SKIP
|
|
110
|
+
weight = hash.key?('weight') ? hash['weight'] : SKIP
|
|
111
|
+
weight_unit = hash['weightUnit'] ||= WeightUnit::LBS
|
|
112
|
+
freight_class = hash.key?('freightClass') ? hash['freightClass'] : SKIP
|
|
113
|
+
|
|
114
|
+
# Create a new hash for additional properties, removing known properties.
|
|
115
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
116
|
+
|
|
117
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
118
|
+
new_hash, proc { |value| value }
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
# Create object from extracted values.
|
|
122
|
+
InvoiceItemInput.new(item_id: item_id,
|
|
123
|
+
description: description,
|
|
124
|
+
handling_unit: handling_unit,
|
|
125
|
+
handling_unit_count: handling_unit_count,
|
|
126
|
+
weight: weight,
|
|
127
|
+
weight_unit: weight_unit,
|
|
128
|
+
freight_class: freight_class,
|
|
129
|
+
additional_properties: additional_properties)
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Validates an instance of the object from a given value.
|
|
133
|
+
# @param [InvoiceItemInput | Hash] The value against the validation is performed.
|
|
134
|
+
def self.validate(value)
|
|
135
|
+
if value.instance_of? self
|
|
136
|
+
return APIHelper.valid_type?(value.item_id,
|
|
137
|
+
->(val) { val.instance_of? String })
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
return false unless value.instance_of? Hash
|
|
141
|
+
|
|
142
|
+
APIHelper.valid_type?(value['itemId'],
|
|
143
|
+
->(val) { val.instance_of? String })
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Provides a human-readable string representation of the object.
|
|
147
|
+
def to_s
|
|
148
|
+
class_name = self.class.name.split('::').last
|
|
149
|
+
"<#{class_name} item_id: #{@item_id}, description: #{@description}, handling_unit:"\
|
|
150
|
+
" #{@handling_unit}, handling_unit_count: #{@handling_unit_count}, weight: #{@weight},"\
|
|
151
|
+
" weight_unit: #{@weight_unit}, freight_class: #{@freight_class}, additional_properties:"\
|
|
152
|
+
" #{@additional_properties}>"
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
156
|
+
def inspect
|
|
157
|
+
class_name = self.class.name.split('::').last
|
|
158
|
+
"<#{class_name} item_id: #{@item_id.inspect}, description: #{@description.inspect},"\
|
|
159
|
+
" handling_unit: #{@handling_unit.inspect}, handling_unit_count:"\
|
|
160
|
+
" #{@handling_unit_count.inspect}, weight: #{@weight.inspect}, weight_unit:"\
|
|
161
|
+
" #{@weight_unit.inspect}, freight_class: #{@freight_class.inspect}, additional_properties:"\
|
|
162
|
+
" #{@additional_properties}>"
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
end
|