tesser-api-sdk 1.0.0

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 (101) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +148 -0
  4. data/bin/console +15 -0
  5. data/lib/tesser_apiv1/api_helper.rb +10 -0
  6. data/lib/tesser_apiv1/client.rb +118 -0
  7. data/lib/tesser_apiv1/configuration.rb +182 -0
  8. data/lib/tesser_apiv1/controllers/accounts_controller.rb +193 -0
  9. data/lib/tesser_apiv1/controllers/base_controller.rb +60 -0
  10. data/lib/tesser_apiv1/controllers/counterparties_controller.rb +171 -0
  11. data/lib/tesser_apiv1/controllers/currencies_controller.rb +39 -0
  12. data/lib/tesser_apiv1/controllers/experimental_controller.rb +49 -0
  13. data/lib/tesser_apiv1/controllers/health_controller.rb +24 -0
  14. data/lib/tesser_apiv1/controllers/networks_controller.rb +39 -0
  15. data/lib/tesser_apiv1/controllers/payments_controller.rb +202 -0
  16. data/lib/tesser_apiv1/controllers/tenants_controller.rb +156 -0
  17. data/lib/tesser_apiv1/controllers/treasury_controller.rb +77 -0
  18. data/lib/tesser_apiv1/exceptions/api_exception.rb +21 -0
  19. data/lib/tesser_apiv1/http/auth/o_auth2.rb +53 -0
  20. data/lib/tesser_apiv1/http/http_call_back.rb +10 -0
  21. data/lib/tesser_apiv1/http/http_method_enum.rb +10 -0
  22. data/lib/tesser_apiv1/http/http_request.rb +10 -0
  23. data/lib/tesser_apiv1/http/http_response.rb +10 -0
  24. data/lib/tesser_apiv1/http/proxy_settings.rb +22 -0
  25. data/lib/tesser_apiv1/models/account.rb +230 -0
  26. data/lib/tesser_apiv1/models/account_list_item.rb +230 -0
  27. data/lib/tesser_apiv1/models/account_list_response.rb +69 -0
  28. data/lib/tesser_apiv1/models/account_response.rb +60 -0
  29. data/lib/tesser_apiv1/models/account_safe.rb +218 -0
  30. data/lib/tesser_apiv1/models/balance_status1_enum.rb +40 -0
  31. data/lib/tesser_apiv1/models/balance_status_enum.rb +40 -0
  32. data/lib/tesser_apiv1/models/base_model.rb +110 -0
  33. data/lib/tesser_apiv1/models/classification7_enum.rb +36 -0
  34. data/lib/tesser_apiv1/models/classification_enum.rb +36 -0
  35. data/lib/tesser_apiv1/models/counterparty.rb +411 -0
  36. data/lib/tesser_apiv1/models/counterparty_list_response.rb +69 -0
  37. data/lib/tesser_apiv1/models/counterparty_response.rb +60 -0
  38. data/lib/tesser_apiv1/models/create_bank_request.rb +122 -0
  39. data/lib/tesser_apiv1/models/create_bank_response.rb +60 -0
  40. data/lib/tesser_apiv1/models/create_counterparty_request.rb +350 -0
  41. data/lib/tesser_apiv1/models/create_counterparty_response.rb +60 -0
  42. data/lib/tesser_apiv1/models/create_deposit_request.rb +119 -0
  43. data/lib/tesser_apiv1/models/create_payment_request.rb +168 -0
  44. data/lib/tesser_apiv1/models/create_tenant_request.rb +183 -0
  45. data/lib/tesser_apiv1/models/create_tenant_response.rb +60 -0
  46. data/lib/tesser_apiv1/models/create_wallet_request.rb +112 -0
  47. data/lib/tesser_apiv1/models/create_wallet_response.rb +60 -0
  48. data/lib/tesser_apiv1/models/create_withdrawal_request.rb +130 -0
  49. data/lib/tesser_apiv1/models/currencies_response.rb +69 -0
  50. data/lib/tesser_apiv1/models/currency.rb +119 -0
  51. data/lib/tesser_apiv1/models/data.rb +221 -0
  52. data/lib/tesser_apiv1/models/data6.rb +242 -0
  53. data/lib/tesser_apiv1/models/data7.rb +419 -0
  54. data/lib/tesser_apiv1/models/data8.rb +200 -0
  55. data/lib/tesser_apiv1/models/direction1_enum.rb +40 -0
  56. data/lib/tesser_apiv1/models/direction_enum.rb +40 -0
  57. data/lib/tesser_apiv1/models/execute_payment_request_dto.rb +71 -0
  58. data/lib/tesser_apiv1/models/fee.rb +117 -0
  59. data/lib/tesser_apiv1/models/fee1.rb +117 -0
  60. data/lib/tesser_apiv1/models/network.rb +68 -0
  61. data/lib/tesser_apiv1/models/networks_response.rb +69 -0
  62. data/lib/tesser_apiv1/models/pagination.rb +104 -0
  63. data/lib/tesser_apiv1/models/payment.rb +421 -0
  64. data/lib/tesser_apiv1/models/payment_list_response.rb +79 -0
  65. data/lib/tesser_apiv1/models/payment_response.rb +60 -0
  66. data/lib/tesser_apiv1/models/payment_type3_enum.rb +52 -0
  67. data/lib/tesser_apiv1/models/payment_type_enum.rb +54 -0
  68. data/lib/tesser_apiv1/models/provider_key1_enum.rb +36 -0
  69. data/lib/tesser_apiv1/models/provider_key_enum.rb +36 -0
  70. data/lib/tesser_apiv1/models/response.rb +81 -0
  71. data/lib/tesser_apiv1/models/review_payment_request.rb +60 -0
  72. data/lib/tesser_apiv1/models/risk_status_enum.rb +44 -0
  73. data/lib/tesser_apiv1/models/status1_enum.rb +52 -0
  74. data/lib/tesser_apiv1/models/status_enum.rb +48 -0
  75. data/lib/tesser_apiv1/models/step.rb +421 -0
  76. data/lib/tesser_apiv1/models/step_type_enum.rb +44 -0
  77. data/lib/tesser_apiv1/models/tenant.rb +275 -0
  78. data/lib/tesser_apiv1/models/tenant_api_credentials.rb +88 -0
  79. data/lib/tesser_apiv1/models/tenant_list_response.rb +69 -0
  80. data/lib/tesser_apiv1/models/tenant_response.rb +60 -0
  81. data/lib/tesser_apiv1/models/transfer_step.rb +422 -0
  82. data/lib/tesser_apiv1/models/turnkey_stamp.rb +81 -0
  83. data/lib/tesser_apiv1/models/type3_enum.rb +40 -0
  84. data/lib/tesser_apiv1/models/type4_enum.rb +44 -0
  85. data/lib/tesser_apiv1/models/type_enum.rb +44 -0
  86. data/lib/tesser_apiv1/models/update_account_request.rb +62 -0
  87. data/lib/tesser_apiv1/models/update_account_response.rb +60 -0
  88. data/lib/tesser_apiv1/models/update_counterparty_request.rb +166 -0
  89. data/lib/tesser_apiv1/models/update_counterparty_response.rb +60 -0
  90. data/lib/tesser_apiv1/models/update_payment_request.rb +100 -0
  91. data/lib/tesser_apiv1/models/update_tenant_request.rb +111 -0
  92. data/lib/tesser_apiv1/models/update_tenant_response.rb +60 -0
  93. data/lib/tesser_apiv1/utilities/date_time_helper.rb +11 -0
  94. data/lib/tesser_apiv1/utilities/file_wrapper.rb +28 -0
  95. data/lib/tesser_apiv1/utilities/union_type_lookup.rb +1234 -0
  96. data/lib/tesser_apiv1.rb +116 -0
  97. data/test/controllers/controller_test_base.rb +23 -0
  98. data/test/controllers/test_health_controller.rb +31 -0
  99. data/test/controllers/test_tenants_controller.rb +133 -0
  100. data/test/http_response_catcher.rb +19 -0
  101. metadata +212 -0
@@ -0,0 +1,202 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ # PaymentsController
8
+ class PaymentsController < BaseController
9
+ # Retrieve all payments for the authenticated user's organization.
10
+ # @param [String] authorization Required parameter: Bearer token for
11
+ # authentication. To obtain a token, make a request to Auth0: ```bash
12
+ # curl --request POST \ --url
13
+ # https://dev-awqy75wdabpsnsvu.us.auth0.com/oauth/token \ --header
14
+ # 'content-type: application/json' \ --data '{
15
+ # "client_id":"YOUR_CLIENT_ID", "client_secret":"YOUR_CLIENT_SECRET",
16
+ # "audience":"https://sandbox.tesserx.co",
17
+ # "grant_type":"client_credentials" }' ``` The response will contain an
18
+ # `access_token` field which should be used as the Bearer token.
19
+ # @param [String] start_date Optional parameter: Filter payments created on
20
+ # or after this ISO 8601 date.
21
+ # @param [String] end_date Optional parameter: Filter payments created
22
+ # before this ISO 8601 date.
23
+ # @param [PaymentType3Enum] payment_type Optional parameter: Filter payments
24
+ # by type ('withdrawal', 'deposit', 'onramp', 'offramp', 'payment',
25
+ # 'transfer').
26
+ # @param [Float] page Optional parameter: Page number for pagination
27
+ # (1-based).
28
+ # @param [Float] limit Optional parameter: Number of items per page.
29
+ # @return [PaymentListResponse] Response from the API call.
30
+ def get_payments(authorization,
31
+ start_date: nil,
32
+ end_date: nil,
33
+ payment_type: nil,
34
+ page: nil,
35
+ limit: nil)
36
+ @api_call
37
+ .request(new_request_builder(HttpMethodEnum::GET,
38
+ '/payments',
39
+ Server::DEFAULT)
40
+ .header_param(new_parameter(authorization, key: 'Authorization'))
41
+ .query_param(new_parameter(start_date, key: 'start_date'))
42
+ .query_param(new_parameter(end_date, key: 'end_date'))
43
+ .query_param(new_parameter(payment_type, key: 'payment_type'))
44
+ .query_param(new_parameter(page, key: 'page'))
45
+ .query_param(new_parameter(limit, key: 'limit'))
46
+ .header_param(new_parameter('application/json', key: 'accept'))
47
+ .auth(Single.new('bearer')))
48
+ .response(new_response_handler
49
+ .deserializer(APIHelper.method(:custom_type_deserializer))
50
+ .deserialize_into(PaymentListResponse.method(:from_hash))
51
+ .local_error('400',
52
+ 'Details coming soon',
53
+ APIException))
54
+ .execute
55
+ end
56
+
57
+ # Create a payment. Returns the created payment details.
58
+ # @param [String] authorization Required parameter: Bearer token for
59
+ # authentication. To obtain a token, make a request to Auth0: ```bash
60
+ # curl --request POST \ --url
61
+ # https://dev-awqy75wdabpsnsvu.us.auth0.com/oauth/token \ --header
62
+ # 'content-type: application/json' \ --data '{
63
+ # "client_id":"YOUR_CLIENT_ID", "client_secret":"YOUR_CLIENT_SECRET",
64
+ # "audience":"https://sandbox.tesserx.co",
65
+ # "grant_type":"client_credentials" }' ``` The response will contain an
66
+ # `access_token` field which should be used as the Bearer token.
67
+ # @param [CreatePaymentRequest] body Required parameter: TODO: type
68
+ # description here
69
+ # @return [PaymentResponse] Response from the API call.
70
+ def create_payment(authorization,
71
+ body)
72
+ @api_call
73
+ .request(new_request_builder(HttpMethodEnum::POST,
74
+ '/payments',
75
+ Server::DEFAULT)
76
+ .header_param(new_parameter(authorization, key: 'Authorization'))
77
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
78
+ .body_param(new_parameter(body))
79
+ .header_param(new_parameter('application/json', key: 'accept'))
80
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
81
+ .auth(Single.new('bearer')))
82
+ .response(new_response_handler
83
+ .deserializer(APIHelper.method(:custom_type_deserializer))
84
+ .deserialize_into(PaymentResponse.method(:from_hash))
85
+ .local_error('400',
86
+ 'Details coming soon',
87
+ APIException))
88
+ .execute
89
+ end
90
+
91
+ # Retrieve a specific payment by ID.
92
+ # @param [String] payment_id Required parameter: TODO: type description
93
+ # here
94
+ # @param [String] authorization Required parameter: Bearer token for
95
+ # authentication. To obtain a token, make a request to Auth0: ```bash
96
+ # curl --request POST \ --url
97
+ # https://dev-awqy75wdabpsnsvu.us.auth0.com/oauth/token \ --header
98
+ # 'content-type: application/json' \ --data '{
99
+ # "client_id":"YOUR_CLIENT_ID", "client_secret":"YOUR_CLIENT_SECRET",
100
+ # "audience":"https://sandbox.tesserx.co",
101
+ # "grant_type":"client_credentials" }' ``` The response will contain an
102
+ # `access_token` field which should be used as the Bearer token.
103
+ # @return [PaymentResponse] Response from the API call.
104
+ def get_payment_by_id(payment_id,
105
+ authorization)
106
+ @api_call
107
+ .request(new_request_builder(HttpMethodEnum::GET,
108
+ '/payments/{paymentId}',
109
+ Server::DEFAULT)
110
+ .template_param(new_parameter(payment_id, key: 'paymentId')
111
+ .should_encode(true))
112
+ .header_param(new_parameter(authorization, key: 'Authorization'))
113
+ .header_param(new_parameter('application/json', key: 'accept'))
114
+ .auth(Single.new('bearer')))
115
+ .response(new_response_handler
116
+ .deserializer(APIHelper.method(:custom_type_deserializer))
117
+ .deserialize_into(PaymentResponse.method(:from_hash))
118
+ .local_error('400',
119
+ 'Details coming soon',
120
+ APIException))
121
+ .execute
122
+ end
123
+
124
+ # Update a payment with accounts.
125
+ # @param [String] payment_id Required parameter: TODO: type description
126
+ # here
127
+ # @param [String] authorization Required parameter: Bearer token for
128
+ # authentication. To obtain a token, make a request to Auth0: ```bash
129
+ # curl --request POST \ --url
130
+ # https://dev-awqy75wdabpsnsvu.us.auth0.com/oauth/token \ --header
131
+ # 'content-type: application/json' \ --data '{
132
+ # "client_id":"YOUR_CLIENT_ID", "client_secret":"YOUR_CLIENT_SECRET",
133
+ # "audience":"https://sandbox.tesserx.co",
134
+ # "grant_type":"client_credentials" }' ``` The response will contain an
135
+ # `access_token` field which should be used as the Bearer token.
136
+ # @param [UpdatePaymentRequest] body Required parameter: TODO: type
137
+ # description here
138
+ # @return [PaymentResponse] Response from the API call.
139
+ def update_payment(payment_id,
140
+ authorization,
141
+ body)
142
+ @api_call
143
+ .request(new_request_builder(HttpMethodEnum::PATCH,
144
+ '/payments/{paymentId}',
145
+ Server::DEFAULT)
146
+ .template_param(new_parameter(payment_id, key: 'paymentId')
147
+ .should_encode(true))
148
+ .header_param(new_parameter(authorization, key: 'Authorization'))
149
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
150
+ .body_param(new_parameter(body))
151
+ .header_param(new_parameter('application/json', key: 'accept'))
152
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
153
+ .auth(Single.new('bearer')))
154
+ .response(new_response_handler
155
+ .deserializer(APIHelper.method(:custom_type_deserializer))
156
+ .deserialize_into(PaymentResponse.method(:from_hash))
157
+ .local_error('400',
158
+ 'Details coming soon',
159
+ APIException))
160
+ .execute
161
+ end
162
+
163
+ # Manually review and approve or reject a payment requiring risk review.
164
+ # @param [UUID | String] payment_id Required parameter: Unique identifier of
165
+ # the payment to review
166
+ # @param [String] authorization Required parameter: Bearer token for
167
+ # authentication. To obtain a token, make a request to Auth0: ```bash
168
+ # curl --request POST \ --url
169
+ # https://dev-awqy75wdabpsnsvu.us.auth0.com/oauth/token \ --header
170
+ # 'content-type: application/json' \ --data '{
171
+ # "client_id":"YOUR_CLIENT_ID", "client_secret":"YOUR_CLIENT_SECRET",
172
+ # "audience":"https://sandbox.tesserx.co",
173
+ # "grant_type":"client_credentials" }' ``` The response will contain an
174
+ # `access_token` field which should be used as the Bearer token.
175
+ # @param [ReviewPaymentRequest] body Required parameter: TODO: type
176
+ # description here
177
+ # @return [PaymentResponse] Response from the API call.
178
+ def review_payment(payment_id,
179
+ authorization,
180
+ body)
181
+ @api_call
182
+ .request(new_request_builder(HttpMethodEnum::POST,
183
+ '/payments/{paymentId}/review',
184
+ Server::DEFAULT)
185
+ .template_param(new_parameter(payment_id, key: 'paymentId')
186
+ .should_encode(true))
187
+ .header_param(new_parameter(authorization, key: 'Authorization'))
188
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
189
+ .body_param(new_parameter(body))
190
+ .header_param(new_parameter('application/json', key: 'accept'))
191
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
192
+ .auth(Single.new('bearer')))
193
+ .response(new_response_handler
194
+ .deserializer(APIHelper.method(:custom_type_deserializer))
195
+ .deserialize_into(PaymentResponse.method(:from_hash))
196
+ .local_error('400',
197
+ 'Details coming soon',
198
+ APIException))
199
+ .execute
200
+ end
201
+ end
202
+ end
@@ -0,0 +1,156 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ # TenantsController
8
+ class TenantsController < BaseController
9
+ # Create a new tenant for your workspace. Tenants are business customers
10
+ # that integrate via APIs.
11
+ # @param [String] authorization Required parameter: Bearer token for
12
+ # authentication. To obtain a token, make a request to Auth0: ```bash
13
+ # curl --request POST \ --url
14
+ # https://dev-awqy75wdabpsnsvu.us.auth0.com/oauth/token \ --header
15
+ # 'content-type: application/json' \ --data '{
16
+ # "client_id":"YOUR_CLIENT_ID", "client_secret":"YOUR_CLIENT_SECRET",
17
+ # "audience":"https://sandbox.tesserx.co",
18
+ # "grant_type":"client_credentials" }' ``` The response will contain an
19
+ # `access_token` field which should be used as the Bearer token.
20
+ # @param [CreateTenantRequest] body Required parameter: TODO: type
21
+ # description here
22
+ # @return [CreateTenantResponse] Response from the API call.
23
+ def create1(authorization,
24
+ body)
25
+ @api_call
26
+ .request(new_request_builder(HttpMethodEnum::POST,
27
+ '/entities/tenants',
28
+ Server::DEFAULT)
29
+ .header_param(new_parameter(authorization, key: 'Authorization'))
30
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
31
+ .body_param(new_parameter(body))
32
+ .header_param(new_parameter('application/json', key: 'accept'))
33
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
34
+ .auth(Single.new('bearer')))
35
+ .response(new_response_handler
36
+ .deserializer(APIHelper.method(:custom_type_deserializer))
37
+ .deserialize_into(CreateTenantResponse.method(:from_hash))
38
+ .local_error('400',
39
+ 'Details coming soon',
40
+ APIException))
41
+ .execute
42
+ end
43
+
44
+ # Retrieve all tenants for your workspace with optional search filtering.
45
+ # @param [String] authorization Required parameter: Bearer token for
46
+ # authentication. To obtain a token, make a request to Auth0: ```bash
47
+ # curl --request POST \ --url
48
+ # https://dev-awqy75wdabpsnsvu.us.auth0.com/oauth/token \ --header
49
+ # 'content-type: application/json' \ --data '{
50
+ # "client_id":"YOUR_CLIENT_ID", "client_secret":"YOUR_CLIENT_SECRET",
51
+ # "audience":"https://sandbox.tesserx.co",
52
+ # "grant_type":"client_credentials" }' ``` The response will contain an
53
+ # `access_token` field which should be used as the Bearer token.
54
+ # @param [TrueClass | FalseClass] include_secure Optional parameter: Include
55
+ # secure fields (PII)
56
+ # @return [TenantListResponse] Response from the API call.
57
+ def find_all2(authorization,
58
+ include_secure: nil)
59
+ @api_call
60
+ .request(new_request_builder(HttpMethodEnum::GET,
61
+ '/entities/tenants',
62
+ Server::DEFAULT)
63
+ .header_param(new_parameter(authorization, key: 'Authorization'))
64
+ .query_param(new_parameter(include_secure, key: 'include_secure'))
65
+ .header_param(new_parameter('application/json', key: 'accept'))
66
+ .auth(Single.new('bearer')))
67
+ .response(new_response_handler
68
+ .deserializer(APIHelper.method(:custom_type_deserializer))
69
+ .deserialize_into(TenantListResponse.method(:from_hash))
70
+ .local_error('400',
71
+ 'Details coming soon',
72
+ APIException))
73
+ .execute
74
+ end
75
+
76
+ # Retrieve a specific tenant by its unique identifier
77
+ # @param [String] id Required parameter: Tenant ID (UUID)
78
+ # @param [String] authorization Required parameter: Bearer token for
79
+ # authentication. To obtain a token, make a request to Auth0: ```bash
80
+ # curl --request POST \ --url
81
+ # https://dev-awqy75wdabpsnsvu.us.auth0.com/oauth/token \ --header
82
+ # 'content-type: application/json' \ --data '{
83
+ # "client_id":"YOUR_CLIENT_ID", "client_secret":"YOUR_CLIENT_SECRET",
84
+ # "audience":"https://sandbox.tesserx.co",
85
+ # "grant_type":"client_credentials" }' ``` The response will contain an
86
+ # `access_token` field which should be used as the Bearer token.
87
+ # @param [TrueClass | FalseClass] include_secure Optional parameter: Include
88
+ # secure fields (PII)
89
+ # @return [TenantResponse] Response from the API call.
90
+ def find_one1(id,
91
+ authorization,
92
+ include_secure: nil)
93
+ @api_call
94
+ .request(new_request_builder(HttpMethodEnum::GET,
95
+ '/entities/tenants/{id}',
96
+ Server::DEFAULT)
97
+ .template_param(new_parameter(id, key: 'id')
98
+ .should_encode(true))
99
+ .header_param(new_parameter(authorization, key: 'Authorization'))
100
+ .query_param(new_parameter(include_secure, key: 'include_secure'))
101
+ .header_param(new_parameter('application/json', key: 'accept'))
102
+ .auth(Single.new('bearer')))
103
+ .response(new_response_handler
104
+ .deserializer(APIHelper.method(:custom_type_deserializer))
105
+ .deserialize_into(TenantResponse.method(:from_hash))
106
+ .local_error('400',
107
+ 'Details coming soon',
108
+ APIException))
109
+ .execute
110
+ end
111
+
112
+ # Update an existing tenant's information.
113
+ # Only the following fields can be updated:
114
+ # - business_legal_name
115
+ # - business_dba
116
+ # - business_address_country
117
+ # - webhook_url
118
+ # At least one field must be provided.
119
+ # @param [String] id Required parameter: Tenant ID (UUID)
120
+ # @param [String] authorization Required parameter: Bearer token for
121
+ # authentication. To obtain a token, make a request to Auth0: ```bash
122
+ # curl --request POST \ --url
123
+ # https://dev-awqy75wdabpsnsvu.us.auth0.com/oauth/token \ --header
124
+ # 'content-type: application/json' \ --data '{
125
+ # "client_id":"YOUR_CLIENT_ID", "client_secret":"YOUR_CLIENT_SECRET",
126
+ # "audience":"https://sandbox.tesserx.co",
127
+ # "grant_type":"client_credentials" }' ``` The response will contain an
128
+ # `access_token` field which should be used as the Bearer token.
129
+ # @param [UpdateTenantRequest] body Required parameter: TODO: type
130
+ # description here
131
+ # @return [UpdateTenantResponse] Response from the API call.
132
+ def update2(id,
133
+ authorization,
134
+ body)
135
+ @api_call
136
+ .request(new_request_builder(HttpMethodEnum::PATCH,
137
+ '/entities/tenants/{id}',
138
+ Server::DEFAULT)
139
+ .template_param(new_parameter(id, key: 'id')
140
+ .should_encode(true))
141
+ .header_param(new_parameter(authorization, key: 'Authorization'))
142
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
143
+ .body_param(new_parameter(body))
144
+ .header_param(new_parameter('application/json', key: 'accept'))
145
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
146
+ .auth(Single.new('bearer')))
147
+ .response(new_response_handler
148
+ .deserializer(APIHelper.method(:custom_type_deserializer))
149
+ .deserialize_into(UpdateTenantResponse.method(:from_hash))
150
+ .local_error('400',
151
+ 'Details coming soon',
152
+ APIException))
153
+ .execute
154
+ end
155
+ end
156
+ end
@@ -0,0 +1,77 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ # TreasuryController
8
+ class TreasuryController < BaseController
9
+ # Create a deposit payment.
10
+ # @param [String] authorization Required parameter: Bearer token for
11
+ # authentication. To obtain a token, make a request to Auth0: ```bash
12
+ # curl --request POST \ --url
13
+ # https://dev-awqy75wdabpsnsvu.us.auth0.com/oauth/token \ --header
14
+ # 'content-type: application/json' \ --data '{
15
+ # "client_id":"YOUR_CLIENT_ID", "client_secret":"YOUR_CLIENT_SECRET",
16
+ # "audience":"https://sandbox.tesserx.co",
17
+ # "grant_type":"client_credentials" }' ``` The response will contain an
18
+ # `access_token` field which should be used as the Bearer token.
19
+ # @param [CreateDepositRequest] body Required parameter: TODO: type
20
+ # description here
21
+ # @return [PaymentResponse] Response from the API call.
22
+ def create_deposit(authorization,
23
+ body)
24
+ @api_call
25
+ .request(new_request_builder(HttpMethodEnum::POST,
26
+ '/treasury/deposit',
27
+ Server::DEFAULT)
28
+ .header_param(new_parameter(authorization, key: 'Authorization'))
29
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
30
+ .body_param(new_parameter(body))
31
+ .header_param(new_parameter('application/json', key: 'accept'))
32
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
33
+ .auth(Single.new('bearer')))
34
+ .response(new_response_handler
35
+ .deserializer(APIHelper.method(:custom_type_deserializer))
36
+ .deserialize_into(PaymentResponse.method(:from_hash))
37
+ .local_error('400',
38
+ 'Details coming soon',
39
+ APIException))
40
+ .execute
41
+ end
42
+
43
+ # Create a withdrawal payment.
44
+ # @param [String] authorization Required parameter: Bearer token for
45
+ # authentication. To obtain a token, make a request to Auth0: ```bash
46
+ # curl --request POST \ --url
47
+ # https://dev-awqy75wdabpsnsvu.us.auth0.com/oauth/token \ --header
48
+ # 'content-type: application/json' \ --data '{
49
+ # "client_id":"YOUR_CLIENT_ID", "client_secret":"YOUR_CLIENT_SECRET",
50
+ # "audience":"https://sandbox.tesserx.co",
51
+ # "grant_type":"client_credentials" }' ``` The response will contain an
52
+ # `access_token` field which should be used as the Bearer token.
53
+ # @param [CreateWithdrawalRequest] body Required parameter: TODO: type
54
+ # description here
55
+ # @return [PaymentResponse] Response from the API call.
56
+ def create_withdrawal(authorization,
57
+ body)
58
+ @api_call
59
+ .request(new_request_builder(HttpMethodEnum::POST,
60
+ '/treasury/withdrawal',
61
+ Server::DEFAULT)
62
+ .header_param(new_parameter(authorization, key: 'Authorization'))
63
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
64
+ .body_param(new_parameter(body))
65
+ .header_param(new_parameter('application/json', key: 'accept'))
66
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
67
+ .auth(Single.new('bearer')))
68
+ .response(new_response_handler
69
+ .deserializer(APIHelper.method(:custom_type_deserializer))
70
+ .deserialize_into(PaymentResponse.method(:from_hash))
71
+ .local_error('400',
72
+ 'Details coming soon',
73
+ APIException))
74
+ .execute
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,21 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ # Class for exceptions when there is a network error, status code error, etc.
8
+ class APIException < CoreLibrary::ApiException
9
+ # Provides a human-readable string representation of the object.
10
+ def to_s
11
+ class_name = self.class.name.split('::').last
12
+ "<#{class_name} status_code: #{@response_code}, reason: #{@reason}>"
13
+ end
14
+
15
+ # Provides a debugging-friendly string with detailed object information.
16
+ def inspect
17
+ class_name = self.class.name.split('::').last
18
+ "<#{class_name} status_code: #{@response_code.inspect}, reason: #{@reason.inspect}>"
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,53 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ # Utility class for OAuth 2 authorization and token management.
8
+ class OAuth2 < CoreLibrary::HeaderAuth
9
+ include CoreLibrary
10
+ # Display error message on occurrence of authentication failure.
11
+ # @returns [String] The oAuth error message.
12
+ def error_message
13
+ 'BearerAuth: access_token is undefined.'
14
+ end
15
+
16
+ # Initialization constructor.
17
+ def initialize(bearer_auth_credentials)
18
+ auth_params = {}
19
+ @_access_token = bearer_auth_credentials.access_token unless
20
+ bearer_auth_credentials.nil? || bearer_auth_credentials.access_token.nil?
21
+ auth_params[:Authorization] = "Bearer #{@_access_token}" unless @_access_token.nil?
22
+
23
+ super auth_params
24
+ end
25
+ end
26
+
27
+ # Data class for BearerAuthCredentials.
28
+ class BearerAuthCredentials
29
+ attr_reader :access_token
30
+
31
+ def initialize(access_token:)
32
+ raise ArgumentError, 'access_token cannot be nil' if access_token.nil?
33
+
34
+ @access_token = access_token
35
+ end
36
+
37
+ def self.from_env
38
+ access_token = ENV['ACCESS_TOKEN']
39
+ all_nil = [
40
+ access_token
41
+ ].all?(&:nil?)
42
+ return nil if all_nil
43
+
44
+ new(access_token: access_token)
45
+ end
46
+
47
+ def clone_with(access_token: nil)
48
+ access_token ||= self.access_token
49
+
50
+ BearerAuthCredentials.new(access_token: access_token)
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,10 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ # HttpCallBack allows defining callables for pre and post API calls.
8
+ class HttpCallBack < CoreLibrary::HttpCallback
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ # HTTP Methods Enumeration.
8
+ class HttpMethodEnum < CoreLibrary::HttpMethod
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ # Represents a single Http Request.
8
+ class HttpRequest < CoreLibrary::HttpRequest
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ # Http response received.
8
+ class HttpResponse < CoreLibrary::HttpResponse
9
+ end
10
+ end
@@ -0,0 +1,22 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ ##
8
+ # ProxySettings encapsulates HTTP proxy configuration for Faraday,
9
+ # including optional basic authentication.
10
+ #
11
+ class ProxySettings < CoreLibrary::ProxySettings
12
+ def self.from_env
13
+ address = ENV['PROXY_ADDRESS']
14
+ port = ENV['PROXY_PORT']
15
+ username = ENV['PROXY_USERNAME']
16
+ password = ENV['PROXY_PASSWORD']
17
+ return nil if address.nil? || address.strip.empty?
18
+
19
+ new(address: address, port: port, username: username, password: password)
20
+ end
21
+ end
22
+ end