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.
- checksums.yaml +4 -4
- data/README.md +148 -197
- data/bin/console +4 -4
- data/lib/freight_financials_webhook_ingestion_api/api_helper.rb +10 -0
- data/lib/freight_financials_webhook_ingestion_api/apis/assignments_api.rb +41 -0
- data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/apis/base_api.rb +60 -60
- data/lib/freight_financials_webhook_ingestion_api/apis/documents_api.rb +73 -0
- data/lib/freight_financials_webhook_ingestion_api/apis/freight_audit_api.rb +54 -0
- data/lib/freight_financials_webhook_ingestion_api/apis/invoices_api.rb +107 -0
- data/lib/freight_financials_webhook_ingestion_api/apis/loads_api.rb +72 -0
- data/lib/freight_financials_webhook_ingestion_api/apis/rating_api.rb +45 -0
- data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/client.rb +83 -97
- data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/configuration.rb +114 -126
- data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/exceptions/api_exception.rb +21 -21
- 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
- data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/http/api_response.rb +7 -7
- data/lib/freight_financials_webhook_ingestion_api/http/http_call_back.rb +10 -0
- data/lib/freight_financials_webhook_ingestion_api/http/http_method_enum.rb +10 -0
- data/lib/freight_financials_webhook_ingestion_api/http/http_request.rb +10 -0
- data/lib/freight_financials_webhook_ingestion_api/http/http_response.rb +10 -0
- data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/http/proxy_settings.rb +6 -6
- data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/logging/configuration/api_logging_configuration.rb +6 -6
- data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/logging/sdk_logger.rb +6 -6
- data/lib/freight_financials_webhook_ingestion_api/models/address.rb +123 -0
- data/lib/freight_financials_webhook_ingestion_api/models/assignment_request.rb +94 -0
- data/lib/freight_financials_webhook_ingestion_api/models/assignment_response.rb +83 -0
- data/lib/{tql_otr_factoring_data_exchange/models/assignment_response.rb → freight_financials_webhook_ingestion_api/models/assignment_response_data.rb} +124 -126
- data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/models/base_model.rb +110 -110
- data/lib/{tql_otr_factoring_data_exchange/models/carrier1.rb → freight_financials_webhook_ingestion_api/models/carrier.rb} +96 -98
- data/lib/freight_financials_webhook_ingestion_api/models/charge.rb +104 -0
- data/lib/freight_financials_webhook_ingestion_api/models/charge_code.rb +81 -0
- data/lib/freight_financials_webhook_ingestion_api/models/factoring_company.rb +81 -0
- data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/models/invoice.rb +204 -223
- data/lib/{tql_otr_factoring_data_exchange/models/document.rb → freight_financials_webhook_ingestion_api/models/invoice_document.rb} +72 -86
- data/lib/{tql_otr_factoring_data_exchange/models/invoice_exception.rb → freight_financials_webhook_ingestion_api/models/invoice_issue.rb} +122 -136
- data/lib/freight_financials_webhook_ingestion_api/models/invoice_status_response.rb +83 -0
- 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
- data/lib/freight_financials_webhook_ingestion_api/models/line_item.rb +131 -0
- data/lib/freight_financials_webhook_ingestion_api/models/load_response.rb +83 -0
- data/lib/{tql_otr_factoring_data_exchange/models/load_detail.rb → freight_financials_webhook_ingestion_api/models/load_response_data.rb} +141 -140
- data/lib/{tql_otr_factoring_data_exchange/models/load.rb → freight_financials_webhook_ingestion_api/models/load_slim.rb} +97 -110
- data/lib/freight_financials_webhook_ingestion_api/models/navix_rate_charge.rb +116 -0
- data/lib/freight_financials_webhook_ingestion_api/models/navix_rate_customer.rb +64 -0
- data/lib/freight_financials_webhook_ingestion_api/models/navix_rate_line_item.rb +177 -0
- data/lib/freight_financials_webhook_ingestion_api/models/navix_rate_request.rb +208 -0
- data/lib/freight_financials_webhook_ingestion_api/models/navix_rate_requested_charge.rb +64 -0
- data/lib/freight_financials_webhook_ingestion_api/models/navix_rate_response.rb +112 -0
- data/lib/freight_financials_webhook_ingestion_api/models/navix_rate_stop.rb +107 -0
- data/lib/freight_financials_webhook_ingestion_api/models/navix_rate_vendor.rb +88 -0
- data/lib/freight_financials_webhook_ingestion_api/models/navix_webhook_event_type.rb +56 -0
- data/lib/freight_financials_webhook_ingestion_api/models/navix_webhook_request.rb +99 -0
- data/lib/freight_financials_webhook_ingestion_api/models/paged_response_of_invoice.rb +111 -0
- data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/models/payment.rb +94 -108
- data/lib/freight_financials_webhook_ingestion_api/models/rating_charge_qualifier.rb +68 -0
- data/lib/freight_financials_webhook_ingestion_api/models/rating_response_format.rb +40 -0
- data/lib/freight_financials_webhook_ingestion_api/models/reference_number.rb +71 -0
- data/lib/{tql_otr_factoring_data_exchange/models/invoice_search_request.rb → freight_financials_webhook_ingestion_api/models/search_request.rb} +223 -242
- data/lib/freight_financials_webhook_ingestion_api/models/search_response.rb +83 -0
- data/lib/freight_financials_webhook_ingestion_api/models/stop.rb +81 -0
- data/lib/freight_financials_webhook_ingestion_api/models/submit_invoice_request.rb +228 -0
- data/lib/freight_financials_webhook_ingestion_api/models/submit_invoice_response.rb +83 -0
- 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
- data/lib/freight_financials_webhook_ingestion_api/models/upload_request.rb +128 -0
- data/lib/freight_financials_webhook_ingestion_api/models/upload_response.rb +83 -0
- data/lib/{tql_otr_factoring_data_exchange/models/document_upload_response.rb → freight_financials_webhook_ingestion_api/models/upload_response_data.rb} +117 -137
- data/lib/freight_financials_webhook_ingestion_api/utilities/date_time_helper.rb +11 -0
- data/lib/{tql_otr_factoring_data_exchange → freight_financials_webhook_ingestion_api}/utilities/file_wrapper.rb +17 -17
- data/lib/freight_financials_webhook_ingestion_api.rb +127 -0
- metadata +67 -74
- data/lib/tql_otr_factoring_data_exchange/api_helper.rb +0 -10
- data/lib/tql_otr_factoring_data_exchange/apis/assignments_api.rb +0 -45
- data/lib/tql_otr_factoring_data_exchange/apis/documents_api.rb +0 -82
- data/lib/tql_otr_factoring_data_exchange/apis/invoices_api.rb +0 -114
- data/lib/tql_otr_factoring_data_exchange/apis/loads_api.rb +0 -68
- data/lib/tql_otr_factoring_data_exchange/apis/oauth_authorization_api.rb +0 -44
- data/lib/tql_otr_factoring_data_exchange/exceptions/oauth_provider_exception.rb +0 -64
- data/lib/tql_otr_factoring_data_exchange/http/auth/oauth_2.rb +0 -156
- data/lib/tql_otr_factoring_data_exchange/http/http_call_back.rb +0 -10
- data/lib/tql_otr_factoring_data_exchange/http/http_method_enum.rb +0 -10
- data/lib/tql_otr_factoring_data_exchange/http/http_request.rb +0 -10
- data/lib/tql_otr_factoring_data_exchange/http/http_response.rb +0 -10
- data/lib/tql_otr_factoring_data_exchange/models/assignment_request.rb +0 -140
- data/lib/tql_otr_factoring_data_exchange/models/assignment_status.rb +0 -36
- data/lib/tql_otr_factoring_data_exchange/models/base64_document.rb +0 -118
- data/lib/tql_otr_factoring_data_exchange/models/base64_document_upload_request.rb +0 -107
- data/lib/tql_otr_factoring_data_exchange/models/carrier.rb +0 -98
- data/lib/tql_otr_factoring_data_exchange/models/carrier2.rb +0 -98
- data/lib/tql_otr_factoring_data_exchange/models/carrier_input.rb +0 -123
- data/lib/tql_otr_factoring_data_exchange/models/carrier_input1.rb +0 -123
- data/lib/tql_otr_factoring_data_exchange/models/charge_code.rb +0 -126
- data/lib/tql_otr_factoring_data_exchange/models/charge_code_origin.rb +0 -49
- data/lib/tql_otr_factoring_data_exchange/models/charge_input.rb +0 -146
- data/lib/tql_otr_factoring_data_exchange/models/document_type.rb +0 -288
- data/lib/tql_otr_factoring_data_exchange/models/document_upload_metadata.rb +0 -111
- data/lib/tql_otr_factoring_data_exchange/models/exception_severity.rb +0 -40
- data/lib/tql_otr_factoring_data_exchange/models/factoring_company_input.rb +0 -117
- data/lib/tql_otr_factoring_data_exchange/models/invoice_item_input.rb +0 -165
- data/lib/tql_otr_factoring_data_exchange/models/invoice_search_response.rb +0 -124
- data/lib/tql_otr_factoring_data_exchange/models/invoice_status.rb +0 -74
- data/lib/tql_otr_factoring_data_exchange/models/invoice_type.rb +0 -50
- data/lib/tql_otr_factoring_data_exchange/models/load_search_request.rb +0 -205
- data/lib/tql_otr_factoring_data_exchange/models/load_search_response.rb +0 -124
- data/lib/tql_otr_factoring_data_exchange/models/load_status.rb +0 -56
- data/lib/tql_otr_factoring_data_exchange/models/location.rb +0 -149
- data/lib/tql_otr_factoring_data_exchange/models/oauth_provider_error.rb +0 -62
- data/lib/tql_otr_factoring_data_exchange/models/oauth_scope.rb +0 -36
- data/lib/tql_otr_factoring_data_exchange/models/oauth_token.rb +0 -96
- data/lib/tql_otr_factoring_data_exchange/models/problem_details.rb +0 -96
- data/lib/tql_otr_factoring_data_exchange/models/reference_number_input.rb +0 -109
- data/lib/tql_otr_factoring_data_exchange/models/reference_type.rb +0 -90
- data/lib/tql_otr_factoring_data_exchange/models/status.rb +0 -44
- data/lib/tql_otr_factoring_data_exchange/models/stop_input.rb +0 -121
- data/lib/tql_otr_factoring_data_exchange/models/stop_type.rb +0 -62
- data/lib/tql_otr_factoring_data_exchange/models/submit_invoice_request.rb +0 -326
- data/lib/tql_otr_factoring_data_exchange/models/weight_unit.rb +0 -36
- data/lib/tql_otr_factoring_data_exchange/utilities/date_time_helper.rb +0 -11
- data/lib/tql_otr_factoring_data_exchange/utilities/union_type_lookup.rb +0 -29
- data/lib/tql_otr_factoring_data_exchange.rb +0 -107
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
# AssignmentRequest Model.
|
|
8
|
+
class AssignmentRequest < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Carrier]
|
|
14
|
+
attr_accessor :carrier
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [UploadRequest]
|
|
18
|
+
attr_accessor :document
|
|
19
|
+
|
|
20
|
+
# TODO: Write general description for this method
|
|
21
|
+
# @return [Date]
|
|
22
|
+
attr_accessor :effective_date
|
|
23
|
+
|
|
24
|
+
# TODO: Write general description for this method
|
|
25
|
+
# @return [Integer]
|
|
26
|
+
attr_accessor :status
|
|
27
|
+
|
|
28
|
+
# A mapping from model property names to API property names.
|
|
29
|
+
def self.names
|
|
30
|
+
@_hash = {} if @_hash.nil?
|
|
31
|
+
@_hash['carrier'] = 'carrier'
|
|
32
|
+
@_hash['document'] = 'document'
|
|
33
|
+
@_hash['effective_date'] = 'effectiveDate'
|
|
34
|
+
@_hash['status'] = 'status'
|
|
35
|
+
@_hash
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# An array for optional fields
|
|
39
|
+
def self.optionals
|
|
40
|
+
%w[
|
|
41
|
+
carrier
|
|
42
|
+
document
|
|
43
|
+
effective_date
|
|
44
|
+
status
|
|
45
|
+
]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# An array for nullable fields
|
|
49
|
+
def self.nullables
|
|
50
|
+
%w[
|
|
51
|
+
document
|
|
52
|
+
]
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def initialize(carrier: SKIP, document: SKIP, effective_date: SKIP,
|
|
56
|
+
status: SKIP)
|
|
57
|
+
@carrier = carrier unless carrier == SKIP
|
|
58
|
+
@document = document unless document == SKIP
|
|
59
|
+
@effective_date = effective_date unless effective_date == SKIP
|
|
60
|
+
@status = status unless status == SKIP
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Creates an instance of the object from a hash.
|
|
64
|
+
def self.from_hash(hash)
|
|
65
|
+
return nil unless hash
|
|
66
|
+
|
|
67
|
+
# Extract variables from the hash.
|
|
68
|
+
carrier = Carrier.from_hash(hash['carrier']) if hash['carrier']
|
|
69
|
+
document = UploadRequest.from_hash(hash['document']) if hash['document']
|
|
70
|
+
effective_date = hash.key?('effectiveDate') ? hash['effectiveDate'] : SKIP
|
|
71
|
+
status = hash.key?('status') ? hash['status'] : SKIP
|
|
72
|
+
|
|
73
|
+
# Create object from extracted values.
|
|
74
|
+
AssignmentRequest.new(carrier: carrier,
|
|
75
|
+
document: document,
|
|
76
|
+
effective_date: effective_date,
|
|
77
|
+
status: status)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Provides a human-readable string representation of the object.
|
|
81
|
+
def to_s
|
|
82
|
+
class_name = self.class.name.split('::').last
|
|
83
|
+
"<#{class_name} carrier: #{@carrier}, document: #{@document}, effective_date:"\
|
|
84
|
+
" #{@effective_date}, status: #{@status}>"
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
88
|
+
def inspect
|
|
89
|
+
class_name = self.class.name.split('::').last
|
|
90
|
+
"<#{class_name} carrier: #{@carrier.inspect}, document: #{@document.inspect},"\
|
|
91
|
+
" effective_date: #{@effective_date.inspect}, status: #{@status.inspect}>"
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
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
|
+
# AssignmentResponse Model.
|
|
8
|
+
class AssignmentResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [AssignmentResponseData]
|
|
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 = AssignmentResponseData.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
|
+
AssignmentResponse.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
|
|
@@ -1,126 +1,124 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# This file was automatically
|
|
4
|
-
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
-
|
|
6
|
-
require 'date'
|
|
7
|
-
module
|
|
8
|
-
#
|
|
9
|
-
class
|
|
10
|
-
SKIP = Object.new
|
|
11
|
-
private_constant :SKIP
|
|
12
|
-
|
|
13
|
-
#
|
|
14
|
-
# @return [UUID | String]
|
|
15
|
-
attr_accessor :assignment_id
|
|
16
|
-
|
|
17
|
-
#
|
|
18
|
-
# @return [
|
|
19
|
-
attr_accessor :carrier
|
|
20
|
-
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
#
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
#
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
@_hash =
|
|
37
|
-
@_hash['
|
|
38
|
-
@_hash['
|
|
39
|
-
@_hash['
|
|
40
|
-
@_hash['
|
|
41
|
-
@_hash
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
@
|
|
68
|
-
@
|
|
69
|
-
@status = status unless status == SKIP
|
|
70
|
-
@
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
"
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
end
|
|
126
|
-
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
|
+
# AssignmentResponseData Model.
|
|
9
|
+
class AssignmentResponseData < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for this method
|
|
14
|
+
# @return [UUID | String]
|
|
15
|
+
attr_accessor :assignment_id
|
|
16
|
+
|
|
17
|
+
# TODO: Write general description for this method
|
|
18
|
+
# @return [Carrier]
|
|
19
|
+
attr_accessor :carrier
|
|
20
|
+
|
|
21
|
+
# TODO: Write general description for this method
|
|
22
|
+
# @return [Date]
|
|
23
|
+
attr_accessor :effective_date
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for this method
|
|
26
|
+
# @return [DateTime]
|
|
27
|
+
attr_accessor :recorded_at
|
|
28
|
+
|
|
29
|
+
# TODO: Write general description for this method
|
|
30
|
+
# @return [Integer]
|
|
31
|
+
attr_accessor :status
|
|
32
|
+
|
|
33
|
+
# A mapping from model property names to API property names.
|
|
34
|
+
def self.names
|
|
35
|
+
@_hash = {} if @_hash.nil?
|
|
36
|
+
@_hash['assignment_id'] = 'assignmentId'
|
|
37
|
+
@_hash['carrier'] = 'carrier'
|
|
38
|
+
@_hash['effective_date'] = 'effectiveDate'
|
|
39
|
+
@_hash['recorded_at'] = 'recordedAt'
|
|
40
|
+
@_hash['status'] = 'status'
|
|
41
|
+
@_hash
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# An array for optional fields
|
|
45
|
+
def self.optionals
|
|
46
|
+
%w[
|
|
47
|
+
assignment_id
|
|
48
|
+
carrier
|
|
49
|
+
effective_date
|
|
50
|
+
recorded_at
|
|
51
|
+
status
|
|
52
|
+
]
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# An array for nullable fields
|
|
56
|
+
def self.nullables
|
|
57
|
+
[]
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def initialize(assignment_id: SKIP, carrier: SKIP, effective_date: SKIP,
|
|
61
|
+
recorded_at: SKIP, status: SKIP, additional_properties: nil)
|
|
62
|
+
# Add additional model properties to the instance
|
|
63
|
+
additional_properties = {} if additional_properties.nil?
|
|
64
|
+
|
|
65
|
+
@assignment_id = assignment_id unless assignment_id == SKIP
|
|
66
|
+
@carrier = carrier unless carrier == SKIP
|
|
67
|
+
@effective_date = effective_date unless effective_date == SKIP
|
|
68
|
+
@recorded_at = recorded_at unless recorded_at == SKIP
|
|
69
|
+
@status = status unless status == SKIP
|
|
70
|
+
@additional_properties = additional_properties
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Creates an instance of the object from a hash.
|
|
74
|
+
def self.from_hash(hash)
|
|
75
|
+
return nil unless hash
|
|
76
|
+
|
|
77
|
+
# Extract variables from the hash.
|
|
78
|
+
assignment_id = hash.key?('assignmentId') ? hash['assignmentId'] : SKIP
|
|
79
|
+
carrier = Carrier.from_hash(hash['carrier']) if hash['carrier']
|
|
80
|
+
effective_date = hash.key?('effectiveDate') ? hash['effectiveDate'] : SKIP
|
|
81
|
+
recorded_at = if hash.key?('recordedAt')
|
|
82
|
+
(DateTimeHelper.from_rfc3339(hash['recordedAt']) if hash['recordedAt'])
|
|
83
|
+
else
|
|
84
|
+
SKIP
|
|
85
|
+
end
|
|
86
|
+
status = hash.key?('status') ? hash['status'] : SKIP
|
|
87
|
+
|
|
88
|
+
# Create a new hash for additional properties, removing known properties.
|
|
89
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
90
|
+
|
|
91
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
92
|
+
new_hash, proc { |value| value }
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
# Create object from extracted values.
|
|
96
|
+
AssignmentResponseData.new(assignment_id: assignment_id,
|
|
97
|
+
carrier: carrier,
|
|
98
|
+
effective_date: effective_date,
|
|
99
|
+
recorded_at: recorded_at,
|
|
100
|
+
status: status,
|
|
101
|
+
additional_properties: additional_properties)
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def to_custom_recorded_at
|
|
105
|
+
DateTimeHelper.to_rfc3339(recorded_at)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Provides a human-readable string representation of the object.
|
|
109
|
+
def to_s
|
|
110
|
+
class_name = self.class.name.split('::').last
|
|
111
|
+
"<#{class_name} assignment_id: #{@assignment_id}, carrier: #{@carrier}, effective_date:"\
|
|
112
|
+
" #{@effective_date}, recorded_at: #{@recorded_at}, status: #{@status},"\
|
|
113
|
+
" additional_properties: #{@additional_properties}>"
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
117
|
+
def inspect
|
|
118
|
+
class_name = self.class.name.split('::').last
|
|
119
|
+
"<#{class_name} assignment_id: #{@assignment_id.inspect}, carrier: #{@carrier.inspect},"\
|
|
120
|
+
" effective_date: #{@effective_date.inspect}, recorded_at: #{@recorded_at.inspect}, status:"\
|
|
121
|
+
" #{@status.inspect}, additional_properties: #{@additional_properties}>"
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# This file was automatically
|
|
4
|
-
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
-
|
|
6
|
-
module
|
|
7
|
-
# Base model.
|
|
8
|
-
# rubocop:disable all
|
|
9
|
-
class BaseModel < CoreLibrary::BaseModel
|
|
10
|
-
# Returns a Hash representation of the current object.
|
|
11
|
-
def to_hash
|
|
12
|
-
# validating the model being serialized
|
|
13
|
-
self.class.validate(self) if self.class.respond_to?(:validate)
|
|
14
|
-
|
|
15
|
-
hash = {}
|
|
16
|
-
instance_variables.each do |name|
|
|
17
|
-
value = instance_variable_get(name)
|
|
18
|
-
name = name[1..]
|
|
19
|
-
if name == 'additional_properties'
|
|
20
|
-
additional_properties = process_additional_properties(value, self.class.names)
|
|
21
|
-
hash.merge!(additional_properties)
|
|
22
|
-
else
|
|
23
|
-
key = self.class.names.key?(name) ? self.class.names[name] : name
|
|
24
|
-
optional_fields = self.class.optionals
|
|
25
|
-
nullable_fields = self.class.nullables
|
|
26
|
-
if value.nil?
|
|
27
|
-
next unless nullable_fields.include?(name)
|
|
28
|
-
|
|
29
|
-
if !optional_fields.include?(name) && !nullable_fields.include?(name)
|
|
30
|
-
raise ArgumentError,
|
|
31
|
-
"`#{name}` cannot be nil in `#{self.class}`. Please specify a valid value."
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
hash[key] = nil
|
|
36
|
-
unless value.nil?
|
|
37
|
-
if respond_to?("to_custom_#{name}")
|
|
38
|
-
if (value.instance_of? Array) || (value.instance_of? Hash)
|
|
39
|
-
params = [hash, key]
|
|
40
|
-
hash[key] = send("to_custom_#{name}", *params)
|
|
41
|
-
else
|
|
42
|
-
hash[key] = send("to_custom_#{name}")
|
|
43
|
-
end
|
|
44
|
-
elsif respond_to?("to_union_type_#{name}")
|
|
45
|
-
hash[key] = send("to_union_type_#{name}")
|
|
46
|
-
elsif value.instance_of? Array
|
|
47
|
-
hash[key] = value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
|
|
48
|
-
elsif value.instance_of? Hash
|
|
49
|
-
hash[key] = {}
|
|
50
|
-
value.each do |k, v|
|
|
51
|
-
hash[key][k] = v.is_a?(BaseModel) ? v.to_hash : v
|
|
52
|
-
end
|
|
53
|
-
else
|
|
54
|
-
hash[key] = value.is_a?(BaseModel) ? value.to_hash : value
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
hash
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
# Processes additional properties, ensuring no conflicts with existing properties.
|
|
63
|
-
def process_additional_properties(additional_properties, existing_prop_names)
|
|
64
|
-
hash = {}
|
|
65
|
-
additional_properties.each do |name, value|
|
|
66
|
-
check_for_conflict(name, existing_prop_names)
|
|
67
|
-
|
|
68
|
-
hash[name] = if value.is_a?(Array)
|
|
69
|
-
process_array(value)
|
|
70
|
-
elsif value.is_a?(Hash)
|
|
71
|
-
process_hash(value)
|
|
72
|
-
else
|
|
73
|
-
process_basic_value(value)
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
hash
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
# Checks if an additional property conflicts with a model's existing property.
|
|
80
|
-
def check_for_conflict(name, existing_prop_names)
|
|
81
|
-
return unless existing_prop_names.key?(name)
|
|
82
|
-
|
|
83
|
-
raise ArgumentError, "An additional property key, '#{name}' conflicts with one of the model's properties"
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
# Processes an array of values, recursively calling `to_hash` on BaseModel objects.
|
|
87
|
-
def process_array(value)
|
|
88
|
-
value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
# Processes a hash of values, recursively calling `to_hash` on BaseModel objects.
|
|
92
|
-
def process_hash(value)
|
|
93
|
-
value.transform_values do |v|
|
|
94
|
-
v.is_a?(BaseModel) ? v.to_hash : v
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
# Processes a basic value (non-array, non-hash).
|
|
99
|
-
def process_basic_value(value)
|
|
100
|
-
value.is_a?(BaseModel) ? value.to_hash : value
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
# Returns a JSON representation of the curent object.
|
|
104
|
-
def to_json(options = {})
|
|
105
|
-
hash = to_hash
|
|
106
|
-
hash.to_json(options)
|
|
107
|
-
end
|
|
108
|
-
end
|
|
109
|
-
# rubocop:enable all
|
|
110
|
-
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
|
+
# Base model.
|
|
8
|
+
# rubocop:disable all
|
|
9
|
+
class BaseModel < CoreLibrary::BaseModel
|
|
10
|
+
# Returns a Hash representation of the current object.
|
|
11
|
+
def to_hash
|
|
12
|
+
# validating the model being serialized
|
|
13
|
+
self.class.validate(self) if self.class.respond_to?(:validate)
|
|
14
|
+
|
|
15
|
+
hash = {}
|
|
16
|
+
instance_variables.each do |name|
|
|
17
|
+
value = instance_variable_get(name)
|
|
18
|
+
name = name[1..]
|
|
19
|
+
if name == 'additional_properties'
|
|
20
|
+
additional_properties = process_additional_properties(value, self.class.names)
|
|
21
|
+
hash.merge!(additional_properties)
|
|
22
|
+
else
|
|
23
|
+
key = self.class.names.key?(name) ? self.class.names[name] : name
|
|
24
|
+
optional_fields = self.class.optionals
|
|
25
|
+
nullable_fields = self.class.nullables
|
|
26
|
+
if value.nil?
|
|
27
|
+
next unless nullable_fields.include?(name)
|
|
28
|
+
|
|
29
|
+
if !optional_fields.include?(name) && !nullable_fields.include?(name)
|
|
30
|
+
raise ArgumentError,
|
|
31
|
+
"`#{name}` cannot be nil in `#{self.class}`. Please specify a valid value."
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
hash[key] = nil
|
|
36
|
+
unless value.nil?
|
|
37
|
+
if respond_to?("to_custom_#{name}")
|
|
38
|
+
if (value.instance_of? Array) || (value.instance_of? Hash)
|
|
39
|
+
params = [hash, key]
|
|
40
|
+
hash[key] = send("to_custom_#{name}", *params)
|
|
41
|
+
else
|
|
42
|
+
hash[key] = send("to_custom_#{name}")
|
|
43
|
+
end
|
|
44
|
+
elsif respond_to?("to_union_type_#{name}")
|
|
45
|
+
hash[key] = send("to_union_type_#{name}")
|
|
46
|
+
elsif value.instance_of? Array
|
|
47
|
+
hash[key] = value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
|
|
48
|
+
elsif value.instance_of? Hash
|
|
49
|
+
hash[key] = {}
|
|
50
|
+
value.each do |k, v|
|
|
51
|
+
hash[key][k] = v.is_a?(BaseModel) ? v.to_hash : v
|
|
52
|
+
end
|
|
53
|
+
else
|
|
54
|
+
hash[key] = value.is_a?(BaseModel) ? value.to_hash : value
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
hash
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Processes additional properties, ensuring no conflicts with existing properties.
|
|
63
|
+
def process_additional_properties(additional_properties, existing_prop_names)
|
|
64
|
+
hash = {}
|
|
65
|
+
additional_properties.each do |name, value|
|
|
66
|
+
check_for_conflict(name, existing_prop_names)
|
|
67
|
+
|
|
68
|
+
hash[name] = if value.is_a?(Array)
|
|
69
|
+
process_array(value)
|
|
70
|
+
elsif value.is_a?(Hash)
|
|
71
|
+
process_hash(value)
|
|
72
|
+
else
|
|
73
|
+
process_basic_value(value)
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
hash
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Checks if an additional property conflicts with a model's existing property.
|
|
80
|
+
def check_for_conflict(name, existing_prop_names)
|
|
81
|
+
return unless existing_prop_names.key?(name)
|
|
82
|
+
|
|
83
|
+
raise ArgumentError, "An additional property key, '#{name}' conflicts with one of the model's properties"
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Processes an array of values, recursively calling `to_hash` on BaseModel objects.
|
|
87
|
+
def process_array(value)
|
|
88
|
+
value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Processes a hash of values, recursively calling `to_hash` on BaseModel objects.
|
|
92
|
+
def process_hash(value)
|
|
93
|
+
value.transform_values do |v|
|
|
94
|
+
v.is_a?(BaseModel) ? v.to_hash : v
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Processes a basic value (non-array, non-hash).
|
|
99
|
+
def process_basic_value(value)
|
|
100
|
+
value.is_a?(BaseModel) ? value.to_hash : value
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Returns a JSON representation of the curent object.
|
|
104
|
+
def to_json(options = {})
|
|
105
|
+
hash = to_hash
|
|
106
|
+
hash.to_json(options)
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
# rubocop:enable all
|
|
110
|
+
end
|