aure_ex 0.1.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.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +42 -0
- data/lib/aure_ex/client.rb +174 -0
- data/lib/aure_ex/generated/api/company_api.rb +132 -0
- data/lib/aure_ex/generated/api/conversions_api.rb +262 -0
- data/lib/aure_ex/generated/api/deposits_api.rb +204 -0
- data/lib/aure_ex/generated/api/webhooks_api.rb +333 -0
- data/lib/aure_ex/generated/api/withdrawals_api.rb +204 -0
- data/lib/aure_ex/generated/api_client.rb +441 -0
- data/lib/aure_ex/generated/api_error.rb +58 -0
- data/lib/aure_ex/generated/api_model_base.rb +88 -0
- data/lib/aure_ex/generated/configuration.rb +403 -0
- data/lib/aure_ex/generated/models/conversion_create.rb +176 -0
- data/lib/aure_ex/generated/models/customer_input.rb +165 -0
- data/lib/aure_ex/generated/models/customer_input_document.rb +190 -0
- data/lib/aure_ex/generated/models/deposit_create.rb +274 -0
- data/lib/aure_ex/generated/models/error_body.rb +214 -0
- data/lib/aure_ex/generated/models/error_body_error.rb +199 -0
- data/lib/aure_ex/generated/models/success_envelope.rb +198 -0
- data/lib/aure_ex/generated/models/webhook_create.rb +184 -0
- data/lib/aure_ex/generated/models/withdrawal_create.rb +212 -0
- data/lib/aure_ex/version.rb +5 -0
- data/lib/aure_ex.rb +8 -0
- metadata +69 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: f3dec012ab63d5a5524f2142f4e04da0faa0d75ab711a5bfcc2b90472913f54e
|
|
4
|
+
data.tar.gz: 29658bbe1b0ec7c98bf5b7fac0634f5834d4d8e60eecdacde9f628e2fe367830
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 8ddb22f2573f210eeb2b80c4dc2d128ff17f24c4b41511247e02798c530187ff3d788a1ccdb4e4e64e2b2e5a43e29968eefc09fd38d3646af45d07789344524b
|
|
7
|
+
data.tar.gz: f5be7a7e70d9fa9f2f4db5c5c1bbfa26780075581a309e46426c713bc8b90c5295f1c595befc04242468b061a4f216bca3cda3afac9d56f013aacfb7779fde42
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) AureEX
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# aure_ex
|
|
2
|
+
|
|
3
|
+
SDK oficial da API AureEX para Ruby.
|
|
4
|
+
|
|
5
|
+
## Instalação
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
gem install aure_ex
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Uso
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'aure_ex'
|
|
15
|
+
|
|
16
|
+
aure_ex = AureEx.new(
|
|
17
|
+
api_key: ENV['AUREEX_API_KEY'],
|
|
18
|
+
api_secret: ENV['AUREEX_API_SECRET']
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
aure_ex.deposits.create({
|
|
22
|
+
method: 'usdt',
|
|
23
|
+
reference: 'order-1',
|
|
24
|
+
amount: 10_000
|
|
25
|
+
})
|
|
26
|
+
aure_ex.webhooks.list
|
|
27
|
+
aure_ex.company.balance
|
|
28
|
+
aure_ex.conversions.quote({ from: 'USDT', to: 'BRL', amount: 100 })
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Mapa de métodos
|
|
32
|
+
|
|
33
|
+
| SDK | HTTP |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| `aure_ex.deposits` | `/v1/deposits` |
|
|
36
|
+
| `aure_ex.withdrawals` | `/v1/withdrawals` |
|
|
37
|
+
| `aure_ex.webhooks` | `/v1/webhooks` |
|
|
38
|
+
| `aure_ex.company.get` / `balance` | `/v1/company`, `/v1/company/balance` |
|
|
39
|
+
| `aure_ex.conversions` / `quote` | `/v1/conversions`, `/v1/conversions/quote` |
|
|
40
|
+
|
|
41
|
+
Docs: https://api.aure-ex.com/docs/sdks
|
|
42
|
+
OpenAPI: https://api.aure-ex.com/openapi.yaml
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'json'
|
|
4
|
+
require 'net/http'
|
|
5
|
+
require 'uri'
|
|
6
|
+
|
|
7
|
+
module AureEx
|
|
8
|
+
# Erro tipado da API AureEX.
|
|
9
|
+
class Error < StandardError
|
|
10
|
+
attr_reader :code, :details, :status_code
|
|
11
|
+
|
|
12
|
+
def initialize(message, code: nil, details: nil, status_code: 0)
|
|
13
|
+
super(message)
|
|
14
|
+
@code = code
|
|
15
|
+
@details = details
|
|
16
|
+
@status_code = status_code
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Transporte HTTP autenticado com retry em 429.
|
|
21
|
+
class HttpTransport
|
|
22
|
+
def initialize(api_key:, api_secret:, base_url:, max_retries: 2)
|
|
23
|
+
@api_key = api_key
|
|
24
|
+
@api_secret = api_secret
|
|
25
|
+
@base_url = base_url.sub(%r{/\z}, '')
|
|
26
|
+
@max_retries = max_retries
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Executa requisição autenticada e desempacota o envelope `data`.
|
|
30
|
+
def request(method, path, body: nil, extra_headers: {})
|
|
31
|
+
url = URI("#{@base_url}/#{path.sub(%r{\A/}, '')}")
|
|
32
|
+
attempt = 0
|
|
33
|
+
|
|
34
|
+
loop do
|
|
35
|
+
attempt += 1
|
|
36
|
+
http = Net::HTTP.new(url.host, url.port)
|
|
37
|
+
http.use_ssl = url.scheme == 'https'
|
|
38
|
+
|
|
39
|
+
verb = method.to_s.upcase
|
|
40
|
+
request_class = {
|
|
41
|
+
'GET' => Net::HTTP::Get,
|
|
42
|
+
'POST' => Net::HTTP::Post,
|
|
43
|
+
'PUT' => Net::HTTP::Put,
|
|
44
|
+
'PATCH' => Net::HTTP::Patch,
|
|
45
|
+
'DELETE' => Net::HTTP::Delete
|
|
46
|
+
}.fetch(verb)
|
|
47
|
+
|
|
48
|
+
request = request_class.new(url)
|
|
49
|
+
request['X-Api-Key'] = @api_key
|
|
50
|
+
request['X-Api-Secret'] = @api_secret
|
|
51
|
+
request['Accept'] = 'application/json'
|
|
52
|
+
request['Content-Type'] = 'application/json'
|
|
53
|
+
extra_headers.each { |key, value| request[key] = value }
|
|
54
|
+
request.body = JSON.generate(body) unless body.nil?
|
|
55
|
+
|
|
56
|
+
response = http.request(request)
|
|
57
|
+
status = response.code.to_i
|
|
58
|
+
raw = response.body.to_s
|
|
59
|
+
decoded = raw.empty? ? nil : JSON.parse(raw)
|
|
60
|
+
|
|
61
|
+
if status == 429 && attempt <= @max_retries + 1
|
|
62
|
+
sleep([1, (response['Retry-After'] || '1').to_i].max)
|
|
63
|
+
next
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
if status >= 400
|
|
67
|
+
error = decoded.is_a?(Hash) ? decoded['error'] : nil
|
|
68
|
+
message = error.is_a?(Hash) ? (error['message'] || 'Request failed.') : 'Request failed.'
|
|
69
|
+
raise Error.new(
|
|
70
|
+
message.to_s,
|
|
71
|
+
code: error.is_a?(Hash) ? error['code'] : nil,
|
|
72
|
+
details: error.is_a?(Hash) ? error['details'] : nil,
|
|
73
|
+
status_code: status
|
|
74
|
+
)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
return decoded['data'] if decoded.is_a?(Hash) && decoded.key?('data')
|
|
78
|
+
|
|
79
|
+
return decoded
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Recurso CRUD genérico (list/create/get/update/delete).
|
|
85
|
+
class CrudResource
|
|
86
|
+
def initialize(http, base_path)
|
|
87
|
+
@http = http
|
|
88
|
+
@base_path = base_path
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def list(query = {})
|
|
92
|
+
path = @base_path
|
|
93
|
+
unless query.nil? || query.empty?
|
|
94
|
+
path = "#{path}?#{URI.encode_www_form(query)}"
|
|
95
|
+
end
|
|
96
|
+
@http.request('Get', path)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def create(payload, idempotency_key: nil)
|
|
100
|
+
headers = idempotency_key ? { 'Idempotency-Key' => idempotency_key } : {}
|
|
101
|
+
@http.request('Post', @base_path, body: payload, extra_headers: headers)
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def get(id)
|
|
105
|
+
@http.request('Get', "#{@base_path}/#{URI.encode_www_form_component(id)}")
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
def update(id, payload)
|
|
109
|
+
@http.request('Put', "#{@base_path}/#{URI.encode_www_form_component(id)}", body: payload)
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
def delete(id)
|
|
113
|
+
@http.request('Delete', "#{@base_path}/#{URI.encode_www_form_component(id)}")
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Empresa autenticada e saldo.
|
|
118
|
+
class Company
|
|
119
|
+
def initialize(http)
|
|
120
|
+
@http = http
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Dados da empresa (GET /company).
|
|
124
|
+
def get
|
|
125
|
+
@http.request('Get', '/company')
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Saldo disponível (GET /company/balance).
|
|
129
|
+
def balance
|
|
130
|
+
@http.request('Get', '/company/balance')
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Conversões crypto (ex.: USDT/BRL).
|
|
135
|
+
class Conversions < CrudResource
|
|
136
|
+
def initialize(http)
|
|
137
|
+
super(http, '/conversions')
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Cotação de conversão (POST /conversions/quote).
|
|
141
|
+
def quote(payload)
|
|
142
|
+
@http.request('Post', '/conversions/quote', body: payload)
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Facade principal da API AureEX (crypto only).
|
|
147
|
+
class Client
|
|
148
|
+
attr_reader :deposits, :withdrawals, :webhooks, :company, :conversions
|
|
149
|
+
|
|
150
|
+
def initialize(api_key:, api_secret:, base_url: 'https://api.aure-ex.com/v1', max_retries: 2)
|
|
151
|
+
api_key = api_key.to_s.strip
|
|
152
|
+
api_secret = api_secret.to_s.strip
|
|
153
|
+
raise Error.new('api_key and api_secret are required.') if api_key.empty? || api_secret.empty?
|
|
154
|
+
|
|
155
|
+
http = HttpTransport.new(
|
|
156
|
+
api_key: api_key,
|
|
157
|
+
api_secret: api_secret,
|
|
158
|
+
base_url: base_url,
|
|
159
|
+
max_retries: max_retries
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
@deposits = CrudResource.new(http, '/deposits')
|
|
163
|
+
@withdrawals = CrudResource.new(http, '/withdrawals')
|
|
164
|
+
@webhooks = CrudResource.new(http, '/webhooks')
|
|
165
|
+
@company = Company.new(http)
|
|
166
|
+
@conversions = Conversions.new(http)
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Alias ergonômico: AureEx.new(...)
|
|
171
|
+
def self.new(**kwargs)
|
|
172
|
+
Client.new(**kwargs)
|
|
173
|
+
end
|
|
174
|
+
end
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#AureEX REST API
|
|
3
|
+
|
|
4
|
+
#API REST AureEX (camelCase inglês): depósitos USDT, saques USDT, conversões com origem USDT, webhooks e empresa. Auth: headers `X-Api-Key` e `X-Api-Secret`. Envelope: `{ \"success\": true, \"data\": ... }` / `{ \"success\": false, \"error\": { \"code\", \"message\", \"details\" } }`. Fonte para agentes: https://api.aure-ex.com/llms-full.txt
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.23.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module AureEx
|
|
16
|
+
class CompanyApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Saldo disponível
|
|
23
|
+
# @param [Hash] opts the optional parameters
|
|
24
|
+
# @return [SuccessEnvelope]
|
|
25
|
+
def company_balance(opts = {})
|
|
26
|
+
data, _status_code, _headers = company_balance_with_http_info(opts)
|
|
27
|
+
data
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Saldo disponível
|
|
31
|
+
# @param [Hash] opts the optional parameters
|
|
32
|
+
# @return [Array<(SuccessEnvelope, Integer, Hash)>] SuccessEnvelope data, response status code and response headers
|
|
33
|
+
def company_balance_with_http_info(opts = {})
|
|
34
|
+
if @api_client.config.debugging
|
|
35
|
+
@api_client.config.logger.debug 'Calling API: CompanyApi.company_balance ...'
|
|
36
|
+
end
|
|
37
|
+
# resource path
|
|
38
|
+
local_var_path = '/company/balance'
|
|
39
|
+
|
|
40
|
+
# query parameters
|
|
41
|
+
query_params = opts[:query_params] || {}
|
|
42
|
+
|
|
43
|
+
# header parameters
|
|
44
|
+
header_params = opts[:header_params] || {}
|
|
45
|
+
# HTTP header 'Accept' (if needed)
|
|
46
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
47
|
+
|
|
48
|
+
# form parameters
|
|
49
|
+
form_params = opts[:form_params] || {}
|
|
50
|
+
|
|
51
|
+
# http body (model)
|
|
52
|
+
post_body = opts[:debug_body]
|
|
53
|
+
|
|
54
|
+
# return_type
|
|
55
|
+
return_type = opts[:debug_return_type] || 'SuccessEnvelope'
|
|
56
|
+
|
|
57
|
+
# auth_names
|
|
58
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'ApiSecretAuth']
|
|
59
|
+
|
|
60
|
+
new_options = opts.merge(
|
|
61
|
+
:operation => :"CompanyApi.company_balance",
|
|
62
|
+
:header_params => header_params,
|
|
63
|
+
:query_params => query_params,
|
|
64
|
+
:form_params => form_params,
|
|
65
|
+
:body => post_body,
|
|
66
|
+
:auth_names => auth_names,
|
|
67
|
+
:return_type => return_type
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
71
|
+
if @api_client.config.debugging
|
|
72
|
+
@api_client.config.logger.debug "API called: CompanyApi#company_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
73
|
+
end
|
|
74
|
+
return data, status_code, headers
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Dados da empresa autenticada
|
|
78
|
+
# @param [Hash] opts the optional parameters
|
|
79
|
+
# @return [SuccessEnvelope]
|
|
80
|
+
def company_get(opts = {})
|
|
81
|
+
data, _status_code, _headers = company_get_with_http_info(opts)
|
|
82
|
+
data
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Dados da empresa autenticada
|
|
86
|
+
# @param [Hash] opts the optional parameters
|
|
87
|
+
# @return [Array<(SuccessEnvelope, Integer, Hash)>] SuccessEnvelope data, response status code and response headers
|
|
88
|
+
def company_get_with_http_info(opts = {})
|
|
89
|
+
if @api_client.config.debugging
|
|
90
|
+
@api_client.config.logger.debug 'Calling API: CompanyApi.company_get ...'
|
|
91
|
+
end
|
|
92
|
+
# resource path
|
|
93
|
+
local_var_path = '/company'
|
|
94
|
+
|
|
95
|
+
# query parameters
|
|
96
|
+
query_params = opts[:query_params] || {}
|
|
97
|
+
|
|
98
|
+
# header parameters
|
|
99
|
+
header_params = opts[:header_params] || {}
|
|
100
|
+
# HTTP header 'Accept' (if needed)
|
|
101
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
102
|
+
|
|
103
|
+
# form parameters
|
|
104
|
+
form_params = opts[:form_params] || {}
|
|
105
|
+
|
|
106
|
+
# http body (model)
|
|
107
|
+
post_body = opts[:debug_body]
|
|
108
|
+
|
|
109
|
+
# return_type
|
|
110
|
+
return_type = opts[:debug_return_type] || 'SuccessEnvelope'
|
|
111
|
+
|
|
112
|
+
# auth_names
|
|
113
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'ApiSecretAuth']
|
|
114
|
+
|
|
115
|
+
new_options = opts.merge(
|
|
116
|
+
:operation => :"CompanyApi.company_get",
|
|
117
|
+
:header_params => header_params,
|
|
118
|
+
:query_params => query_params,
|
|
119
|
+
:form_params => form_params,
|
|
120
|
+
:body => post_body,
|
|
121
|
+
:auth_names => auth_names,
|
|
122
|
+
:return_type => return_type
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
126
|
+
if @api_client.config.debugging
|
|
127
|
+
@api_client.config.logger.debug "API called: CompanyApi#company_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
128
|
+
end
|
|
129
|
+
return data, status_code, headers
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#AureEX REST API
|
|
3
|
+
|
|
4
|
+
#API REST AureEX (camelCase inglês): depósitos USDT, saques USDT, conversões com origem USDT, webhooks e empresa. Auth: headers `X-Api-Key` e `X-Api-Secret`. Envelope: `{ \"success\": true, \"data\": ... }` / `{ \"success\": false, \"error\": { \"code\", \"message\", \"details\" } }`. Fonte para agentes: https://api.aure-ex.com/llms-full.txt
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.23.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module AureEx
|
|
16
|
+
class ConversionsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Cria conversão (origem USDT)
|
|
23
|
+
# @param [Hash] opts the optional parameters
|
|
24
|
+
# @option opts [ConversionCreate] :conversion_create
|
|
25
|
+
# @return [SuccessEnvelope]
|
|
26
|
+
def conversions_create(opts = {})
|
|
27
|
+
data, _status_code, _headers = conversions_create_with_http_info(opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Cria conversão (origem USDT)
|
|
32
|
+
# @param [Hash] opts the optional parameters
|
|
33
|
+
# @option opts [ConversionCreate] :conversion_create
|
|
34
|
+
# @return [Array<(SuccessEnvelope, Integer, Hash)>] SuccessEnvelope data, response status code and response headers
|
|
35
|
+
def conversions_create_with_http_info(opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: ConversionsApi.conversions_create ...'
|
|
38
|
+
end
|
|
39
|
+
# resource path
|
|
40
|
+
local_var_path = '/conversions'
|
|
41
|
+
|
|
42
|
+
# query parameters
|
|
43
|
+
query_params = opts[:query_params] || {}
|
|
44
|
+
|
|
45
|
+
# header parameters
|
|
46
|
+
header_params = opts[:header_params] || {}
|
|
47
|
+
# HTTP header 'Accept' (if needed)
|
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
49
|
+
# HTTP header 'Content-Type'
|
|
50
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
51
|
+
if !content_type.nil?
|
|
52
|
+
header_params['Content-Type'] = content_type
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# form parameters
|
|
56
|
+
form_params = opts[:form_params] || {}
|
|
57
|
+
|
|
58
|
+
# http body (model)
|
|
59
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'conversion_create'])
|
|
60
|
+
|
|
61
|
+
# return_type
|
|
62
|
+
return_type = opts[:debug_return_type] || 'SuccessEnvelope'
|
|
63
|
+
|
|
64
|
+
# auth_names
|
|
65
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'ApiSecretAuth']
|
|
66
|
+
|
|
67
|
+
new_options = opts.merge(
|
|
68
|
+
:operation => :"ConversionsApi.conversions_create",
|
|
69
|
+
:header_params => header_params,
|
|
70
|
+
:query_params => query_params,
|
|
71
|
+
:form_params => form_params,
|
|
72
|
+
:body => post_body,
|
|
73
|
+
:auth_names => auth_names,
|
|
74
|
+
:return_type => return_type
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
78
|
+
if @api_client.config.debugging
|
|
79
|
+
@api_client.config.logger.debug "API called: ConversionsApi#conversions_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
80
|
+
end
|
|
81
|
+
return data, status_code, headers
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Consulta conversão
|
|
85
|
+
# @param id [String] Identificador ULID do recurso
|
|
86
|
+
# @param [Hash] opts the optional parameters
|
|
87
|
+
# @return [SuccessEnvelope]
|
|
88
|
+
def conversions_get(id, opts = {})
|
|
89
|
+
data, _status_code, _headers = conversions_get_with_http_info(id, opts)
|
|
90
|
+
data
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Consulta conversão
|
|
94
|
+
# @param id [String] Identificador ULID do recurso
|
|
95
|
+
# @param [Hash] opts the optional parameters
|
|
96
|
+
# @return [Array<(SuccessEnvelope, Integer, Hash)>] SuccessEnvelope data, response status code and response headers
|
|
97
|
+
def conversions_get_with_http_info(id, opts = {})
|
|
98
|
+
if @api_client.config.debugging
|
|
99
|
+
@api_client.config.logger.debug 'Calling API: ConversionsApi.conversions_get ...'
|
|
100
|
+
end
|
|
101
|
+
# verify the required parameter 'id' is set
|
|
102
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
103
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ConversionsApi.conversions_get"
|
|
104
|
+
end
|
|
105
|
+
# resource path
|
|
106
|
+
local_var_path = '/conversions/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
107
|
+
|
|
108
|
+
# query parameters
|
|
109
|
+
query_params = opts[:query_params] || {}
|
|
110
|
+
|
|
111
|
+
# header parameters
|
|
112
|
+
header_params = opts[:header_params] || {}
|
|
113
|
+
# HTTP header 'Accept' (if needed)
|
|
114
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
115
|
+
|
|
116
|
+
# form parameters
|
|
117
|
+
form_params = opts[:form_params] || {}
|
|
118
|
+
|
|
119
|
+
# http body (model)
|
|
120
|
+
post_body = opts[:debug_body]
|
|
121
|
+
|
|
122
|
+
# return_type
|
|
123
|
+
return_type = opts[:debug_return_type] || 'SuccessEnvelope'
|
|
124
|
+
|
|
125
|
+
# auth_names
|
|
126
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'ApiSecretAuth']
|
|
127
|
+
|
|
128
|
+
new_options = opts.merge(
|
|
129
|
+
:operation => :"ConversionsApi.conversions_get",
|
|
130
|
+
:header_params => header_params,
|
|
131
|
+
:query_params => query_params,
|
|
132
|
+
:form_params => form_params,
|
|
133
|
+
:body => post_body,
|
|
134
|
+
:auth_names => auth_names,
|
|
135
|
+
:return_type => return_type
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
139
|
+
if @api_client.config.debugging
|
|
140
|
+
@api_client.config.logger.debug "API called: ConversionsApi#conversions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
141
|
+
end
|
|
142
|
+
return data, status_code, headers
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Lista conversões
|
|
146
|
+
# @param [Hash] opts the optional parameters
|
|
147
|
+
# @return [SuccessEnvelope]
|
|
148
|
+
def conversions_list(opts = {})
|
|
149
|
+
data, _status_code, _headers = conversions_list_with_http_info(opts)
|
|
150
|
+
data
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Lista conversões
|
|
154
|
+
# @param [Hash] opts the optional parameters
|
|
155
|
+
# @return [Array<(SuccessEnvelope, Integer, Hash)>] SuccessEnvelope data, response status code and response headers
|
|
156
|
+
def conversions_list_with_http_info(opts = {})
|
|
157
|
+
if @api_client.config.debugging
|
|
158
|
+
@api_client.config.logger.debug 'Calling API: ConversionsApi.conversions_list ...'
|
|
159
|
+
end
|
|
160
|
+
# resource path
|
|
161
|
+
local_var_path = '/conversions'
|
|
162
|
+
|
|
163
|
+
# query parameters
|
|
164
|
+
query_params = opts[:query_params] || {}
|
|
165
|
+
|
|
166
|
+
# header parameters
|
|
167
|
+
header_params = opts[:header_params] || {}
|
|
168
|
+
# HTTP header 'Accept' (if needed)
|
|
169
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
170
|
+
|
|
171
|
+
# form parameters
|
|
172
|
+
form_params = opts[:form_params] || {}
|
|
173
|
+
|
|
174
|
+
# http body (model)
|
|
175
|
+
post_body = opts[:debug_body]
|
|
176
|
+
|
|
177
|
+
# return_type
|
|
178
|
+
return_type = opts[:debug_return_type] || 'SuccessEnvelope'
|
|
179
|
+
|
|
180
|
+
# auth_names
|
|
181
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'ApiSecretAuth']
|
|
182
|
+
|
|
183
|
+
new_options = opts.merge(
|
|
184
|
+
:operation => :"ConversionsApi.conversions_list",
|
|
185
|
+
:header_params => header_params,
|
|
186
|
+
:query_params => query_params,
|
|
187
|
+
:form_params => form_params,
|
|
188
|
+
:body => post_body,
|
|
189
|
+
:auth_names => auth_names,
|
|
190
|
+
:return_type => return_type
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
194
|
+
if @api_client.config.debugging
|
|
195
|
+
@api_client.config.logger.debug "API called: ConversionsApi#conversions_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
196
|
+
end
|
|
197
|
+
return data, status_code, headers
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Cotação de conversão
|
|
201
|
+
# @param [Hash] opts the optional parameters
|
|
202
|
+
# @option opts [ConversionCreate] :conversion_create
|
|
203
|
+
# @return [SuccessEnvelope]
|
|
204
|
+
def conversions_quote(opts = {})
|
|
205
|
+
data, _status_code, _headers = conversions_quote_with_http_info(opts)
|
|
206
|
+
data
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# Cotação de conversão
|
|
210
|
+
# @param [Hash] opts the optional parameters
|
|
211
|
+
# @option opts [ConversionCreate] :conversion_create
|
|
212
|
+
# @return [Array<(SuccessEnvelope, Integer, Hash)>] SuccessEnvelope data, response status code and response headers
|
|
213
|
+
def conversions_quote_with_http_info(opts = {})
|
|
214
|
+
if @api_client.config.debugging
|
|
215
|
+
@api_client.config.logger.debug 'Calling API: ConversionsApi.conversions_quote ...'
|
|
216
|
+
end
|
|
217
|
+
# resource path
|
|
218
|
+
local_var_path = '/conversions/quote'
|
|
219
|
+
|
|
220
|
+
# query parameters
|
|
221
|
+
query_params = opts[:query_params] || {}
|
|
222
|
+
|
|
223
|
+
# header parameters
|
|
224
|
+
header_params = opts[:header_params] || {}
|
|
225
|
+
# HTTP header 'Accept' (if needed)
|
|
226
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
227
|
+
# HTTP header 'Content-Type'
|
|
228
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
229
|
+
if !content_type.nil?
|
|
230
|
+
header_params['Content-Type'] = content_type
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
# form parameters
|
|
234
|
+
form_params = opts[:form_params] || {}
|
|
235
|
+
|
|
236
|
+
# http body (model)
|
|
237
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'conversion_create'])
|
|
238
|
+
|
|
239
|
+
# return_type
|
|
240
|
+
return_type = opts[:debug_return_type] || 'SuccessEnvelope'
|
|
241
|
+
|
|
242
|
+
# auth_names
|
|
243
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'ApiSecretAuth']
|
|
244
|
+
|
|
245
|
+
new_options = opts.merge(
|
|
246
|
+
:operation => :"ConversionsApi.conversions_quote",
|
|
247
|
+
:header_params => header_params,
|
|
248
|
+
:query_params => query_params,
|
|
249
|
+
:form_params => form_params,
|
|
250
|
+
:body => post_body,
|
|
251
|
+
:auth_names => auth_names,
|
|
252
|
+
:return_type => return_type
|
|
253
|
+
)
|
|
254
|
+
|
|
255
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
256
|
+
if @api_client.config.debugging
|
|
257
|
+
@api_client.config.logger.debug "API called: ConversionsApi#conversions_quote\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
258
|
+
end
|
|
259
|
+
return data, status_code, headers
|
|
260
|
+
end
|
|
261
|
+
end
|
|
262
|
+
end
|