apimatic-tql-sdk 0.0.1 → 0.0.2

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.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +148 -197
  3. data/bin/console +4 -4
  4. data/lib/freight_financials_webhook_ingestion_api/api_helper.rb +10 -0
  5. data/lib/freight_financials_webhook_ingestion_api/apis/assignments_api.rb +41 -0
  6. data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/apis/base_api.rb +60 -60
  7. data/lib/freight_financials_webhook_ingestion_api/apis/documents_api.rb +73 -0
  8. data/lib/freight_financials_webhook_ingestion_api/apis/freight_audit_api.rb +54 -0
  9. data/lib/freight_financials_webhook_ingestion_api/apis/invoices_api.rb +107 -0
  10. data/lib/freight_financials_webhook_ingestion_api/apis/loads_api.rb +72 -0
  11. data/lib/freight_financials_webhook_ingestion_api/apis/rating_api.rb +45 -0
  12. data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/client.rb +83 -97
  13. data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/configuration.rb +114 -126
  14. data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/exceptions/api_exception.rb +21 -21
  15. data/lib/{tql_otr_factoring_data_exchange/exceptions/problem_details_error_exception.rb → freight_financials_webhook_ingestion_api/exceptions/problem_details_exception.rb} +51 -41
  16. data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/http/api_response.rb +7 -7
  17. data/lib/freight_financials_webhook_ingestion_api/http/http_call_back.rb +10 -0
  18. data/lib/freight_financials_webhook_ingestion_api/http/http_method_enum.rb +10 -0
  19. data/lib/freight_financials_webhook_ingestion_api/http/http_request.rb +10 -0
  20. data/lib/freight_financials_webhook_ingestion_api/http/http_response.rb +10 -0
  21. data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/http/proxy_settings.rb +6 -6
  22. data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/logging/configuration/api_logging_configuration.rb +6 -6
  23. data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/logging/sdk_logger.rb +6 -6
  24. data/lib/freight_financials_webhook_ingestion_api/models/address.rb +123 -0
  25. data/lib/freight_financials_webhook_ingestion_api/models/assignment_request.rb +94 -0
  26. data/lib/freight_financials_webhook_ingestion_api/models/assignment_response.rb +83 -0
  27. data/lib/{tql_otr_factoring_data_exchange/models/assignment_response.rb → freight_financials_webhook_ingestion_api/models/assignment_response_data.rb} +124 -126
  28. data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/models/base_model.rb +110 -110
  29. data/lib/{tql_otr_factoring_data_exchange/models/carrier1.rb → freight_financials_webhook_ingestion_api/models/carrier.rb} +96 -98
  30. data/lib/freight_financials_webhook_ingestion_api/models/charge.rb +104 -0
  31. data/lib/freight_financials_webhook_ingestion_api/models/charge_code.rb +81 -0
  32. data/lib/freight_financials_webhook_ingestion_api/models/factoring_company.rb +81 -0
  33. data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/models/invoice.rb +204 -223
  34. data/lib/{tql_otr_factoring_data_exchange/models/document.rb → freight_financials_webhook_ingestion_api/models/invoice_document.rb} +72 -86
  35. data/lib/{tql_otr_factoring_data_exchange/models/invoice_exception.rb → freight_financials_webhook_ingestion_api/models/invoice_issue.rb} +122 -136
  36. data/lib/freight_financials_webhook_ingestion_api/models/invoice_status_response.rb +83 -0
  37. data/lib/{tql_otr_factoring_data_exchange/models/invoice_status_response.rb → freight_financials_webhook_ingestion_api/models/invoice_status_response_data.rb} +185 -193
  38. data/lib/freight_financials_webhook_ingestion_api/models/line_item.rb +131 -0
  39. data/lib/freight_financials_webhook_ingestion_api/models/load_response.rb +83 -0
  40. data/lib/{tql_otr_factoring_data_exchange/models/load_detail.rb → freight_financials_webhook_ingestion_api/models/load_response_data.rb} +141 -140
  41. data/lib/{tql_otr_factoring_data_exchange/models/load.rb → freight_financials_webhook_ingestion_api/models/load_slim.rb} +97 -110
  42. data/lib/freight_financials_webhook_ingestion_api/models/navix_rate_charge.rb +116 -0
  43. data/lib/freight_financials_webhook_ingestion_api/models/navix_rate_customer.rb +64 -0
  44. data/lib/freight_financials_webhook_ingestion_api/models/navix_rate_line_item.rb +177 -0
  45. data/lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb +208 -0
  46. data/lib/freight_financials_webhook_ingestion_api/models/navix_rate_requested_charge.rb +64 -0
  47. data/lib/freight_financials_webhook_ingestion_api/models/navix_rate_response.rb +112 -0
  48. data/lib/freight_financials_webhook_ingestion_api/models/navix_rate_stop.rb +107 -0
  49. data/lib/freight_financials_webhook_ingestion_api/models/navix_rate_vendor.rb +88 -0
  50. data/lib/freight_financials_webhook_ingestion_api/models/navix_webhook_event_type.rb +56 -0
  51. data/lib/freight_financials_webhook_ingestion_api/models/navix_webhook_request.rb +99 -0
  52. data/lib/freight_financials_webhook_ingestion_api/models/paged_response_of_invoice.rb +111 -0
  53. data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/models/payment.rb +94 -108
  54. data/lib/freight_financials_webhook_ingestion_api/models/rating_charge_qualifier.rb +68 -0
  55. data/lib/freight_financials_webhook_ingestion_api/models/rating_response_format.rb +40 -0
  56. data/lib/freight_financials_webhook_ingestion_api/models/reference_number.rb +71 -0
  57. data/lib/{tql_otr_factoring_data_exchange/models/invoice_search_request.rb → freight_financials_webhook_ingestion_api/models/search_request.rb} +223 -242
  58. data/lib/freight_financials_webhook_ingestion_api/models/search_response.rb +83 -0
  59. data/lib/freight_financials_webhook_ingestion_api/models/stop.rb +81 -0
  60. data/lib/freight_financials_webhook_ingestion_api/models/submit_invoice_request.rb +228 -0
  61. data/lib/freight_financials_webhook_ingestion_api/models/submit_invoice_response.rb +83 -0
  62. data/lib/{tql_otr_factoring_data_exchange/models/submit_invoice_response.rb → freight_financials_webhook_ingestion_api/models/submit_invoice_response_data.rb} +105 -107
  63. data/lib/freight_financials_webhook_ingestion_api/models/upload_request.rb +128 -0
  64. data/lib/freight_financials_webhook_ingestion_api/models/upload_response.rb +83 -0
  65. data/lib/{tql_otr_factoring_data_exchange/models/document_upload_response.rb → freight_financials_webhook_ingestion_api/models/upload_response_data.rb} +117 -137
  66. data/lib/freight_financials_webhook_ingestion_api/utilities/date_time_helper.rb +11 -0
  67. data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/utilities/file_wrapper.rb +17 -17
  68. data/lib/freight_financials_webhook_ingestion_api.rb +127 -0
  69. metadata +67 -74
  70. data/lib/tql_otr_factoring_data_exchange/api_helper.rb +0 -10
  71. data/lib/tql_otr_factoring_data_exchange/apis/assignments_api.rb +0 -45
  72. data/lib/tql_otr_factoring_data_exchange/apis/documents_api.rb +0 -82
  73. data/lib/tql_otr_factoring_data_exchange/apis/invoices_api.rb +0 -114
  74. data/lib/tql_otr_factoring_data_exchange/apis/loads_api.rb +0 -68
  75. data/lib/tql_otr_factoring_data_exchange/apis/oauth_authorization_api.rb +0 -44
  76. data/lib/tql_otr_factoring_data_exchange/exceptions/oauth_provider_exception.rb +0 -64
  77. data/lib/tql_otr_factoring_data_exchange/http/auth/oauth_2.rb +0 -156
  78. data/lib/tql_otr_factoring_data_exchange/http/http_call_back.rb +0 -10
  79. data/lib/tql_otr_factoring_data_exchange/http/http_method_enum.rb +0 -10
  80. data/lib/tql_otr_factoring_data_exchange/http/http_request.rb +0 -10
  81. data/lib/tql_otr_factoring_data_exchange/http/http_response.rb +0 -10
  82. data/lib/tql_otr_factoring_data_exchange/models/assignment_request.rb +0 -140
  83. data/lib/tql_otr_factoring_data_exchange/models/assignment_status.rb +0 -36
  84. data/lib/tql_otr_factoring_data_exchange/models/base64_document.rb +0 -118
  85. data/lib/tql_otr_factoring_data_exchange/models/base64_document_upload_request.rb +0 -107
  86. data/lib/tql_otr_factoring_data_exchange/models/carrier.rb +0 -98
  87. data/lib/tql_otr_factoring_data_exchange/models/carrier2.rb +0 -98
  88. data/lib/tql_otr_factoring_data_exchange/models/carrier_input.rb +0 -123
  89. data/lib/tql_otr_factoring_data_exchange/models/carrier_input1.rb +0 -123
  90. data/lib/tql_otr_factoring_data_exchange/models/charge_code.rb +0 -126
  91. data/lib/tql_otr_factoring_data_exchange/models/charge_code_origin.rb +0 -49
  92. data/lib/tql_otr_factoring_data_exchange/models/charge_input.rb +0 -146
  93. data/lib/tql_otr_factoring_data_exchange/models/document_type.rb +0 -288
  94. data/lib/tql_otr_factoring_data_exchange/models/document_upload_metadata.rb +0 -111
  95. data/lib/tql_otr_factoring_data_exchange/models/exception_severity.rb +0 -40
  96. data/lib/tql_otr_factoring_data_exchange/models/factoring_company_input.rb +0 -117
  97. data/lib/tql_otr_factoring_data_exchange/models/invoice_item_input.rb +0 -165
  98. data/lib/tql_otr_factoring_data_exchange/models/invoice_search_response.rb +0 -124
  99. data/lib/tql_otr_factoring_data_exchange/models/invoice_status.rb +0 -74
  100. data/lib/tql_otr_factoring_data_exchange/models/invoice_type.rb +0 -50
  101. data/lib/tql_otr_factoring_data_exchange/models/load_search_request.rb +0 -205
  102. data/lib/tql_otr_factoring_data_exchange/models/load_search_response.rb +0 -124
  103. data/lib/tql_otr_factoring_data_exchange/models/load_status.rb +0 -56
  104. data/lib/tql_otr_factoring_data_exchange/models/location.rb +0 -149
  105. data/lib/tql_otr_factoring_data_exchange/models/oauth_provider_error.rb +0 -62
  106. data/lib/tql_otr_factoring_data_exchange/models/oauth_scope.rb +0 -36
  107. data/lib/tql_otr_factoring_data_exchange/models/oauth_token.rb +0 -96
  108. data/lib/tql_otr_factoring_data_exchange/models/problem_details.rb +0 -96
  109. data/lib/tql_otr_factoring_data_exchange/models/reference_number_input.rb +0 -109
  110. data/lib/tql_otr_factoring_data_exchange/models/reference_type.rb +0 -90
  111. data/lib/tql_otr_factoring_data_exchange/models/status.rb +0 -44
  112. data/lib/tql_otr_factoring_data_exchange/models/stop_input.rb +0 -121
  113. data/lib/tql_otr_factoring_data_exchange/models/stop_type.rb +0 -62
  114. data/lib/tql_otr_factoring_data_exchange/models/submit_invoice_request.rb +0 -326
  115. data/lib/tql_otr_factoring_data_exchange/models/weight_unit.rb +0 -36
  116. data/lib/tql_otr_factoring_data_exchange/utilities/date_time_helper.rb +0 -11
  117. data/lib/tql_otr_factoring_data_exchange/utilities/union_type_lookup.rb +0 -29
  118. data/lib/tql_otr_factoring_data_exchange.rb +0 -107
@@ -1,223 +1,204 @@
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
1
+ # freight_financials_webhook_ingestion_api
2
+ #
3
+ # This file was automatically
4
+ # generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module FreightFinancialsWebhookIngestionApi
8
+ # Invoice Model.
9
+ class Invoice < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [Carrier]
15
+ attr_accessor :carrier
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [Array[InvoiceDocument]]
19
+ attr_accessor :documents
20
+
21
+ # TODO: Write general description for this method
22
+ # @return [String]
23
+ attr_accessor :factoring_company_id
24
+
25
+ # TODO: Write general description for this method
26
+ # @return [String]
27
+ attr_accessor :factoring_company_name
28
+
29
+ # TODO: Write general description for this method
30
+ # @return [TrueClass | FalseClass]
31
+ attr_accessor :has_claim
32
+
33
+ # TODO: Write general description for this method
34
+ # @return [String]
35
+ attr_accessor :invoice_number
36
+
37
+ # TODO: Write general description for this method
38
+ # @return [DateTime]
39
+ attr_accessor :last_updated_at
40
+
41
+ # TODO: Write general description for this method
42
+ # @return [LoadSlim]
43
+ attr_accessor :load
44
+
45
+ # TODO: Write general description for this method
46
+ # @return [Payment]
47
+ attr_accessor :payment
48
+
49
+ # TODO: Write general description for this method
50
+ # @return [Integer]
51
+ attr_accessor :status
52
+
53
+ # TODO: Write general description for this method
54
+ # @return [DateTime]
55
+ attr_accessor :submitted_at
56
+
57
+ # TODO: Write general description for this method
58
+ # @return [String]
59
+ attr_accessor :uri
60
+
61
+ # A mapping from model property names to API property names.
62
+ def self.names
63
+ @_hash = {} if @_hash.nil?
64
+ @_hash['carrier'] = 'carrier'
65
+ @_hash['documents'] = 'documents'
66
+ @_hash['factoring_company_id'] = 'factoringCompanyId'
67
+ @_hash['factoring_company_name'] = 'factoringCompanyName'
68
+ @_hash['has_claim'] = 'hasClaim'
69
+ @_hash['invoice_number'] = 'invoiceNumber'
70
+ @_hash['last_updated_at'] = 'lastUpdatedAt'
71
+ @_hash['load'] = 'load'
72
+ @_hash['payment'] = 'payment'
73
+ @_hash['status'] = 'status'
74
+ @_hash['submitted_at'] = 'submittedAt'
75
+ @_hash['uri'] = 'uri'
76
+ @_hash
77
+ end
78
+
79
+ # An array for optional fields
80
+ def self.optionals
81
+ %w[
82
+ carrier
83
+ documents
84
+ factoring_company_id
85
+ factoring_company_name
86
+ has_claim
87
+ invoice_number
88
+ last_updated_at
89
+ load
90
+ payment
91
+ status
92
+ submitted_at
93
+ uri
94
+ ]
95
+ end
96
+
97
+ # An array for nullable fields
98
+ def self.nullables
99
+ %w[
100
+ factoring_company_id
101
+ uri
102
+ ]
103
+ end
104
+
105
+ def initialize(carrier: SKIP, documents: SKIP, factoring_company_id: SKIP,
106
+ factoring_company_name: SKIP, has_claim: SKIP,
107
+ invoice_number: SKIP, last_updated_at: SKIP, load: SKIP,
108
+ payment: SKIP, status: SKIP, submitted_at: SKIP, uri: SKIP)
109
+ @carrier = carrier unless carrier == SKIP
110
+ @documents = documents unless documents == SKIP
111
+ @factoring_company_id = factoring_company_id unless factoring_company_id == SKIP
112
+ @factoring_company_name = factoring_company_name unless factoring_company_name == SKIP
113
+ @has_claim = has_claim unless has_claim == SKIP
114
+ @invoice_number = invoice_number unless invoice_number == SKIP
115
+ @last_updated_at = last_updated_at unless last_updated_at == SKIP
116
+ @load = load unless load == SKIP
117
+ @payment = payment unless payment == SKIP
118
+ @status = status unless status == SKIP
119
+ @submitted_at = submitted_at unless submitted_at == SKIP
120
+ @uri = uri unless uri == SKIP
121
+ end
122
+
123
+ # Creates an instance of the object from a hash.
124
+ def self.from_hash(hash)
125
+ return nil unless hash
126
+
127
+ # Extract variables from the hash.
128
+ carrier = Carrier.from_hash(hash['carrier']) if hash['carrier']
129
+ # Parameter is an array, so we need to iterate through it
130
+ documents = nil
131
+ unless hash['documents'].nil?
132
+ documents = []
133
+ hash['documents'].each do |structure|
134
+ documents << (InvoiceDocument.from_hash(structure) if structure)
135
+ end
136
+ end
137
+
138
+ documents = SKIP unless hash.key?('documents')
139
+ factoring_company_id =
140
+ hash.key?('factoringCompanyId') ? hash['factoringCompanyId'] : SKIP
141
+ factoring_company_name =
142
+ hash.key?('factoringCompanyName') ? hash['factoringCompanyName'] : SKIP
143
+ has_claim = hash.key?('hasClaim') ? hash['hasClaim'] : SKIP
144
+ invoice_number = hash.key?('invoiceNumber') ? hash['invoiceNumber'] : SKIP
145
+ last_updated_at = if hash.key?('lastUpdatedAt')
146
+ (DateTimeHelper.from_rfc3339(hash['lastUpdatedAt']) if hash['lastUpdatedAt'])
147
+ else
148
+ SKIP
149
+ end
150
+ load = LoadSlim.from_hash(hash['load']) if hash['load']
151
+ payment = Payment.from_hash(hash['payment']) if hash['payment']
152
+ status = hash.key?('status') ? hash['status'] : SKIP
153
+ submitted_at = if hash.key?('submittedAt')
154
+ (DateTimeHelper.from_rfc3339(hash['submittedAt']) if hash['submittedAt'])
155
+ else
156
+ SKIP
157
+ end
158
+ uri = hash.key?('uri') ? hash['uri'] : SKIP
159
+
160
+ # Create object from extracted values.
161
+ Invoice.new(carrier: carrier,
162
+ documents: documents,
163
+ factoring_company_id: factoring_company_id,
164
+ factoring_company_name: factoring_company_name,
165
+ has_claim: has_claim,
166
+ invoice_number: invoice_number,
167
+ last_updated_at: last_updated_at,
168
+ load: load,
169
+ payment: payment,
170
+ status: status,
171
+ submitted_at: submitted_at,
172
+ uri: uri)
173
+ end
174
+
175
+ def to_custom_last_updated_at
176
+ DateTimeHelper.to_rfc3339(last_updated_at)
177
+ end
178
+
179
+ def to_custom_submitted_at
180
+ DateTimeHelper.to_rfc3339(submitted_at)
181
+ end
182
+
183
+ # Provides a human-readable string representation of the object.
184
+ def to_s
185
+ class_name = self.class.name.split('::').last
186
+ "<#{class_name} carrier: #{@carrier}, documents: #{@documents}, factoring_company_id:"\
187
+ " #{@factoring_company_id}, factoring_company_name: #{@factoring_company_name}, has_claim:"\
188
+ " #{@has_claim}, invoice_number: #{@invoice_number}, last_updated_at: #{@last_updated_at},"\
189
+ " load: #{@load}, payment: #{@payment}, status: #{@status}, submitted_at: #{@submitted_at},"\
190
+ " uri: #{@uri}>"
191
+ end
192
+
193
+ # Provides a debugging-friendly string with detailed object information.
194
+ def inspect
195
+ class_name = self.class.name.split('::').last
196
+ "<#{class_name} carrier: #{@carrier.inspect}, documents: #{@documents.inspect},"\
197
+ " factoring_company_id: #{@factoring_company_id.inspect}, factoring_company_name:"\
198
+ " #{@factoring_company_name.inspect}, has_claim: #{@has_claim.inspect}, invoice_number:"\
199
+ " #{@invoice_number.inspect}, last_updated_at: #{@last_updated_at.inspect}, load:"\
200
+ " #{@load.inspect}, payment: #{@payment.inspect}, status: #{@status.inspect}, submitted_at:"\
201
+ " #{@submitted_at.inspect}, uri: #{@uri.inspect}>"
202
+ end
203
+ end
204
+ end
@@ -1,86 +1,72 @@
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
- # Document Model.
8
- class Document < BaseModel
9
- SKIP = Object.new
10
- private_constant :SKIP
11
-
12
- # System-generated document identifier.
13
- # @return [UUID | String]
14
- attr_accessor :document_id
15
-
16
- # Document type classification used for categorizing uploaded documents.
17
- # @return [DocumentType]
18
- attr_accessor :document_type
19
-
20
- # A mapping from model property names to API property names.
21
- def self.names
22
- @_hash = {} if @_hash.nil?
23
- @_hash['document_id'] = 'documentId'
24
- @_hash['document_type'] = 'documentType'
25
- @_hash
26
- end
27
-
28
- # An array for optional fields
29
- def self.optionals
30
- %w[
31
- document_id
32
- document_type
33
- ]
34
- end
35
-
36
- # An array for nullable fields
37
- def self.nullables
38
- []
39
- end
40
-
41
- def initialize(document_id: SKIP, document_type: SKIP,
42
- additional_properties: nil)
43
- # Add additional model properties to the instance
44
- additional_properties = {} if additional_properties.nil?
45
-
46
- @document_id = document_id unless document_id == SKIP
47
- @document_type = document_type unless document_type == SKIP
48
- @additional_properties = additional_properties
49
- end
50
-
51
- # Creates an instance of the object from a hash.
52
- def self.from_hash(hash)
53
- return nil unless hash
54
-
55
- # Extract variables from the hash.
56
- document_id = hash.key?('documentId') ? hash['documentId'] : SKIP
57
- document_type = hash.key?('documentType') ? hash['documentType'] : SKIP
58
-
59
- # Create a new hash for additional properties, removing known properties.
60
- new_hash = hash.reject { |k, _| names.value?(k) }
61
-
62
- additional_properties = APIHelper.get_additional_properties(
63
- new_hash, proc { |value| value }
64
- )
65
-
66
- # Create object from extracted values.
67
- Document.new(document_id: document_id,
68
- document_type: document_type,
69
- additional_properties: additional_properties)
70
- end
71
-
72
- # Provides a human-readable string representation of the object.
73
- def to_s
74
- class_name = self.class.name.split('::').last
75
- "<#{class_name} document_id: #{@document_id}, document_type: #{@document_type},"\
76
- " additional_properties: #{@additional_properties}>"
77
- end
78
-
79
- # Provides a debugging-friendly string with detailed object information.
80
- def inspect
81
- class_name = self.class.name.split('::').last
82
- "<#{class_name} document_id: #{@document_id.inspect}, document_type:"\
83
- " #{@document_type.inspect}, additional_properties: #{@additional_properties}>"
84
- end
85
- end
86
- end
1
+ # freight_financials_webhook_ingestion_api
2
+ #
3
+ # This file was automatically
4
+ # generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module FreightFinancialsWebhookIngestionApi
7
+ # InvoiceDocument Model.
8
+ class InvoiceDocument < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [UUID | String]
14
+ attr_accessor :document_id
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [Integer]
18
+ attr_accessor :document_type
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['document_id'] = 'documentId'
24
+ @_hash['document_type'] = 'documentType'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ document_id
32
+ document_type
33
+ ]
34
+ end
35
+
36
+ # An array for nullable fields
37
+ def self.nullables
38
+ []
39
+ end
40
+
41
+ def initialize(document_id: SKIP, document_type: SKIP)
42
+ @document_id = document_id unless document_id == SKIP
43
+ @document_type = document_type unless document_type == SKIP
44
+ end
45
+
46
+ # Creates an instance of the object from a hash.
47
+ def self.from_hash(hash)
48
+ return nil unless hash
49
+
50
+ # Extract variables from the hash.
51
+ document_id = hash.key?('documentId') ? hash['documentId'] : SKIP
52
+ document_type = hash.key?('documentType') ? hash['documentType'] : SKIP
53
+
54
+ # Create object from extracted values.
55
+ InvoiceDocument.new(document_id: document_id,
56
+ document_type: document_type)
57
+ end
58
+
59
+ # Provides a human-readable string representation of the object.
60
+ def to_s
61
+ class_name = self.class.name.split('::').last
62
+ "<#{class_name} document_id: #{@document_id}, document_type: #{@document_type}>"
63
+ end
64
+
65
+ # Provides a debugging-friendly string with detailed object information.
66
+ def inspect
67
+ class_name = self.class.name.split('::').last
68
+ "<#{class_name} document_id: #{@document_id.inspect}, document_type:"\
69
+ " #{@document_type.inspect}>"
70
+ end
71
+ end
72
+ end