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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f17616cccc9924a2b32b77928484e5059d59aafe59799b83c163ea0ca8c8fca
4
- data.tar.gz: 4aefe8f560d4933b14a2aae9e1b134909972b38be2ffe403ee68d1f5473d19fd
3
+ metadata.gz: f5a4f7b263108049a56409f08f9a2eda6892721f7372e9eac824c9f169b18924
4
+ data.tar.gz: 22dda9b183436153027b8aec4294644df2e1e6fade6dc86bab142d213f3a96fc
5
5
  SHA512:
6
- metadata.gz: 965c001bdf3d38c93c37d4c54a014d5efa4b2732d1db90ec51946b90998b63bdf95dbdc6c0ed10792d4de2cbc555645ef9bbc28c8600a72550a6936d2167ecf5
7
- data.tar.gz: 9471e1d80168cdd85ef293aaa05d59860b04012e3207e314be29074b3a6ede4e3f0ec13d1edfc90708aa1cf4cbe31025753ab6a9eb3874fe629c802a7fb3a7a7
6
+ metadata.gz: 81464d9b860c769148efddebc588d04856406b86d907c467c152c27b019e0cb2298e9123db9b2737069eaef5d6e58ec8756ee2eb3d60cb24d6212f7371823a6c
7
+ data.tar.gz: 15509a990832d41770c4927a9405abf4d80ba6b9fb17f8280047f1defbee35ac44aa70d6b4c69785a86ce14227f1d33d6b131f600cae4c4fe761b7a9737c7405
data/README.md CHANGED
@@ -1,210 +1,161 @@
1
-
2
- # Getting Started with TQL <> OTR Factoring Data Exchange
3
-
4
- ## Introduction
5
-
6
- ### Overview
7
-
8
- The **TQL &lt;&gt; OTR Factoring Data Exchange** API enables factoring clients to submit carrier invoices against loads managed by TQL, upload supporting documentation, search for invoices, and check processing status including any outstanding exceptions.
9
-
10
- #### Key Capabilities
11
-
12
- - **Invoice Submission** — `POST /api/invoices` — Submit a factoring company invoice referencing a TQL load, including carrier details, stops, charges, and reference numbers.
13
- - **Invoice Search** — `POST /api/invoices/search` — Search and retrieve a paginated list of invoices with status and last-updated timestamps.
14
- - **Invoice Status** `GET /api/invoices/{invoiceNumber}` Retrieve the current processing status of an invoice, including any outstanding exceptions.
15
- - **Document Upload** `POST /api/documents` Upload a supporting document (BOL, rate confirmation, proof of delivery, etc.) via `multipart/form-data` and link it to an invoice. Supports arbitrary key-value tags for metadata.
16
- - **Carrier Assignment** `PUT /api/assignments` Notify TQL that a factoring company has been assigned to (or unassigned from) a carrier, including the effective date.
17
- - **Load Lookup** `GET /api/loads/{loadNumber}` Verify a load exists in TQL's system and retrieve basic details (carrier, status, dates).
18
- - **Load Search** — `POST /api/loads/search` — Search for TQL loads by carrier, date range, or status.
19
-
20
- #### Authentication
21
-
22
- This API uses **[OAuth 2.0 Client Credentials](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4)** for authentication. TQL will provision each factoring partner with a unique **Client ID** and **Client Secret** during onboarding.
23
-
24
- **How it works:**
25
-
26
- 1. **Obtain an access token** — Make a `POST` request to the TQL
27
- token endpoint with your Client ID and Client Secret using the
28
- `client_credentials` grant type.
29
-
30
- 2. **Include the token** — Pass the access token as a Bearer token
31
- in the `Authorization` header on every API request:
32
- `Authorization: Bearer <access_token>`
33
-
34
- 3. **Token expiry** — Access tokens have a limited lifetime
35
- (typically 1 hour). When the token expires, request a new one from
36
- the token endpoint. Do **not** request a new token on every API
37
- call — cache and reuse the token until it expires.
38
-
39
- **Required scopes:**
40
-
41
- - **`Factoring.Write`** Submit invoices, upload documents, manage assignments
42
- - **`Factoring.Read`** — Query invoice status, search invoices
43
- The scopes your client is allowed to request are configured during onboarding. Include the required scope(s) in the `scope` parameter when requesting a token.
44
-
45
- **Example token request:**
46
-
47
- POST /oauth2/token HTTP/1.1
48
- Content-Type: application/x-www-form-urlencoded
49
-
50
- grant_type=client_credentials
51
- &client_id=<your_client_id>
52
- &client_secret=<your_client_secret>
53
- &scope=Factoring.Write Factoring.Read
54
-
55
- TQL will provide the exact token endpoint URL, Client ID, and Client Secret during partner onboarding.
56
-
57
- #### Philosophy
58
-
59
- - **Authentication** — All endpoints require a valid OAuth 2.0 Bearer token in the `Authorization` header. See the **Authentication** section above for details.
60
- - **Asynchronous processing** — Write endpoints return `202 Accepted` immediately; poll `GET /api/invoices/{invoiceNumber}` for completion and exceptions.
61
- - **Error handling** — Non-2xx responses follow [RFC 7807 Problem Details](https://datatracker.ietf.org/doc/html/rfc7807) with `title`, `status`, and `detail` fields.
62
-
63
- ## Install the Package
64
-
65
- Install the gem from the command line:
66
-
67
- ```bash
68
- gem install apimatic-tql-sdk -v 0.0.1
69
- ```
70
-
71
- Or add the gem to your Gemfile and run `bundle`:
72
-
73
- ```ruby
74
- gem 'apimatic-tql-sdk', '0.0.1'
75
- ```
76
-
77
- For additional gem details, see the [RubyGems page for the apimatic-tql-sdk gem](https://rubygems.org/gems/apimatic-tql-sdk/versions/0.0.1).
78
-
79
- ## IRB Console Usage
80
-
81
- You can explore the SDK interactively using IRB in two ways
82
-
83
- ### 1. Use IRB with Installed Gem
84
-
85
- Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and type the following command to start the irb console.
86
-
87
- ```bash
88
- irb
89
- ```
90
-
91
- Now you can load the SDK in the IRB
92
-
93
- ```ruby
94
- require 'tql_otr_factoring_data_exchange'
95
- include TqlOtrFactoringDataExchange
96
- ```
97
-
98
- ### 2. Use IRB within SDK
99
-
100
- Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and navigate to the root folder of SDK.
101
-
102
- ```
103
- cd path/to/tql_otr_factoring_data_exchange
104
- ```
105
-
106
- Now you can start the preconfigured irb console by running the following command
107
-
108
- ```bash
109
- ruby bin/console
110
- ```
111
-
112
- **_Note:_** This automatically loads the SDK from lib/
113
-
114
- ## Initialize the API Client
115
-
116
- **_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/client.md)
117
-
118
- The following parameters are configurable for the API Client:
119
-
120
- | Parameter | Type | Description |
121
- | --- | --- | --- |
122
- | connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
123
- | adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
124
- | timeout | `Float` | The value to use for connection timeout. <br> **Default: 30** |
125
- | max_retries | `Integer` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
126
- | retry_interval | `Float` | Pause in seconds between retries. <br> **Default: 1** |
127
- | backoff_factor | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. <br> **Default: 2** |
128
- | retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
129
- | retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
130
- | http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
131
- | proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
132
- | logging_configuration | [`LoggingConfiguration`](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/logging-configuration.md) | The SDK logging configuration for API calls |
133
- | client_credentials_auth_credentials | [`ClientCredentialsAuthCredentials`](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/auth/oauth-2-client-credentials-grant.md) | The credential object for OAuth 2 Client Credentials Grant |
134
-
135
- The API client can be initialized as follows:
136
-
137
- ### Code-Based Client Initialization
138
-
139
- ```ruby
140
- require 'tql_otr_factoring_data_exchange'
141
- include TqlOtrFactoringDataExchange
1
+
2
+ # Getting Started with Freight FinancialsWebhook Ingestion API
3
+
4
+ ## Introduction
5
+
6
+ Receives real-time event callbacks from freight audit providers (currently [Navix](https://www.navix.io)) and publishes them to Kafka for downstream processing.
7
+
8
+ ### Request Flow
9
+
10
+ ```
11
+ Navix ──POST──▶ APIM ──validates key, stamps X-Tenant-Id──▶ Webhooks API ──publishes──▶ Kafka
12
+ ```
13
+
14
+ 1. **Navix** fires an HTTP callback when an event occurs (invoice created, dispute updated, etc.).
15
+ 2. **Azure API Management (APIM)** authenticates the caller via subscription key or OAuth client credentials, then forwards the request with an `X-Tenant-Id` header identifying the tenant.
16
+ 3. **This service** validates the tenant header, deserializes the Navix payload, maps it to a provider-agnostic domain event, and publishes it to a Kafka topic.
17
+ 4. **Downstream consumers** (the Events function app) process the domain events asynchronously.
18
+
19
+ ### Authentication
20
+
21
+ This API does **not** use Entra ID / OAuth for inbound requests. Authentication is handled at the APIM layer.
22
+
23
+ All requests must include the **`X-Tenant-Id`** header. Requests without this header receive a `401 Unauthorized` response.
24
+
25
+ When testing from Swagger UI, click the **Authorize** button and enter your tenant identifier in the `X-Tenant-Id` field.
26
+
27
+ ## Install the Package
28
+
29
+ Install the gem from the command line:
30
+
31
+ ```bash
32
+ gem install apimatic-tql-sdk -v 0.0.2
33
+ ```
34
+
35
+ Or add the gem to your Gemfile and run `bundle`:
36
+
37
+ ```ruby
38
+ gem 'apimatic-tql-sdk', '0.0.2'
39
+ ```
40
+
41
+ For additional gem details, see the [RubyGems page for the apimatic-tql-sdk gem](https://rubygems.org/gems/apimatic-tql-sdk/versions/0.0.2).
42
+
43
+ ## IRB Console Usage
44
+
45
+ You can explore the SDK interactively using IRB in two ways
46
+
47
+ ### 1. Use IRB with Installed Gem
48
+
49
+ Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and type the following command to start the irb console.
50
+
51
+ ```bash
52
+ irb
53
+ ```
54
+
55
+ Now you can load the SDK in the IRB
56
+
57
+ ```ruby
58
+ require 'freight_financials_webhook_ingestion_api'
59
+ include FreightFinancialsWebhookIngestionApi
60
+ ```
61
+
62
+ ### 2. Use IRB within SDK
63
+
64
+ Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and navigate to the root folder of SDK.
65
+
66
+ ```
67
+ cd path/to/freight_financials_webhook_ingestion_api
68
+ ```
69
+
70
+ Now you can start the preconfigured irb console by running the following command
71
+
72
+ ```bash
73
+ ruby bin/console
74
+ ```
75
+
76
+ **_Note:_** This automatically loads the SDK from lib/
77
+
78
+ ## Initialize the API Client
79
+
80
+ **_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/client.md)
81
+
82
+ The following parameters are configurable for the API Client:
83
+
84
+ | Parameter | Type | Description |
85
+ | --- | --- | --- |
86
+ | connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
87
+ | adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
88
+ | timeout | `Float` | The value to use for connection timeout. <br> **Default: 30** |
89
+ | max_retries | `Integer` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
90
+ | retry_interval | `Float` | Pause in seconds between retries. <br> **Default: 1** |
91
+ | backoff_factor | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. <br> **Default: 2** |
92
+ | retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
93
+ | retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
94
+ | http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
95
+ | proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
96
+ | logging_configuration | [`LoggingConfiguration`](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/logging-configuration.md) | The SDK logging configuration for API calls |
97
+
98
+ The API client can be initialized as follows:
99
+
100
+ ### Code-Based Client Initialization
101
+
102
+ ```ruby
103
+ require 'freight_financials_webhook_ingestion_api'
104
+ include FreightFinancialsWebhookIngestionApi
142
105
 
143
106
  client = Client.new(
144
- client_credentials_auth_credentials: ClientCredentialsAuthCredentials.new(
145
- oauth_client_id: 'OAuthClientId',
146
- oauth_client_secret: 'OAuthClientSecret',
147
- oauth_scopes: [
148
- OauthScope::FACTORING_WRITE,
149
- OauthScope::FACTORING_READ
150
- ]
151
- ),
152
- logging_configuration: LoggingConfiguration.new(
153
- log_level: Logger::INFO,
154
- request_logging_config: RequestLoggingConfiguration.new(
155
- log_body: true
156
- ),
157
- response_logging_config: ResponseLoggingConfiguration.new(
158
- log_headers: true
159
- )
107
+ logging_configuration: LoggingConfiguration.new(
108
+ log_level: Logger::INFO,
109
+ request_logging_config: RequestLoggingConfiguration.new(
110
+ log_body: true
111
+ ),
112
+ response_logging_config: ResponseLoggingConfiguration.new(
113
+ log_headers: true
114
+ )
160
115
  )
161
- )
162
- ```
163
-
164
- ### Environment-Based Client Initialization
165
-
166
- ```ruby
167
- require 'tql_otr_factoring_data_exchange'
168
- include TqlOtrFactoringDataExchange
116
+ )
117
+ ```
118
+
119
+ ### Environment-Based Client Initialization
120
+
121
+ ```ruby
122
+ require 'freight_financials_webhook_ingestion_api'
123
+ include FreightFinancialsWebhookIngestionApi
169
124
 
170
125
  # Create client from environment
171
- client = Client.from_env
172
- ```
173
-
174
- See the [`Environment-Based Client Initialization`](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/environment-based-client-initialization.md) section for details.
175
-
176
- ## Authorization
177
-
178
- This API uses the following authentication schemes.
179
-
180
- * [`bearerAuth (OAuth 2 Client Credentials Grant)`](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/auth/oauth-2-client-credentials-grant.md)
181
-
182
- ## List of APIs
183
-
184
- * [Invoices](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/controllers/invoices.md)
185
- * [Documents](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/controllers/documents.md)
186
- * [Assignments](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/controllers/assignments.md)
187
- * [Loads](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/controllers/loads.md)
188
-
189
- ## SDK Infrastructure
190
-
126
+ client = Client.from_env
127
+ ```
128
+
129
+ See the [`Environment-Based Client Initialization`](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/environment-based-client-initialization.md) section for details.
130
+
131
+ ## List of APIs
132
+
133
+ * [Assignments](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/controllers/assignments.md)
134
+ * [Documents](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/controllers/documents.md)
135
+ * [Freight Audit](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/controllers/freight-audit.md)
136
+ * [Invoices](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/controllers/invoices.md)
137
+ * [Loads](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/controllers/loads.md)
138
+ * [Rating](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/controllers/rating.md)
139
+
140
+ ## SDK Infrastructure
141
+
191
142
  ### Configuration
192
143
 
193
- * [ProxySettings](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/proxy-settings.md)
194
- * [Environment-Based Client Initialization](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/environment-based-client-initialization.md)
195
- * [AbstractLogger](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/abstract-logger.md)
196
- * [LoggingConfiguration](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/logging-configuration.md)
197
- * [RequestLoggingConfiguration](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/request-logging-configuration.md)
198
- * [ResponseLoggingConfiguration](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/response-logging-configuration.md)
144
+ * [ProxySettings](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/proxy-settings.md)
145
+ * [Environment-Based Client Initialization](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/environment-based-client-initialization.md)
146
+ * [AbstractLogger](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/abstract-logger.md)
147
+ * [LoggingConfiguration](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/logging-configuration.md)
148
+ * [RequestLoggingConfiguration](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/request-logging-configuration.md)
149
+ * [ResponseLoggingConfiguration](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/response-logging-configuration.md)
199
150
 
200
151
  ### HTTP
201
152
 
202
- * [HttpResponse](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/http-response.md)
203
- * [HttpRequest](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/http-request.md)
153
+ * [HttpResponse](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/http-response.md)
154
+ * [HttpRequest](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/http-request.md)
204
155
 
205
156
  ### Utilities
206
157
 
207
- * [ApiResponse](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/api-response.md)
208
- * [ApiHelper](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/api-helper.md)
209
- * [DateTimeHelper](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.1/doc/date-time-helper.md)
210
-
158
+ * [ApiResponse](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/api-response.md)
159
+ * [ApiHelper](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/api-helper.md)
160
+ * [DateTimeHelper](https://www.github.com/sdks-io/apimatic-tql-ruby-sdk/tree/0.0.2/doc/date-time-helper.md)
161
+
data/bin/console CHANGED
@@ -4,11 +4,11 @@
4
4
  $LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
5
5
 
6
6
  # Require the gem
7
- require 'tql_otr_factoring_data_exchange'
7
+ require 'freight_financials_webhook_ingestion_api'
8
8
 
9
- puts 'TqlOtrFactoringDataExchange SDK loaded!'
10
- puts 'You can now create a client with: client = TqlOtrFactoringDataExchange::Client.new'
11
- puts 'Or use from_env: client = TqlOtrFactoringDataExchange::Client.from_env'
9
+ puts 'FreightFinancialsWebhookIngestionApi SDK loaded!'
10
+ puts 'You can now create a client with: client = FreightFinancialsWebhookIngestionApi::Client.new'
11
+ puts 'Or use from_env: client = FreightFinancialsWebhookIngestionApi::Client.from_env'
12
12
 
13
13
  # Start an interactive IRB session
14
14
  require 'irb'
@@ -0,0 +1,10 @@
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
+ # API utility class
8
+ class APIHelper < CoreLibrary::ApiHelper
9
+ end
10
+ end
@@ -0,0 +1,41 @@
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
+ # AssignmentsApi
8
+ class AssignmentsApi < BaseApi
9
+ # TODO: type endpoint description here
10
+ # @param [String] x_tenant_id Required parameter: Tenant identifier stamped
11
+ # by APIM. Required on all requests.
12
+ # @param [AssignmentRequest] body Required parameter: Cancellation token.
13
+ # @param [String] api_version Optional parameter: TODO: type description
14
+ # here
15
+ # @return [ApiResponse] Complete http response with raw body and status code.
16
+ def assign_or_unassign_factoring_company(x_tenant_id,
17
+ body,
18
+ api_version: nil)
19
+ @api_call
20
+ .request(new_request_builder(HttpMethodEnum::PUT,
21
+ '/api/v1/Assignments',
22
+ Server::DEFAULT)
23
+ .header_param(new_parameter(x_tenant_id, key: 'X-Tenant-Id')
24
+ .is_required(true))
25
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
26
+ .body_param(new_parameter(body)
27
+ .is_required(true))
28
+ .query_param(new_parameter(api_version, key: 'api-version'))
29
+ .header_param(new_parameter('application/json', key: 'accept'))
30
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
31
+ .response(new_response_handler
32
+ .deserializer(APIHelper.method(:custom_type_deserializer))
33
+ .deserialize_into(AssignmentResponse.method(:from_hash))
34
+ .is_api_response(true)
35
+ .local_error('400',
36
+ 'Missing required fields or invalid data.',
37
+ ProblemDetailsException))
38
+ .execute
39
+ end
40
+ end
41
+ end
@@ -1,38 +1,38 @@
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
- # BaseApi.
8
- class BaseApi
9
- include CoreLibrary
10
- attr_accessor :config, :http_call_back
11
-
12
- def self.user_agent
13
- 'Ruby-SDK/0.0.1 (OS: {os-info}, Engine: {engine}/{engine-version})'
14
- end
15
-
16
- def self.user_agent_parameters
17
- {
18
- '{engine}' => { 'value' => RUBY_ENGINE, 'encode' => false },
19
- '{engine-version}' => { 'value' => RUBY_ENGINE_VERSION, 'encode' => false },
20
- '{os-info}' => { 'value' => RUBY_PLATFORM, 'encode' => false }
21
- }
22
- end
23
-
24
- GLOBAL_ERRORS = {
25
- 'default' => ErrorCase.new
26
- .error_message('HTTP response not OK.')
27
- .exception_type(APIException)
28
- }.freeze
29
-
30
- # Initialization constructor.
31
- # @param [GlobalConfiguration] global_configuration The instance of GlobalConfiguration.
32
- def initialize(global_configuration)
33
- @global_configuration = global_configuration
34
- @config = @global_configuration.client_configuration
35
- @http_call_back = @config.http_callback
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
+ # BaseApi.
8
+ class BaseApi
9
+ include CoreLibrary
10
+ attr_accessor :config, :http_call_back
11
+
12
+ def self.user_agent
13
+ 'Ruby-SDK/0.0.2 (OS: {os-info}, Engine: {engine}/{engine-version})'
14
+ end
15
+
16
+ def self.user_agent_parameters
17
+ {
18
+ '{engine}' => { 'value' => RUBY_ENGINE, 'encode' => false },
19
+ '{engine-version}' => { 'value' => RUBY_ENGINE_VERSION, 'encode' => false },
20
+ '{os-info}' => { 'value' => RUBY_PLATFORM, 'encode' => false }
21
+ }
22
+ end
23
+
24
+ GLOBAL_ERRORS = {
25
+ 'default' => ErrorCase.new
26
+ .error_message('HTTP response not OK.')
27
+ .exception_type(APIException)
28
+ }.freeze
29
+
30
+ # Initialization constructor.
31
+ # @param [GlobalConfiguration] global_configuration The instance of GlobalConfiguration.
32
+ def initialize(global_configuration)
33
+ @global_configuration = global_configuration
34
+ @config = @global_configuration.client_configuration
35
+ @http_call_back = @config.http_callback
36
36
  @api_call = ApiCall.new(@global_configuration)
37
37
  end
38
38
 
@@ -40,28 +40,28 @@ module TqlOtrFactoringDataExchange
40
40
  # @param [String] http_method The HTTP method to use in the request.
41
41
  # @param [String] path The endpoint path to use in the request.
42
42
  # @param [String] server The server to extract the base uri for the request.
43
- # @return [RequestBuilder] The instance of RequestBuilder.
44
- def new_request_builder(http_method, path, server)
45
- RequestBuilder.new
46
- .http_method(http_method)
47
- .path(path)
48
- .server(server)
49
- end
50
-
51
- # Creates a new instance of the response handler.
52
- # @return [ResponseHandler] The instance of ResponseHandler.
53
- def new_response_handler
54
- ResponseHandler.new
55
- end
56
-
57
- # Creates a new instance of the parameter.
58
- # @param [String|optional] key The key of the parameter.
59
- # @param [Object] value The value of the parameter.
60
- # @return [Parameter] The instance of Parameter.
61
- def new_parameter(value, key: nil)
62
- Parameter.new
63
- .key(key)
64
- .value(value)
65
- end
66
- end
67
- end
43
+ # @return [RequestBuilder] The instance of RequestBuilder.
44
+ def new_request_builder(http_method, path, server)
45
+ RequestBuilder.new
46
+ .http_method(http_method)
47
+ .path(path)
48
+ .server(server)
49
+ end
50
+
51
+ # Creates a new instance of the response handler.
52
+ # @return [ResponseHandler] The instance of ResponseHandler.
53
+ def new_response_handler
54
+ ResponseHandler.new
55
+ end
56
+
57
+ # Creates a new instance of the parameter.
58
+ # @param [String|optional] key The key of the parameter.
59
+ # @param [Object] value The value of the parameter.
60
+ # @return [Parameter] The instance of Parameter.
61
+ def new_parameter(value, key: nil)
62
+ Parameter.new
63
+ .key(key)
64
+ .value(value)
65
+ end
66
+ end
67
+ end