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,193 +1,185 @@
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
- # Current processing state of an invoice, including any outstanding exceptions
9
- # that require resolution.
10
- class InvoiceStatusResponse < BaseModel
11
- SKIP = Object.new
12
- private_constant :SKIP
13
-
14
- # The TQL load number this invoice was submitted against.
15
- # @return [String]
16
- attr_accessor :load_number
17
-
18
- # The factoring company's invoice number.
19
- # @return [String]
20
- attr_accessor :invoice_number
21
-
22
- # Processing and payment status of an invoice. The lifecycle typically
23
- # flows: `Received` → `Validating` → `Processing` → `Approved` → `NotPaid` →
24
- # `Paid`. Branches include `AwaitingDocuments`, `PendingExceptions`, and
25
- # `Rejected`.
26
- # @return [InvoiceStatus]
27
- attr_accessor :status
28
-
29
- # UTC timestamp when the invoice was received.
30
- # @return [DateTime]
31
- attr_accessor :received_at
32
-
33
- # UTC timestamp when processing completed (null if still in progress).
34
- # @return [DateTime]
35
- attr_accessor :completed_at
36
-
37
- # Sum of all charge amounts on the invoice.
38
- # @return [Float]
39
- attr_accessor :total_charge_amount
40
-
41
- # [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency
42
- # code.
43
- # @return [String]
44
- attr_accessor :currency
45
-
46
- # Documents uploaded and linked to this invoice. Each entry indicates the
47
- # document type. Empty array means no documents have been received yet.
48
- # @return [Array[DocumentType]]
49
- attr_accessor :documents
50
-
51
- # Outstanding exceptions that need resolution. Empty array means no issues.
52
- # @return [Array[InvoiceException]]
53
- attr_accessor :exceptions
54
-
55
- # A mapping from model property names to API property names.
56
- def self.names
57
- @_hash = {} if @_hash.nil?
58
- @_hash['load_number'] = 'loadNumber'
59
- @_hash['invoice_number'] = 'invoiceNumber'
60
- @_hash['status'] = 'status'
61
- @_hash['received_at'] = 'receivedAt'
62
- @_hash['completed_at'] = 'completedAt'
63
- @_hash['total_charge_amount'] = 'totalChargeAmount'
64
- @_hash['currency'] = 'currency'
65
- @_hash['documents'] = 'documents'
66
- @_hash['exceptions'] = 'exceptions'
67
- @_hash
68
- end
69
-
70
- # An array for optional fields
71
- def self.optionals
72
- %w[
73
- load_number
74
- invoice_number
75
- status
76
- received_at
77
- completed_at
78
- total_charge_amount
79
- currency
80
- documents
81
- exceptions
82
- ]
83
- end
84
-
85
- # An array for nullable fields
86
- def self.nullables
87
- %w[
88
- completed_at
89
- ]
90
- end
91
-
92
- def initialize(load_number: SKIP, invoice_number: SKIP, status: SKIP,
93
- received_at: SKIP, completed_at: SKIP,
94
- total_charge_amount: SKIP, currency: SKIP, documents: SKIP,
95
- exceptions: SKIP, additional_properties: nil)
96
- # Add additional model properties to the instance
97
- additional_properties = {} if additional_properties.nil?
98
-
99
- @load_number = load_number unless load_number == SKIP
100
- @invoice_number = invoice_number unless invoice_number == SKIP
101
- @status = status unless status == SKIP
102
- @received_at = received_at unless received_at == SKIP
103
- @completed_at = completed_at unless completed_at == SKIP
104
- @total_charge_amount = total_charge_amount unless total_charge_amount == SKIP
105
- @currency = currency unless currency == SKIP
106
- @documents = documents unless documents == SKIP
107
- @exceptions = exceptions unless exceptions == SKIP
108
- @additional_properties = additional_properties
109
- end
110
-
111
- # Creates an instance of the object from a hash.
112
- def self.from_hash(hash)
113
- return nil unless hash
114
-
115
- # Extract variables from the hash.
116
- load_number = hash.key?('loadNumber') ? hash['loadNumber'] : SKIP
117
- invoice_number = hash.key?('invoiceNumber') ? hash['invoiceNumber'] : SKIP
118
- status = hash.key?('status') ? hash['status'] : SKIP
119
- received_at = if hash.key?('receivedAt')
120
- (DateTimeHelper.from_rfc3339(hash['receivedAt']) if hash['receivedAt'])
121
- else
122
- SKIP
123
- end
124
- completed_at = if hash.key?('completedAt')
125
- (DateTimeHelper.from_rfc3339(hash['completedAt']) if hash['completedAt'])
126
- else
127
- SKIP
128
- end
129
- total_charge_amount =
130
- hash.key?('totalChargeAmount') ? hash['totalChargeAmount'] : SKIP
131
- currency = hash.key?('currency') ? hash['currency'] : SKIP
132
- documents = hash.key?('documents') ? hash['documents'] : SKIP
133
- # Parameter is an array, so we need to iterate through it
134
- exceptions = nil
135
- unless hash['exceptions'].nil?
136
- exceptions = []
137
- hash['exceptions'].each do |structure|
138
- exceptions << (InvoiceException.from_hash(structure) if structure)
139
- end
140
- end
141
-
142
- exceptions = SKIP unless hash.key?('exceptions')
143
-
144
- # Create a new hash for additional properties, removing known properties.
145
- new_hash = hash.reject { |k, _| names.value?(k) }
146
-
147
- additional_properties = APIHelper.get_additional_properties(
148
- new_hash, proc { |value| value }
149
- )
150
-
151
- # Create object from extracted values.
152
- InvoiceStatusResponse.new(load_number: load_number,
153
- invoice_number: invoice_number,
154
- status: status,
155
- received_at: received_at,
156
- completed_at: completed_at,
157
- total_charge_amount: total_charge_amount,
158
- currency: currency,
159
- documents: documents,
160
- exceptions: exceptions,
161
- additional_properties: additional_properties)
162
- end
163
-
164
- def to_custom_received_at
165
- DateTimeHelper.to_rfc3339(received_at)
166
- end
167
-
168
- def to_custom_completed_at
169
- DateTimeHelper.to_rfc3339(completed_at)
170
- end
171
-
172
- # Provides a human-readable string representation of the object.
173
- def to_s
174
- class_name = self.class.name.split('::').last
175
- "<#{class_name} load_number: #{@load_number}, invoice_number: #{@invoice_number}, status:"\
176
- " #{@status}, received_at: #{@received_at}, completed_at: #{@completed_at},"\
177
- " total_charge_amount: #{@total_charge_amount}, currency: #{@currency}, documents:"\
178
- " #{@documents}, exceptions: #{@exceptions}, additional_properties:"\
179
- " #{@additional_properties}>"
180
- end
181
-
182
- # Provides a debugging-friendly string with detailed object information.
183
- def inspect
184
- class_name = self.class.name.split('::').last
185
- "<#{class_name} load_number: #{@load_number.inspect}, invoice_number:"\
186
- " #{@invoice_number.inspect}, status: #{@status.inspect}, received_at:"\
187
- " #{@received_at.inspect}, completed_at: #{@completed_at.inspect}, total_charge_amount:"\
188
- " #{@total_charge_amount.inspect}, currency: #{@currency.inspect}, documents:"\
189
- " #{@documents.inspect}, exceptions: #{@exceptions.inspect}, additional_properties:"\
190
- " #{@additional_properties}>"
191
- end
192
- end
193
- 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
+ # InvoiceStatusResponseData Model.
9
+ class InvoiceStatusResponseData < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [DateTime]
15
+ attr_accessor :completed_at
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [String]
19
+ attr_accessor :currency
20
+
21
+ # TODO: Write general description for this method
22
+ # @return [Array[Integer]]
23
+ attr_accessor :documents
24
+
25
+ # TODO: Write general description for this method
26
+ # @return [Array[InvoiceIssue]]
27
+ attr_accessor :issues
28
+
29
+ # TODO: Write general description for this method
30
+ # @return [String]
31
+ attr_accessor :invoice_number
32
+
33
+ # TODO: Write general description for this method
34
+ # @return [String]
35
+ attr_accessor :load_number
36
+
37
+ # TODO: Write general description for this method
38
+ # @return [DateTime]
39
+ attr_accessor :received_at
40
+
41
+ # TODO: Write general description for this method
42
+ # @return [Integer]
43
+ attr_accessor :status
44
+
45
+ # TODO: Write general description for this method
46
+ # @return [Float]
47
+ attr_accessor :total_charge_amount
48
+
49
+ # A mapping from model property names to API property names.
50
+ def self.names
51
+ @_hash = {} if @_hash.nil?
52
+ @_hash['completed_at'] = 'completedAt'
53
+ @_hash['currency'] = 'currency'
54
+ @_hash['documents'] = 'documents'
55
+ @_hash['issues'] = 'issues'
56
+ @_hash['invoice_number'] = 'invoiceNumber'
57
+ @_hash['load_number'] = 'loadNumber'
58
+ @_hash['received_at'] = 'receivedAt'
59
+ @_hash['status'] = 'status'
60
+ @_hash['total_charge_amount'] = 'totalChargeAmount'
61
+ @_hash
62
+ end
63
+
64
+ # An array for optional fields
65
+ def self.optionals
66
+ %w[
67
+ completed_at
68
+ currency
69
+ documents
70
+ issues
71
+ invoice_number
72
+ load_number
73
+ received_at
74
+ status
75
+ total_charge_amount
76
+ ]
77
+ end
78
+
79
+ # An array for nullable fields
80
+ def self.nullables
81
+ %w[
82
+ completed_at
83
+ ]
84
+ end
85
+
86
+ def initialize(completed_at: SKIP, currency: SKIP, documents: SKIP,
87
+ issues: SKIP, invoice_number: SKIP, load_number: SKIP,
88
+ received_at: SKIP, status: SKIP, total_charge_amount: SKIP,
89
+ additional_properties: nil)
90
+ # Add additional model properties to the instance
91
+ additional_properties = {} if additional_properties.nil?
92
+
93
+ @completed_at = completed_at unless completed_at == SKIP
94
+ @currency = currency unless currency == SKIP
95
+ @documents = documents unless documents == SKIP
96
+ @issues = issues unless issues == SKIP
97
+ @invoice_number = invoice_number unless invoice_number == SKIP
98
+ @load_number = load_number unless load_number == SKIP
99
+ @received_at = received_at unless received_at == SKIP
100
+ @status = status unless status == SKIP
101
+ @total_charge_amount = total_charge_amount unless total_charge_amount == SKIP
102
+ @additional_properties = additional_properties
103
+ end
104
+
105
+ # Creates an instance of the object from a hash.
106
+ def self.from_hash(hash)
107
+ return nil unless hash
108
+
109
+ # Extract variables from the hash.
110
+ completed_at = if hash.key?('completedAt')
111
+ (DateTimeHelper.from_rfc3339(hash['completedAt']) if hash['completedAt'])
112
+ else
113
+ SKIP
114
+ end
115
+ currency = hash.key?('currency') ? hash['currency'] : SKIP
116
+ documents = hash.key?('documents') ? hash['documents'] : SKIP
117
+ # Parameter is an array, so we need to iterate through it
118
+ issues = nil
119
+ unless hash['issues'].nil?
120
+ issues = []
121
+ hash['issues'].each do |structure|
122
+ issues << (InvoiceIssue.from_hash(structure) if structure)
123
+ end
124
+ end
125
+
126
+ issues = SKIP unless hash.key?('issues')
127
+ invoice_number = hash.key?('invoiceNumber') ? hash['invoiceNumber'] : SKIP
128
+ load_number = hash.key?('loadNumber') ? hash['loadNumber'] : SKIP
129
+ received_at = if hash.key?('receivedAt')
130
+ (DateTimeHelper.from_rfc3339(hash['receivedAt']) if hash['receivedAt'])
131
+ else
132
+ SKIP
133
+ end
134
+ status = hash.key?('status') ? hash['status'] : SKIP
135
+ total_charge_amount =
136
+ hash.key?('totalChargeAmount') ? hash['totalChargeAmount'] : SKIP
137
+
138
+ # Create a new hash for additional properties, removing known properties.
139
+ new_hash = hash.reject { |k, _| names.value?(k) }
140
+
141
+ additional_properties = APIHelper.get_additional_properties(
142
+ new_hash, proc { |value| value }
143
+ )
144
+
145
+ # Create object from extracted values.
146
+ InvoiceStatusResponseData.new(completed_at: completed_at,
147
+ currency: currency,
148
+ documents: documents,
149
+ issues: issues,
150
+ invoice_number: invoice_number,
151
+ load_number: load_number,
152
+ received_at: received_at,
153
+ status: status,
154
+ total_charge_amount: total_charge_amount,
155
+ additional_properties: additional_properties)
156
+ end
157
+
158
+ def to_custom_completed_at
159
+ DateTimeHelper.to_rfc3339(completed_at)
160
+ end
161
+
162
+ def to_custom_received_at
163
+ DateTimeHelper.to_rfc3339(received_at)
164
+ end
165
+
166
+ # Provides a human-readable string representation of the object.
167
+ def to_s
168
+ class_name = self.class.name.split('::').last
169
+ "<#{class_name} completed_at: #{@completed_at}, currency: #{@currency}, documents:"\
170
+ " #{@documents}, issues: #{@issues}, invoice_number: #{@invoice_number}, load_number:"\
171
+ " #{@load_number}, received_at: #{@received_at}, status: #{@status}, total_charge_amount:"\
172
+ " #{@total_charge_amount}, additional_properties: #{@additional_properties}>"
173
+ end
174
+
175
+ # Provides a debugging-friendly string with detailed object information.
176
+ def inspect
177
+ class_name = self.class.name.split('::').last
178
+ "<#{class_name} completed_at: #{@completed_at.inspect}, currency: #{@currency.inspect},"\
179
+ " documents: #{@documents.inspect}, issues: #{@issues.inspect}, invoice_number:"\
180
+ " #{@invoice_number.inspect}, load_number: #{@load_number.inspect}, received_at:"\
181
+ " #{@received_at.inspect}, status: #{@status.inspect}, total_charge_amount:"\
182
+ " #{@total_charge_amount.inspect}, additional_properties: #{@additional_properties}>"
183
+ end
184
+ end
185
+ end
@@ -0,0 +1,131 @@
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
+ # LineItem Model.
8
+ class LineItem < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :description
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [Float]
18
+ attr_accessor :freight_class
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [String]
22
+ attr_accessor :handling_unit
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [Integer]
26
+ attr_accessor :handling_unit_count
27
+
28
+ # TODO: Write general description for this method
29
+ # @return [String]
30
+ attr_accessor :item_id
31
+
32
+ # TODO: Write general description for this method
33
+ # @return [Float]
34
+ attr_accessor :weight
35
+
36
+ # TODO: Write general description for this method
37
+ # @return [String]
38
+ attr_accessor :weight_unit
39
+
40
+ # A mapping from model property names to API property names.
41
+ def self.names
42
+ @_hash = {} if @_hash.nil?
43
+ @_hash['description'] = 'description'
44
+ @_hash['freight_class'] = 'freightClass'
45
+ @_hash['handling_unit'] = 'handlingUnit'
46
+ @_hash['handling_unit_count'] = 'handlingUnitCount'
47
+ @_hash['item_id'] = 'itemId'
48
+ @_hash['weight'] = 'weight'
49
+ @_hash['weight_unit'] = 'weightUnit'
50
+ @_hash
51
+ end
52
+
53
+ # An array for optional fields
54
+ def self.optionals
55
+ %w[
56
+ description
57
+ freight_class
58
+ handling_unit
59
+ handling_unit_count
60
+ item_id
61
+ weight
62
+ weight_unit
63
+ ]
64
+ end
65
+
66
+ # An array for nullable fields
67
+ def self.nullables
68
+ %w[
69
+ description
70
+ freight_class
71
+ handling_unit
72
+ handling_unit_count
73
+ weight
74
+ weight_unit
75
+ ]
76
+ end
77
+
78
+ def initialize(description: SKIP, freight_class: SKIP, handling_unit: SKIP,
79
+ handling_unit_count: SKIP, item_id: SKIP, weight: SKIP,
80
+ weight_unit: SKIP)
81
+ @description = description unless description == SKIP
82
+ @freight_class = freight_class unless freight_class == SKIP
83
+ @handling_unit = handling_unit unless handling_unit == SKIP
84
+ @handling_unit_count = handling_unit_count unless handling_unit_count == SKIP
85
+ @item_id = item_id unless item_id == SKIP
86
+ @weight = weight unless weight == SKIP
87
+ @weight_unit = weight_unit unless weight_unit == SKIP
88
+ end
89
+
90
+ # Creates an instance of the object from a hash.
91
+ def self.from_hash(hash)
92
+ return nil unless hash
93
+
94
+ # Extract variables from the hash.
95
+ description = hash.key?('description') ? hash['description'] : SKIP
96
+ freight_class = hash.key?('freightClass') ? hash['freightClass'] : SKIP
97
+ handling_unit = hash.key?('handlingUnit') ? hash['handlingUnit'] : SKIP
98
+ handling_unit_count =
99
+ hash.key?('handlingUnitCount') ? hash['handlingUnitCount'] : SKIP
100
+ item_id = hash.key?('itemId') ? hash['itemId'] : SKIP
101
+ weight = hash.key?('weight') ? hash['weight'] : SKIP
102
+ weight_unit = hash.key?('weightUnit') ? hash['weightUnit'] : SKIP
103
+
104
+ # Create object from extracted values.
105
+ LineItem.new(description: description,
106
+ freight_class: freight_class,
107
+ handling_unit: handling_unit,
108
+ handling_unit_count: handling_unit_count,
109
+ item_id: item_id,
110
+ weight: weight,
111
+ weight_unit: weight_unit)
112
+ end
113
+
114
+ # Provides a human-readable string representation of the object.
115
+ def to_s
116
+ class_name = self.class.name.split('::').last
117
+ "<#{class_name} description: #{@description}, freight_class: #{@freight_class},"\
118
+ " handling_unit: #{@handling_unit}, handling_unit_count: #{@handling_unit_count}, item_id:"\
119
+ " #{@item_id}, weight: #{@weight}, weight_unit: #{@weight_unit}>"
120
+ end
121
+
122
+ # Provides a debugging-friendly string with detailed object information.
123
+ def inspect
124
+ class_name = self.class.name.split('::').last
125
+ "<#{class_name} description: #{@description.inspect}, freight_class:"\
126
+ " #{@freight_class.inspect}, handling_unit: #{@handling_unit.inspect}, handling_unit_count:"\
127
+ " #{@handling_unit_count.inspect}, item_id: #{@item_id.inspect}, weight: #{@weight.inspect},"\
128
+ " weight_unit: #{@weight_unit.inspect}>"
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,83 @@
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
+ # LoadResponse Model.
8
+ class LoadResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [LoadResponseData]
14
+ attr_accessor :data
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [Array[String]]
18
+ attr_accessor :errors
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [TrueClass | FalseClass]
22
+ attr_accessor :is_success
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['data'] = 'data'
28
+ @_hash['errors'] = 'errors'
29
+ @_hash['is_success'] = 'isSuccess'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ %w[
36
+ data
37
+ errors
38
+ is_success
39
+ ]
40
+ end
41
+
42
+ # An array for nullable fields
43
+ def self.nullables
44
+ %w[
45
+ data
46
+ ]
47
+ end
48
+
49
+ def initialize(data: SKIP, errors: SKIP, is_success: SKIP)
50
+ @data = data unless data == SKIP
51
+ @errors = errors unless errors == SKIP
52
+ @is_success = is_success unless is_success == SKIP
53
+ end
54
+
55
+ # Creates an instance of the object from a hash.
56
+ def self.from_hash(hash)
57
+ return nil unless hash
58
+
59
+ # Extract variables from the hash.
60
+ data = LoadResponseData.from_hash(hash['data']) if hash['data']
61
+ errors = hash.key?('errors') ? hash['errors'] : SKIP
62
+ is_success = hash.key?('isSuccess') ? hash['isSuccess'] : SKIP
63
+
64
+ # Create object from extracted values.
65
+ LoadResponse.new(data: data,
66
+ errors: errors,
67
+ is_success: is_success)
68
+ end
69
+
70
+ # Provides a human-readable string representation of the object.
71
+ def to_s
72
+ class_name = self.class.name.split('::').last
73
+ "<#{class_name} data: #{@data}, errors: #{@errors}, is_success: #{@is_success}>"
74
+ end
75
+
76
+ # Provides a debugging-friendly string with detailed object information.
77
+ def inspect
78
+ class_name = self.class.name.split('::').last
79
+ "<#{class_name} data: #{@data.inspect}, errors: #{@errors.inspect}, is_success:"\
80
+ " #{@is_success.inspect}>"
81
+ end
82
+ end
83
+ end