apimatic-tql-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +210 -0
- data/bin/console +15 -0
- data/lib/tql_otr_factoring_data_exchange/api_helper.rb +10 -0
- data/lib/tql_otr_factoring_data_exchange/apis/assignments_api.rb +45 -0
- data/lib/tql_otr_factoring_data_exchange/apis/base_api.rb +67 -0
- data/lib/tql_otr_factoring_data_exchange/apis/documents_api.rb +82 -0
- data/lib/tql_otr_factoring_data_exchange/apis/invoices_api.rb +114 -0
- data/lib/tql_otr_factoring_data_exchange/apis/loads_api.rb +68 -0
- data/lib/tql_otr_factoring_data_exchange/apis/oauth_authorization_api.rb +44 -0
- data/lib/tql_otr_factoring_data_exchange/client.rb +104 -0
- data/lib/tql_otr_factoring_data_exchange/configuration.rb +164 -0
- data/lib/tql_otr_factoring_data_exchange/exceptions/api_exception.rb +21 -0
- data/lib/tql_otr_factoring_data_exchange/exceptions/oauth_provider_exception.rb +64 -0
- data/lib/tql_otr_factoring_data_exchange/exceptions/problem_details_error_exception.rb +58 -0
- data/lib/tql_otr_factoring_data_exchange/http/api_response.rb +19 -0
- data/lib/tql_otr_factoring_data_exchange/http/auth/oauth_2.rb +156 -0
- data/lib/tql_otr_factoring_data_exchange/http/http_call_back.rb +10 -0
- data/lib/tql_otr_factoring_data_exchange/http/http_method_enum.rb +10 -0
- data/lib/tql_otr_factoring_data_exchange/http/http_request.rb +10 -0
- data/lib/tql_otr_factoring_data_exchange/http/http_response.rb +10 -0
- data/lib/tql_otr_factoring_data_exchange/http/proxy_settings.rb +22 -0
- data/lib/tql_otr_factoring_data_exchange/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/tql_otr_factoring_data_exchange/logging/sdk_logger.rb +17 -0
- data/lib/tql_otr_factoring_data_exchange/models/assignment_request.rb +140 -0
- data/lib/tql_otr_factoring_data_exchange/models/assignment_response.rb +126 -0
- data/lib/tql_otr_factoring_data_exchange/models/assignment_status.rb +36 -0
- data/lib/tql_otr_factoring_data_exchange/models/base64_document.rb +118 -0
- data/lib/tql_otr_factoring_data_exchange/models/base64_document_upload_request.rb +107 -0
- data/lib/tql_otr_factoring_data_exchange/models/base_model.rb +110 -0
- data/lib/tql_otr_factoring_data_exchange/models/carrier.rb +98 -0
- data/lib/tql_otr_factoring_data_exchange/models/carrier1.rb +98 -0
- data/lib/tql_otr_factoring_data_exchange/models/carrier2.rb +98 -0
- data/lib/tql_otr_factoring_data_exchange/models/carrier_input.rb +123 -0
- data/lib/tql_otr_factoring_data_exchange/models/carrier_input1.rb +123 -0
- data/lib/tql_otr_factoring_data_exchange/models/charge_code.rb +126 -0
- data/lib/tql_otr_factoring_data_exchange/models/charge_code_origin.rb +49 -0
- data/lib/tql_otr_factoring_data_exchange/models/charge_input.rb +146 -0
- data/lib/tql_otr_factoring_data_exchange/models/document.rb +86 -0
- data/lib/tql_otr_factoring_data_exchange/models/document_type.rb +288 -0
- data/lib/tql_otr_factoring_data_exchange/models/document_upload_metadata.rb +111 -0
- data/lib/tql_otr_factoring_data_exchange/models/document_upload_response.rb +137 -0
- data/lib/tql_otr_factoring_data_exchange/models/exception_severity.rb +40 -0
- data/lib/tql_otr_factoring_data_exchange/models/factoring_company_input.rb +117 -0
- data/lib/tql_otr_factoring_data_exchange/models/invoice.rb +223 -0
- data/lib/tql_otr_factoring_data_exchange/models/invoice_exception.rb +136 -0
- data/lib/tql_otr_factoring_data_exchange/models/invoice_item_input.rb +165 -0
- data/lib/tql_otr_factoring_data_exchange/models/invoice_search_request.rb +242 -0
- data/lib/tql_otr_factoring_data_exchange/models/invoice_search_response.rb +124 -0
- data/lib/tql_otr_factoring_data_exchange/models/invoice_status.rb +74 -0
- data/lib/tql_otr_factoring_data_exchange/models/invoice_status_response.rb +193 -0
- data/lib/tql_otr_factoring_data_exchange/models/invoice_type.rb +50 -0
- data/lib/tql_otr_factoring_data_exchange/models/load.rb +110 -0
- data/lib/tql_otr_factoring_data_exchange/models/load_detail.rb +140 -0
- data/lib/tql_otr_factoring_data_exchange/models/load_search_request.rb +205 -0
- data/lib/tql_otr_factoring_data_exchange/models/load_search_response.rb +124 -0
- data/lib/tql_otr_factoring_data_exchange/models/load_status.rb +56 -0
- data/lib/tql_otr_factoring_data_exchange/models/location.rb +149 -0
- data/lib/tql_otr_factoring_data_exchange/models/oauth_provider_error.rb +62 -0
- data/lib/tql_otr_factoring_data_exchange/models/oauth_scope.rb +36 -0
- data/lib/tql_otr_factoring_data_exchange/models/oauth_token.rb +96 -0
- data/lib/tql_otr_factoring_data_exchange/models/payment.rb +108 -0
- data/lib/tql_otr_factoring_data_exchange/models/problem_details.rb +96 -0
- data/lib/tql_otr_factoring_data_exchange/models/reference_number_input.rb +109 -0
- data/lib/tql_otr_factoring_data_exchange/models/reference_type.rb +90 -0
- data/lib/tql_otr_factoring_data_exchange/models/status.rb +44 -0
- data/lib/tql_otr_factoring_data_exchange/models/stop_input.rb +121 -0
- data/lib/tql_otr_factoring_data_exchange/models/stop_type.rb +62 -0
- data/lib/tql_otr_factoring_data_exchange/models/submit_invoice_request.rb +326 -0
- data/lib/tql_otr_factoring_data_exchange/models/submit_invoice_response.rb +107 -0
- data/lib/tql_otr_factoring_data_exchange/models/weight_unit.rb +36 -0
- data/lib/tql_otr_factoring_data_exchange/utilities/date_time_helper.rb +11 -0
- data/lib/tql_otr_factoring_data_exchange/utilities/file_wrapper.rb +28 -0
- data/lib/tql_otr_factoring_data_exchange/utilities/union_type_lookup.rb +29 -0
- data/lib/tql_otr_factoring_data_exchange.rb +107 -0
- metadata +160 -0
|
@@ -0,0 +1,107 @@
|
|
|
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
|
+
# JSON request to upload a document as a base64-encoded string, linked to an
|
|
8
|
+
# invoice.
|
|
9
|
+
class Base64DocumentUploadRequest < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# The factoring company's invoice number this document is associated with.
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :invoice_number
|
|
16
|
+
|
|
17
|
+
# Document type classification used for categorizing uploaded documents.
|
|
18
|
+
# @return [DocumentType]
|
|
19
|
+
attr_accessor :document_type
|
|
20
|
+
|
|
21
|
+
# An optional document to include with the request, encoded as a base64
|
|
22
|
+
# string.
|
|
23
|
+
# @return [Base64Document]
|
|
24
|
+
attr_accessor :document
|
|
25
|
+
|
|
26
|
+
# Arbitrary key-value metadata tags for this document.
|
|
27
|
+
# @return [Hash[String, String]]
|
|
28
|
+
attr_accessor :tags
|
|
29
|
+
|
|
30
|
+
# A mapping from model property names to API property names.
|
|
31
|
+
def self.names
|
|
32
|
+
@_hash = {} if @_hash.nil?
|
|
33
|
+
@_hash['invoice_number'] = 'invoiceNumber'
|
|
34
|
+
@_hash['document_type'] = 'documentType'
|
|
35
|
+
@_hash['document'] = 'document'
|
|
36
|
+
@_hash['tags'] = 'tags'
|
|
37
|
+
@_hash
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# An array for optional fields
|
|
41
|
+
def self.optionals
|
|
42
|
+
%w[
|
|
43
|
+
tags
|
|
44
|
+
]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# An array for nullable fields
|
|
48
|
+
def self.nullables
|
|
49
|
+
%w[
|
|
50
|
+
document
|
|
51
|
+
tags
|
|
52
|
+
]
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def initialize(invoice_number:, document_type:, document:, tags: SKIP,
|
|
56
|
+
additional_properties: nil)
|
|
57
|
+
# Add additional model properties to the instance
|
|
58
|
+
additional_properties = {} if additional_properties.nil?
|
|
59
|
+
|
|
60
|
+
@invoice_number = invoice_number
|
|
61
|
+
@document_type = document_type
|
|
62
|
+
@document = document
|
|
63
|
+
@tags = tags unless tags == SKIP
|
|
64
|
+
@additional_properties = additional_properties
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Creates an instance of the object from a hash.
|
|
68
|
+
def self.from_hash(hash)
|
|
69
|
+
return nil unless hash
|
|
70
|
+
|
|
71
|
+
# Extract variables from the hash.
|
|
72
|
+
invoice_number = hash.key?('invoiceNumber') ? hash['invoiceNumber'] : nil
|
|
73
|
+
document_type = hash.key?('documentType') ? hash['documentType'] : nil
|
|
74
|
+
document = Base64Document.from_hash(hash['document']) if hash['document']
|
|
75
|
+
tags = hash.key?('tags') ? hash['tags'] : SKIP
|
|
76
|
+
|
|
77
|
+
# Create a new hash for additional properties, removing known properties.
|
|
78
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
79
|
+
|
|
80
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
81
|
+
new_hash, proc { |value| value }
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
# Create object from extracted values.
|
|
85
|
+
Base64DocumentUploadRequest.new(invoice_number: invoice_number,
|
|
86
|
+
document_type: document_type,
|
|
87
|
+
document: document,
|
|
88
|
+
tags: tags,
|
|
89
|
+
additional_properties: additional_properties)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Provides a human-readable string representation of the object.
|
|
93
|
+
def to_s
|
|
94
|
+
class_name = self.class.name.split('::').last
|
|
95
|
+
"<#{class_name} invoice_number: #{@invoice_number}, document_type: #{@document_type},"\
|
|
96
|
+
" document: #{@document}, tags: #{@tags}, additional_properties: #{@additional_properties}>"
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
100
|
+
def inspect
|
|
101
|
+
class_name = self.class.name.split('::').last
|
|
102
|
+
"<#{class_name} invoice_number: #{@invoice_number.inspect}, document_type:"\
|
|
103
|
+
" #{@document_type.inspect}, document: #{@document.inspect}, tags: #{@tags.inspect},"\
|
|
104
|
+
" additional_properties: #{@additional_properties}>"
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
# 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
|
|
@@ -0,0 +1,98 @@
|
|
|
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
|
+
# Carrier details associated with this invoice.
|
|
8
|
+
class Carrier < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Legal or DBA name of the carrier.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :name
|
|
15
|
+
|
|
16
|
+
# USDOT number.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :dot_number
|
|
19
|
+
|
|
20
|
+
# Motor Carrier (MC) number.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :mc_number
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['name'] = 'name'
|
|
28
|
+
@_hash['dot_number'] = 'dotNumber'
|
|
29
|
+
@_hash['mc_number'] = 'mcNumber'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
name
|
|
37
|
+
dot_number
|
|
38
|
+
mc_number
|
|
39
|
+
]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# An array for nullable fields
|
|
43
|
+
def self.nullables
|
|
44
|
+
%w[
|
|
45
|
+
dot_number
|
|
46
|
+
mc_number
|
|
47
|
+
]
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def initialize(name: SKIP, dot_number: SKIP, mc_number: SKIP,
|
|
51
|
+
additional_properties: nil)
|
|
52
|
+
# Add additional model properties to the instance
|
|
53
|
+
additional_properties = {} if additional_properties.nil?
|
|
54
|
+
|
|
55
|
+
@name = name unless name == SKIP
|
|
56
|
+
@dot_number = dot_number unless dot_number == SKIP
|
|
57
|
+
@mc_number = mc_number unless mc_number == SKIP
|
|
58
|
+
@additional_properties = additional_properties
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Creates an instance of the object from a hash.
|
|
62
|
+
def self.from_hash(hash)
|
|
63
|
+
return nil unless hash
|
|
64
|
+
|
|
65
|
+
# Extract variables from the hash.
|
|
66
|
+
name = hash.key?('name') ? hash['name'] : SKIP
|
|
67
|
+
dot_number = hash.key?('dotNumber') ? hash['dotNumber'] : SKIP
|
|
68
|
+
mc_number = hash.key?('mcNumber') ? hash['mcNumber'] : SKIP
|
|
69
|
+
|
|
70
|
+
# Create a new hash for additional properties, removing known properties.
|
|
71
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
72
|
+
|
|
73
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
74
|
+
new_hash, proc { |value| value }
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
# Create object from extracted values.
|
|
78
|
+
Carrier.new(name: name,
|
|
79
|
+
dot_number: dot_number,
|
|
80
|
+
mc_number: mc_number,
|
|
81
|
+
additional_properties: additional_properties)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Provides a human-readable string representation of the object.
|
|
85
|
+
def to_s
|
|
86
|
+
class_name = self.class.name.split('::').last
|
|
87
|
+
"<#{class_name} name: #{@name}, dot_number: #{@dot_number}, mc_number: #{@mc_number},"\
|
|
88
|
+
" additional_properties: #{@additional_properties}>"
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
92
|
+
def inspect
|
|
93
|
+
class_name = self.class.name.split('::').last
|
|
94
|
+
"<#{class_name} name: #{@name.inspect}, dot_number: #{@dot_number.inspect}, mc_number:"\
|
|
95
|
+
" #{@mc_number.inspect}, additional_properties: #{@additional_properties}>"
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
@@ -0,0 +1,98 @@
|
|
|
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
|
+
# Carrier that was assigned/unassigned.
|
|
8
|
+
class Carrier1 < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :carrier_name
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :mc_number
|
|
19
|
+
|
|
20
|
+
# TODO: Write general description for this method
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :dot_number
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['carrier_name'] = 'carrierName'
|
|
28
|
+
@_hash['mc_number'] = 'mcNumber'
|
|
29
|
+
@_hash['dot_number'] = 'dotNumber'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
carrier_name
|
|
37
|
+
mc_number
|
|
38
|
+
dot_number
|
|
39
|
+
]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# An array for nullable fields
|
|
43
|
+
def self.nullables
|
|
44
|
+
%w[
|
|
45
|
+
mc_number
|
|
46
|
+
dot_number
|
|
47
|
+
]
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def initialize(carrier_name: SKIP, mc_number: SKIP, dot_number: SKIP,
|
|
51
|
+
additional_properties: nil)
|
|
52
|
+
# Add additional model properties to the instance
|
|
53
|
+
additional_properties = {} if additional_properties.nil?
|
|
54
|
+
|
|
55
|
+
@carrier_name = carrier_name unless carrier_name == SKIP
|
|
56
|
+
@mc_number = mc_number unless mc_number == SKIP
|
|
57
|
+
@dot_number = dot_number unless dot_number == SKIP
|
|
58
|
+
@additional_properties = additional_properties
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Creates an instance of the object from a hash.
|
|
62
|
+
def self.from_hash(hash)
|
|
63
|
+
return nil unless hash
|
|
64
|
+
|
|
65
|
+
# Extract variables from the hash.
|
|
66
|
+
carrier_name = hash.key?('carrierName') ? hash['carrierName'] : SKIP
|
|
67
|
+
mc_number = hash.key?('mcNumber') ? hash['mcNumber'] : SKIP
|
|
68
|
+
dot_number = hash.key?('dotNumber') ? hash['dotNumber'] : SKIP
|
|
69
|
+
|
|
70
|
+
# Create a new hash for additional properties, removing known properties.
|
|
71
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
72
|
+
|
|
73
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
74
|
+
new_hash, proc { |value| value }
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
# Create object from extracted values.
|
|
78
|
+
Carrier1.new(carrier_name: carrier_name,
|
|
79
|
+
mc_number: mc_number,
|
|
80
|
+
dot_number: dot_number,
|
|
81
|
+
additional_properties: additional_properties)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Provides a human-readable string representation of the object.
|
|
85
|
+
def to_s
|
|
86
|
+
class_name = self.class.name.split('::').last
|
|
87
|
+
"<#{class_name} carrier_name: #{@carrier_name}, mc_number: #{@mc_number}, dot_number:"\
|
|
88
|
+
" #{@dot_number}, additional_properties: #{@additional_properties}>"
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
92
|
+
def inspect
|
|
93
|
+
class_name = self.class.name.split('::').last
|
|
94
|
+
"<#{class_name} carrier_name: #{@carrier_name.inspect}, mc_number: #{@mc_number.inspect},"\
|
|
95
|
+
" dot_number: #{@dot_number.inspect}, additional_properties: #{@additional_properties}>"
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
@@ -0,0 +1,98 @@
|
|
|
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
|
+
# Carrier assigned to this load.
|
|
8
|
+
class Carrier2 < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Legal or DBA name of the carrier.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :carrier_name
|
|
15
|
+
|
|
16
|
+
# Motor Carrier (MC) number.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :mc_number
|
|
19
|
+
|
|
20
|
+
# USDOT number.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :dot_number
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['carrier_name'] = 'carrierName'
|
|
28
|
+
@_hash['mc_number'] = 'mcNumber'
|
|
29
|
+
@_hash['dot_number'] = 'dotNumber'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
carrier_name
|
|
37
|
+
mc_number
|
|
38
|
+
dot_number
|
|
39
|
+
]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# An array for nullable fields
|
|
43
|
+
def self.nullables
|
|
44
|
+
%w[
|
|
45
|
+
mc_number
|
|
46
|
+
dot_number
|
|
47
|
+
]
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def initialize(carrier_name: SKIP, mc_number: SKIP, dot_number: SKIP,
|
|
51
|
+
additional_properties: nil)
|
|
52
|
+
# Add additional model properties to the instance
|
|
53
|
+
additional_properties = {} if additional_properties.nil?
|
|
54
|
+
|
|
55
|
+
@carrier_name = carrier_name unless carrier_name == SKIP
|
|
56
|
+
@mc_number = mc_number unless mc_number == SKIP
|
|
57
|
+
@dot_number = dot_number unless dot_number == SKIP
|
|
58
|
+
@additional_properties = additional_properties
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Creates an instance of the object from a hash.
|
|
62
|
+
def self.from_hash(hash)
|
|
63
|
+
return nil unless hash
|
|
64
|
+
|
|
65
|
+
# Extract variables from the hash.
|
|
66
|
+
carrier_name = hash.key?('carrierName') ? hash['carrierName'] : SKIP
|
|
67
|
+
mc_number = hash.key?('mcNumber') ? hash['mcNumber'] : SKIP
|
|
68
|
+
dot_number = hash.key?('dotNumber') ? hash['dotNumber'] : SKIP
|
|
69
|
+
|
|
70
|
+
# Create a new hash for additional properties, removing known properties.
|
|
71
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
72
|
+
|
|
73
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
74
|
+
new_hash, proc { |value| value }
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
# Create object from extracted values.
|
|
78
|
+
Carrier2.new(carrier_name: carrier_name,
|
|
79
|
+
mc_number: mc_number,
|
|
80
|
+
dot_number: dot_number,
|
|
81
|
+
additional_properties: additional_properties)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Provides a human-readable string representation of the object.
|
|
85
|
+
def to_s
|
|
86
|
+
class_name = self.class.name.split('::').last
|
|
87
|
+
"<#{class_name} carrier_name: #{@carrier_name}, mc_number: #{@mc_number}, dot_number:"\
|
|
88
|
+
" #{@dot_number}, additional_properties: #{@additional_properties}>"
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
92
|
+
def inspect
|
|
93
|
+
class_name = self.class.name.split('::').last
|
|
94
|
+
"<#{class_name} carrier_name: #{@carrier_name.inspect}, mc_number: #{@mc_number.inspect},"\
|
|
95
|
+
" dot_number: #{@dot_number.inspect}, additional_properties: #{@additional_properties}>"
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
@@ -0,0 +1,123 @@
|
|
|
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
|
+
# CarrierInput Model.
|
|
8
|
+
class CarrierInput < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Legal or DBA name of the carrier.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :carrier_name
|
|
15
|
+
|
|
16
|
+
# Motor Carrier (MC) number issued by [FMCSA](https://www.fmcsa.dot.gov/).
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :mc_number
|
|
19
|
+
|
|
20
|
+
# USDOT number issued by [FMCSA](https://www.fmcsa.dot.gov/).
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :dot_number
|
|
23
|
+
|
|
24
|
+
# Standard Carrier Alpha Code
|
|
25
|
+
# ([SCAC](https://nmfta.org/registration-listing/scac/)).
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :scac
|
|
28
|
+
|
|
29
|
+
# A mapping from model property names to API property names.
|
|
30
|
+
def self.names
|
|
31
|
+
@_hash = {} if @_hash.nil?
|
|
32
|
+
@_hash['carrier_name'] = 'carrierName'
|
|
33
|
+
@_hash['mc_number'] = 'mcNumber'
|
|
34
|
+
@_hash['dot_number'] = 'dotNumber'
|
|
35
|
+
@_hash['scac'] = 'scac'
|
|
36
|
+
@_hash
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# An array for optional fields
|
|
40
|
+
def self.optionals
|
|
41
|
+
%w[
|
|
42
|
+
carrier_name
|
|
43
|
+
dot_number
|
|
44
|
+
scac
|
|
45
|
+
]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# An array for nullable fields
|
|
49
|
+
def self.nullables
|
|
50
|
+
%w[
|
|
51
|
+
mc_number
|
|
52
|
+
dot_number
|
|
53
|
+
scac
|
|
54
|
+
]
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def initialize(mc_number:, carrier_name: SKIP, dot_number: SKIP, scac: SKIP,
|
|
58
|
+
additional_properties: nil)
|
|
59
|
+
# Add additional model properties to the instance
|
|
60
|
+
additional_properties = {} if additional_properties.nil?
|
|
61
|
+
|
|
62
|
+
@carrier_name = carrier_name unless carrier_name == SKIP
|
|
63
|
+
@mc_number = mc_number
|
|
64
|
+
@dot_number = dot_number unless dot_number == SKIP
|
|
65
|
+
@scac = scac unless scac == SKIP
|
|
66
|
+
@additional_properties = additional_properties
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Creates an instance of the object from a hash.
|
|
70
|
+
def self.from_hash(hash)
|
|
71
|
+
return nil unless hash
|
|
72
|
+
|
|
73
|
+
# Extract variables from the hash.
|
|
74
|
+
mc_number = hash.key?('mcNumber') ? hash['mcNumber'] : nil
|
|
75
|
+
carrier_name = hash.key?('carrierName') ? hash['carrierName'] : SKIP
|
|
76
|
+
dot_number = hash.key?('dotNumber') ? hash['dotNumber'] : SKIP
|
|
77
|
+
scac = hash.key?('scac') ? hash['scac'] : SKIP
|
|
78
|
+
|
|
79
|
+
# Create a new hash for additional properties, removing known properties.
|
|
80
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
81
|
+
|
|
82
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
83
|
+
new_hash, proc { |value| value }
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
# Create object from extracted values.
|
|
87
|
+
CarrierInput.new(mc_number: mc_number,
|
|
88
|
+
carrier_name: carrier_name,
|
|
89
|
+
dot_number: dot_number,
|
|
90
|
+
scac: scac,
|
|
91
|
+
additional_properties: additional_properties)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Validates an instance of the object from a given value.
|
|
95
|
+
# @param [CarrierInput | Hash] The value against the validation is performed.
|
|
96
|
+
def self.validate(value)
|
|
97
|
+
if value.instance_of? self
|
|
98
|
+
return APIHelper.valid_type?(value.mc_number,
|
|
99
|
+
->(val) { val.instance_of? String })
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
return false unless value.instance_of? Hash
|
|
103
|
+
|
|
104
|
+
APIHelper.valid_type?(value['mcNumber'],
|
|
105
|
+
->(val) { val.instance_of? String })
|
|
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} carrier_name: #{@carrier_name}, mc_number: #{@mc_number}, dot_number:"\
|
|
112
|
+
" #{@dot_number}, scac: #{@scac}, additional_properties: #{@additional_properties}>"
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
116
|
+
def inspect
|
|
117
|
+
class_name = self.class.name.split('::').last
|
|
118
|
+
"<#{class_name} carrier_name: #{@carrier_name.inspect}, mc_number: #{@mc_number.inspect},"\
|
|
119
|
+
" dot_number: #{@dot_number.inspect}, scac: #{@scac.inspect}, additional_properties:"\
|
|
120
|
+
" #{@additional_properties}>"
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|