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,124 +0,0 @@
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
- # Paginated list of load search results.
8
- class LoadSearchResponse < BaseModel
9
- SKIP = Object.new
10
- private_constant :SKIP
11
-
12
- # Current page number.
13
- # @return [Integer]
14
- attr_accessor :page
15
-
16
- # Number of results per page.
17
- # @return [Integer]
18
- attr_accessor :page_size
19
-
20
- # Total number of loads matching the search criteria.
21
- # @return [Integer]
22
- attr_accessor :total_count
23
-
24
- # Total number of pages.
25
- # @return [Integer]
26
- attr_accessor :total_pages
27
-
28
- # Loads matching the search criteria for this page.
29
- # @return [Array[LoadDetail]]
30
- attr_accessor :results
31
-
32
- # A mapping from model property names to API property names.
33
- def self.names
34
- @_hash = {} if @_hash.nil?
35
- @_hash['page'] = 'page'
36
- @_hash['page_size'] = 'pageSize'
37
- @_hash['total_count'] = 'totalCount'
38
- @_hash['total_pages'] = 'totalPages'
39
- @_hash['results'] = 'results'
40
- @_hash
41
- end
42
-
43
- # An array for optional fields
44
- def self.optionals
45
- %w[
46
- page
47
- page_size
48
- total_count
49
- total_pages
50
- results
51
- ]
52
- end
53
-
54
- # An array for nullable fields
55
- def self.nullables
56
- []
57
- end
58
-
59
- def initialize(page: SKIP, page_size: SKIP, total_count: SKIP,
60
- total_pages: SKIP, results: SKIP, additional_properties: nil)
61
- # Add additional model properties to the instance
62
- additional_properties = {} if additional_properties.nil?
63
-
64
- @page = page unless page == SKIP
65
- @page_size = page_size unless page_size == SKIP
66
- @total_count = total_count unless total_count == SKIP
67
- @total_pages = total_pages unless total_pages == SKIP
68
- @results = results unless results == SKIP
69
- @additional_properties = additional_properties
70
- end
71
-
72
- # Creates an instance of the object from a hash.
73
- def self.from_hash(hash)
74
- return nil unless hash
75
-
76
- # Extract variables from the hash.
77
- page = hash.key?('page') ? hash['page'] : SKIP
78
- page_size = hash.key?('pageSize') ? hash['pageSize'] : SKIP
79
- total_count = hash.key?('totalCount') ? hash['totalCount'] : SKIP
80
- total_pages = hash.key?('totalPages') ? hash['totalPages'] : SKIP
81
- # Parameter is an array, so we need to iterate through it
82
- results = nil
83
- unless hash['results'].nil?
84
- results = []
85
- hash['results'].each do |structure|
86
- results << (LoadDetail.from_hash(structure) if structure)
87
- end
88
- end
89
-
90
- results = SKIP unless hash.key?('results')
91
-
92
- # Create a new hash for additional properties, removing known properties.
93
- new_hash = hash.reject { |k, _| names.value?(k) }
94
-
95
- additional_properties = APIHelper.get_additional_properties(
96
- new_hash, proc { |value| value }
97
- )
98
-
99
- # Create object from extracted values.
100
- LoadSearchResponse.new(page: page,
101
- page_size: page_size,
102
- total_count: total_count,
103
- total_pages: total_pages,
104
- results: results,
105
- additional_properties: additional_properties)
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} page: #{@page}, page_size: #{@page_size}, total_count: #{@total_count},"\
112
- " total_pages: #{@total_pages}, results: #{@results}, additional_properties:"\
113
- " #{@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} page: #{@page.inspect}, page_size: #{@page_size.inspect}, total_count:"\
120
- " #{@total_count.inspect}, total_pages: #{@total_pages.inspect}, results:"\
121
- " #{@results.inspect}, additional_properties: #{@additional_properties}>"
122
- end
123
- end
124
- end
@@ -1,56 +0,0 @@
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
- # Current status of a TQL load.
8
- class LoadStatus
9
- LOAD_STATUS = [
10
- # TODO: Write general description for AVAILABLE
11
- AVAILABLE = 'Available'.freeze,
12
-
13
- # TODO: Write general description for BOOKED
14
- BOOKED = 'Booked'.freeze,
15
-
16
- # TODO: Write general description for DISPATCHED
17
- DISPATCHED = 'Dispatched'.freeze,
18
-
19
- # TODO: Write general description for INTRANSIT
20
- INTRANSIT = 'InTransit'.freeze,
21
-
22
- # TODO: Write general description for DELIVERED
23
- DELIVERED = 'Delivered'.freeze,
24
-
25
- # TODO: Write general description for COMPLETED
26
- COMPLETED = 'Completed'.freeze,
27
-
28
- # TODO: Write general description for CANCELLED
29
- CANCELLED = 'Cancelled'.freeze
30
- ].freeze
31
-
32
- def self.validate(value)
33
- return false if value.nil?
34
-
35
- LOAD_STATUS.include?(value)
36
- end
37
-
38
- def self.from_value(value, default_value = AVAILABLE)
39
- return default_value if value.nil?
40
-
41
- str = value.to_s.strip
42
-
43
- case str.downcase
44
- when 'available' then AVAILABLE
45
- when 'booked' then BOOKED
46
- when 'dispatched' then DISPATCHED
47
- when 'intransit' then INTRANSIT
48
- when 'delivered' then DELIVERED
49
- when 'completed' then COMPLETED
50
- when 'cancelled' then CANCELLED
51
- else
52
- default_value
53
- end
54
- end
55
- end
56
- end
@@ -1,149 +0,0 @@
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
- # Physical address of the stop.
8
- class Location < BaseModel
9
- SKIP = Object.new
10
- private_constant :SKIP
11
-
12
- # Facility or company name at this stop.
13
- # @return [String]
14
- attr_accessor :name
15
-
16
- # Street address line 1.
17
- # @return [String]
18
- attr_accessor :address
19
-
20
- # Street address line 2 (suite, unit, dock, etc.).
21
- # @return [String]
22
- attr_accessor :address2
23
-
24
- # City name.
25
- # @return [String]
26
- attr_accessor :city
27
-
28
- # Two-letter state/province code.
29
- # @return [String]
30
- attr_accessor :state
31
-
32
- # ZIP or postal code.
33
- # @return [String]
34
- attr_accessor :postal_code
35
-
36
- # [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) alpha-2
37
- # country code.
38
- # @return [String]
39
- attr_accessor :country
40
-
41
- # A mapping from model property names to API property names.
42
- def self.names
43
- @_hash = {} if @_hash.nil?
44
- @_hash['name'] = 'name'
45
- @_hash['address'] = 'address'
46
- @_hash['address2'] = 'address2'
47
- @_hash['city'] = 'city'
48
- @_hash['state'] = 'state'
49
- @_hash['postal_code'] = 'postalCode'
50
- @_hash['country'] = 'country'
51
- @_hash
52
- end
53
-
54
- # An array for optional fields
55
- def self.optionals
56
- %w[
57
- name
58
- address
59
- address2
60
- city
61
- state
62
- postal_code
63
- country
64
- ]
65
- end
66
-
67
- # An array for nullable fields
68
- def self.nullables
69
- %w[
70
- name
71
- address2
72
- ]
73
- end
74
-
75
- def initialize(name: SKIP, address: SKIP, address2: SKIP, city: SKIP,
76
- state: SKIP, postal_code: SKIP, country: 'US',
77
- additional_properties: nil)
78
- # Add additional model properties to the instance
79
- additional_properties = {} if additional_properties.nil?
80
-
81
- @name = name unless name == SKIP
82
- @address = address unless address == SKIP
83
- @address2 = address2 unless address2 == SKIP
84
- @city = city unless city == SKIP
85
- @state = state unless state == SKIP
86
- @postal_code = postal_code unless postal_code == SKIP
87
- @country = country unless country == SKIP
88
- @additional_properties = additional_properties
89
- end
90
-
91
- # Creates an instance of the object from a hash.
92
- def self.from_hash(hash)
93
- return nil unless hash
94
-
95
- # Extract variables from the hash.
96
- name = hash.key?('name') ? hash['name'] : SKIP
97
- address = hash.key?('address') ? hash['address'] : SKIP
98
- address2 = hash.key?('address2') ? hash['address2'] : SKIP
99
- city = hash.key?('city') ? hash['city'] : SKIP
100
- state = hash.key?('state') ? hash['state'] : SKIP
101
- postal_code = hash.key?('postalCode') ? hash['postalCode'] : SKIP
102
- country = hash['country'] ||= 'US'
103
-
104
- # Create a new hash for additional properties, removing known properties.
105
- new_hash = hash.reject { |k, _| names.value?(k) }
106
-
107
- additional_properties = APIHelper.get_additional_properties(
108
- new_hash, proc { |value| value }
109
- )
110
-
111
- # Create object from extracted values.
112
- Location.new(name: name,
113
- address: address,
114
- address2: address2,
115
- city: city,
116
- state: state,
117
- postal_code: postal_code,
118
- country: country,
119
- additional_properties: additional_properties)
120
- end
121
-
122
- # Validates an instance of the object from a given value.
123
- # @param [Location | Hash] The value against the validation is performed.
124
- def self.validate(value)
125
- return true if value.instance_of? self
126
-
127
- return false unless value.instance_of? Hash
128
-
129
- true
130
- end
131
-
132
- # Provides a human-readable string representation of the object.
133
- def to_s
134
- class_name = self.class.name.split('::').last
135
- "<#{class_name} name: #{@name}, address: #{@address}, address2: #{@address2}, city:"\
136
- " #{@city}, state: #{@state}, postal_code: #{@postal_code}, country: #{@country},"\
137
- " additional_properties: #{@additional_properties}>"
138
- end
139
-
140
- # Provides a debugging-friendly string with detailed object information.
141
- def inspect
142
- class_name = self.class.name.split('::').last
143
- "<#{class_name} name: #{@name.inspect}, address: #{@address.inspect}, address2:"\
144
- " #{@address2.inspect}, city: #{@city.inspect}, state: #{@state.inspect}, postal_code:"\
145
- " #{@postal_code.inspect}, country: #{@country.inspect}, additional_properties:"\
146
- " #{@additional_properties}>"
147
- end
148
- end
149
- end
@@ -1,62 +0,0 @@
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
- # OAuth 2 Authorization error codes
8
- class OauthProviderError
9
- OAUTH_PROVIDER_ERROR = [
10
- # The request is missing a required parameter, includes an unsupported
11
- # parameter value (other than grant type), repeats a parameter, includes
12
- # multiple credentials, utilizes more than one mechanism for
13
- # authenticating the client, or is otherwise malformed.
14
- INVALID_REQUEST = 'invalid_request'.freeze,
15
-
16
- # Client authentication failed (e.g., unknown client, no client
17
- # authentication included, or unsupported authentication method).
18
- INVALID_CLIENT = 'invalid_client'.freeze,
19
-
20
- # The provided authorization grant (e.g., authorization code, resource
21
- # owner credentials) or refresh token is invalid, expired, revoked, does
22
- # not match the redirection URI used in the authorization request, or was
23
- # issued to another client.
24
- INVALID_GRANT = 'invalid_grant'.freeze,
25
-
26
- # The authenticated client is not authorized to use this authorization
27
- # grant type.
28
- UNAUTHORIZED_CLIENT = 'unauthorized_client'.freeze,
29
-
30
- # The authorization grant type is not supported by the authorization
31
- # server.
32
- UNSUPPORTED_GRANT_TYPE = 'unsupported_grant_type'.freeze,
33
-
34
- # The requested scope is invalid, unknown, malformed, or exceeds the scope
35
- # granted by the resource owner.
36
- INVALID_SCOPE = 'invalid_scope'.freeze
37
- ].freeze
38
-
39
- def self.validate(value)
40
- return false if value.nil?
41
-
42
- OAUTH_PROVIDER_ERROR.include?(value)
43
- end
44
-
45
- def self.from_value(value, default_value = INVALID_REQUEST)
46
- return default_value if value.nil?
47
-
48
- str = value.to_s.strip
49
-
50
- case str.downcase
51
- when 'invalid_request' then INVALID_REQUEST
52
- when 'invalid_client' then INVALID_CLIENT
53
- when 'invalid_grant' then INVALID_GRANT
54
- when 'unauthorized_client' then UNAUTHORIZED_CLIENT
55
- when 'unsupported_grant_type' then UNSUPPORTED_GRANT_TYPE
56
- when 'invalid_scope' then INVALID_SCOPE
57
- else
58
- default_value
59
- end
60
- end
61
- end
62
- end
@@ -1,36 +0,0 @@
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
- # OAuth 2 scopes supported by the API
8
- class OauthScope
9
- OAUTH_SCOPE = [
10
- # Submit invoices, upload documents, manage assignments
11
- FACTORING_WRITE = 'Factoring.Write'.freeze,
12
-
13
- # Query invoice status, search invoices
14
- FACTORING_READ = 'Factoring.Read'.freeze
15
- ].freeze
16
-
17
- def self.validate(value)
18
- return false if value.nil?
19
-
20
- OAUTH_SCOPE.include?(value)
21
- end
22
-
23
- def self.from_value(value, default_value = FACTORING_WRITE)
24
- return default_value if value.nil?
25
-
26
- str = value.to_s.strip
27
-
28
- case str.downcase
29
- when 'factoring_write' then FACTORING_WRITE
30
- when 'factoring_read' then FACTORING_READ
31
- else
32
- default_value
33
- end
34
- end
35
- end
36
- end
@@ -1,96 +0,0 @@
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
- # OAuth 2 Authorization endpoint response
8
- class OauthToken < BaseModel
9
- SKIP = Object.new
10
- private_constant :SKIP
11
-
12
- # Access token
13
- # @return [String]
14
- attr_accessor :access_token
15
-
16
- # Type of access token
17
- # @return [String]
18
- attr_accessor :token_type
19
-
20
- # Time in seconds before the access token expires
21
- # @return [Integer]
22
- attr_accessor :expires_in
23
-
24
- # List of scopes granted
25
- # This is a space-delimited list of strings.
26
- # @return [String]
27
- attr_accessor :scope
28
-
29
- # Time of token expiry as unix timestamp (UTC)
30
- # @return [Integer]
31
- attr_accessor :expiry
32
-
33
- # Refresh token
34
- # Used to get a new access token when it expires.
35
- # @return [String]
36
- attr_accessor :refresh_token
37
-
38
- # A mapping from model property names to API property names.
39
- def self.names
40
- @_hash = {} if @_hash.nil?
41
- @_hash['access_token'] = 'access_token'
42
- @_hash['token_type'] = 'token_type'
43
- @_hash['expires_in'] = 'expires_in'
44
- @_hash['scope'] = 'scope'
45
- @_hash['expiry'] = 'expiry'
46
- @_hash['refresh_token'] = 'refresh_token'
47
- @_hash
48
- end
49
-
50
- # An array for optional fields
51
- def self.optionals
52
- %w[
53
- expires_in
54
- scope
55
- expiry
56
- refresh_token
57
- ]
58
- end
59
-
60
- # An array for nullable fields
61
- def self.nullables
62
- []
63
- end
64
-
65
- def initialize(access_token:, token_type:, expires_in: SKIP, scope: SKIP,
66
- expiry: SKIP, refresh_token: SKIP)
67
- @access_token = access_token
68
- @token_type = token_type
69
- @expires_in = expires_in unless expires_in == SKIP
70
- @scope = scope unless scope == SKIP
71
- @expiry = expiry unless expiry == SKIP
72
- @refresh_token = refresh_token unless refresh_token == SKIP
73
- end
74
-
75
- # Creates an instance of the object from a hash.
76
- def self.from_hash(hash)
77
- return nil unless hash
78
-
79
- # Extract variables from the hash.
80
- access_token = hash.key?('access_token') ? hash['access_token'] : nil
81
- token_type = hash.key?('token_type') ? hash['token_type'] : nil
82
- expires_in = hash.key?('expires_in') ? hash['expires_in'] : SKIP
83
- scope = hash.key?('scope') ? hash['scope'] : SKIP
84
- expiry = hash.key?('expiry') ? hash['expiry'] : SKIP
85
- refresh_token = hash.key?('refresh_token') ? hash['refresh_token'] : SKIP
86
-
87
- # Create object from extracted values.
88
- OauthToken.new(access_token: access_token,
89
- token_type: token_type,
90
- expires_in: expires_in,
91
- scope: scope,
92
- expiry: expiry,
93
- refresh_token: refresh_token)
94
- end
95
- end
96
- end
@@ -1,96 +0,0 @@
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
- # [RFC 7807](https://datatracker.ietf.org/doc/html/rfc7807) Problem Details
8
- # response returned for validation errors and other non-success outcomes.
9
- class ProblemDetails < BaseModel
10
- SKIP = Object.new
11
- private_constant :SKIP
12
-
13
- # Short, human-readable summary of the problem type.
14
- # @return [String]
15
- attr_accessor :title
16
-
17
- # HTTP status code.
18
- # @return [Integer]
19
- attr_accessor :status
20
-
21
- # Detailed, human-readable explanation specific to this occurrence.
22
- # @return [String]
23
- attr_accessor :detail
24
-
25
- # A mapping from model property names to API property names.
26
- def self.names
27
- @_hash = {} if @_hash.nil?
28
- @_hash['title'] = 'title'
29
- @_hash['status'] = 'status'
30
- @_hash['detail'] = 'detail'
31
- @_hash
32
- end
33
-
34
- # An array for optional fields
35
- def self.optionals
36
- %w[
37
- title
38
- status
39
- detail
40
- ]
41
- end
42
-
43
- # An array for nullable fields
44
- def self.nullables
45
- []
46
- end
47
-
48
- def initialize(title: SKIP, status: SKIP, detail: SKIP,
49
- additional_properties: nil)
50
- # Add additional model properties to the instance
51
- additional_properties = {} if additional_properties.nil?
52
-
53
- @title = title unless title == SKIP
54
- @status = status unless status == SKIP
55
- @detail = detail unless detail == SKIP
56
- @additional_properties = additional_properties
57
- end
58
-
59
- # Creates an instance of the object from a hash.
60
- def self.from_hash(hash)
61
- return nil unless hash
62
-
63
- # Extract variables from the hash.
64
- title = hash.key?('title') ? hash['title'] : SKIP
65
- status = hash.key?('status') ? hash['status'] : SKIP
66
- detail = hash.key?('detail') ? hash['detail'] : SKIP
67
-
68
- # Create a new hash for additional properties, removing known properties.
69
- new_hash = hash.reject { |k, _| names.value?(k) }
70
-
71
- additional_properties = APIHelper.get_additional_properties(
72
- new_hash, proc { |value| value }
73
- )
74
-
75
- # Create object from extracted values.
76
- ProblemDetails.new(title: title,
77
- status: status,
78
- detail: detail,
79
- additional_properties: additional_properties)
80
- end
81
-
82
- # Provides a human-readable string representation of the object.
83
- def to_s
84
- class_name = self.class.name.split('::').last
85
- "<#{class_name} title: #{@title}, status: #{@status}, detail: #{@detail},"\
86
- " additional_properties: #{@additional_properties}>"
87
- end
88
-
89
- # Provides a debugging-friendly string with detailed object information.
90
- def inspect
91
- class_name = self.class.name.split('::').last
92
- "<#{class_name} title: #{@title.inspect}, status: #{@status.inspect}, detail:"\
93
- " #{@detail.inspect}, additional_properties: #{@additional_properties}>"
94
- end
95
- end
96
- end