Skip to content

Commit c8d5545

Browse files
committed
Auto-generate SDK for CoinAPI Market Data API REST Historical
1 parent 0ea8efc commit c8d5545

File tree

142 files changed

+67
-5371
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+67
-5371
lines changed

coinapi/market-data-api-rest/sdk/ada/src/client/-clients.adb

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,32 +1068,6 @@ package body .Clients is
10681068
.Models.Deserialize (Reply, "", Result);
10691069
end V_1Orderbooks_Symbol_Id_History_Get;
10701070

1071-
-- Latest data
1072-
-- Get latest order book snapshots for a specific symbol, returned in time descending order.
1073-
--
1074-
-- :::info
1075-
-- The historical order book data via the REST API is currently limited by a number of updates and to the maximum number of 20 levels.
1076-
-- :::
1077-
procedure V_1Orderbooks_Symbol_Id_Latest_Get
1078-
(Client : in out Client_Type;
1079-
Symbol_Id : in Swagger.UString;
1080-
Limit : in Swagger.Nullable_Integer;
1081-
Limit_Levels : in Swagger.Nullable_Integer;
1082-
Result : out .Models.V1OrderBook_Type_Vectors.Vector) is
1083-
URI : Swagger.Clients.URI_Type;
1084-
Reply : Swagger.Value_Type;
1085-
begin
1086-
Client.Set_Accept (Media_List_1);
1087-
1088-
1089-
URI.Add_Param ("limit", Limit);
1090-
URI.Add_Param ("limit_levels", Limit_Levels);
1091-
URI.Set_Path ("/v1/orderbooks/{symbol_id}/latest");
1092-
URI.Set_Path_Param ("symbol_id", Symbol_Id);
1093-
Client.Call (Swagger.Clients.GET, URI, Reply);
1094-
.Models.Deserialize (Reply, "", Result);
1095-
end V_1Orderbooks_Symbol_Id_Latest_Get;
1096-
10971071
-- Current order books
10981072
procedure V_1Orderbooks_3Current_Get
10991073
(Client : in out Client_Type;

coinapi/market-data-api-rest/sdk/ada/src/client/-clients.ads

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -528,19 +528,6 @@ package .Clients is
528528
Limit_Levels : in Swagger.Nullable_Integer;
529529
Result : out .Models.V1OrderBook_Type_Vectors.Vector);
530530

531-
-- Latest data
532-
-- Get latest order book snapshots for a specific symbol, returned in time descending order.
533-
--
534-
-- :::info
535-
-- The historical order book data via the REST API is currently limited by a number of updates and to the maximum number of 20 levels.
536-
-- :::
537-
procedure V_1Orderbooks_Symbol_Id_Latest_Get
538-
(Client : in out Client_Type;
539-
Symbol_Id : in Swagger.UString;
540-
Limit : in Swagger.Nullable_Integer;
541-
Limit_Levels : in Swagger.Nullable_Integer;
542-
Result : out .Models.V1OrderBook_Type_Vectors.Vector);
543-
544531
-- Current order books
545532
procedure V_1Orderbooks_3Current_Get
546533
(Client : in out Client_Type;

coinapi/market-data-api-rest/sdk/android/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ Class | Method | HTTP request | Description
125125
*OrderBookApi* | [**v1OrderbooksSymbolIdCurrentGet**](docs/OrderBookApi.md#v1OrderbooksSymbolIdCurrentGet) | **GET** /v1/orderbooks/{symbol_id}/current | Get current order book
126126
*OrderBookApi* | [**v1OrderbooksSymbolIdDepthCurrentGet**](docs/OrderBookApi.md#v1OrderbooksSymbolIdDepthCurrentGet) | **GET** /v1/orderbooks/{symbol_id}/depth/current | Current depth of the order book
127127
*OrderBookApi* | [**v1OrderbooksSymbolIdHistoryGet**](docs/OrderBookApi.md#v1OrderbooksSymbolIdHistoryGet) | **GET** /v1/orderbooks/{symbol_id}/history | Historical data
128-
*OrderBookApi* | [**v1OrderbooksSymbolIdLatestGet**](docs/OrderBookApi.md#v1OrderbooksSymbolIdLatestGet) | **GET** /v1/orderbooks/{symbol_id}/latest | Latest data
129128
*OrderBookL3Api* | [**v1Orderbooks3CurrentGet**](docs/OrderBookL3Api.md#v1Orderbooks3CurrentGet) | **GET** /v1/orderbooks3/current | Current order books
130129
*OrderBookL3Api* | [**v1Orderbooks3SymbolIdCurrentGet**](docs/OrderBookL3Api.md#v1Orderbooks3SymbolIdCurrentGet) | **GET** /v1/orderbooks3/{symbol_id}/current | Current order book by symbol_id
131130
*QuotesApi* | [**v1QuotesCurrentGet**](docs/QuotesApi.md#v1QuotesCurrentGet) | **GET** /v1/quotes/current | Current data

coinapi/market-data-api-rest/sdk/android/docs/OrderBookApi.md

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Method | HTTP request | Description
77
[**v1OrderbooksSymbolIdCurrentGet**](OrderBookApi.md#v1OrderbooksSymbolIdCurrentGet) | **GET** /v1/orderbooks/{symbol_id}/current | Get current order book
88
[**v1OrderbooksSymbolIdDepthCurrentGet**](OrderBookApi.md#v1OrderbooksSymbolIdDepthCurrentGet) | **GET** /v1/orderbooks/{symbol_id}/depth/current | Current depth of the order book
99
[**v1OrderbooksSymbolIdHistoryGet**](OrderBookApi.md#v1OrderbooksSymbolIdHistoryGet) | **GET** /v1/orderbooks/{symbol_id}/history | Historical data
10-
[**v1OrderbooksSymbolIdLatestGet**](OrderBookApi.md#v1OrderbooksSymbolIdLatestGet) | **GET** /v1/orderbooks/{symbol_id}/latest | Latest data
1110

1211

1312

@@ -162,53 +161,3 @@ Name | Type | Description | Notes
162161
- **Content-Type**: Not defined
163162
- **Accept**: text/plain, application/json, text/json, application/x-msgpack
164163

165-
166-
## v1OrderbooksSymbolIdLatestGet
167-
168-
> List<V1OrderBook> v1OrderbooksSymbolIdLatestGet(symbolId, limit, limitLevels)
169-
170-
Latest data
171-
172-
Get latest order book snapshots for a specific symbol, returned in time descending order. :::info The historical order book data via the REST API is currently limited by a number of updates and to the maximum number of 20 levels. :::
173-
174-
### Example
175-
176-
```java
177-
// Import classes:
178-
//import org.openapitools.client.api.OrderBookApi;
179-
180-
OrderBookApi apiInstance = new OrderBookApi();
181-
String symbolId = null; // String | Symbol identifier of requested timeseries (from the Metadata -> Symbols)
182-
Integer limit = 100; // Integer | Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)
183-
Integer limitLevels = null; // Integer | Maximum amount of levels from each side of the book to include in response (optional)
184-
try {
185-
List<V1OrderBook> result = apiInstance.v1OrderbooksSymbolIdLatestGet(symbolId, limit, limitLevels);
186-
System.out.println(result);
187-
} catch (ApiException e) {
188-
System.err.println("Exception when calling OrderBookApi#v1OrderbooksSymbolIdLatestGet");
189-
e.printStackTrace();
190-
}
191-
```
192-
193-
### Parameters
194-
195-
196-
Name | Type | Description | Notes
197-
------------- | ------------- | ------------- | -------------
198-
**symbolId** | **String**| Symbol identifier of requested timeseries (from the Metadata -&gt; Symbols) | [default to null]
199-
**limit** | **Integer**| Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request) | [optional] [default to 100]
200-
**limitLevels** | **Integer**| Maximum amount of levels from each side of the book to include in response (optional) | [optional] [default to null]
201-
202-
### Return type
203-
204-
[**List&lt;V1OrderBook&gt;**](V1OrderBook.md)
205-
206-
### Authorization
207-
208-
[APIKey](../README.md#APIKey), [JWT](../README.md#JWT)
209-
210-
### HTTP request headers
211-
212-
- **Content-Type**: Not defined
213-
- **Accept**: text/plain, application/json, text/json, application/x-msgpack
214-

coinapi/market-data-api-rest/sdk/android/src/main/java/org/openapitools/client/api/OrderBookApi.java

Lines changed: 0 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -421,139 +421,6 @@ public void v1OrderbooksSymbolIdHistoryGet (String symbolId, String date, String
421421
queryParams.addAll(ApiInvoker.parameterToPairs("", "limit_levels", limitLevels));
422422

423423

424-
String[] contentTypes = {
425-
426-
};
427-
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
428-
429-
if (contentType.startsWith("multipart/form-data")) {
430-
// file uploading
431-
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
432-
433-
434-
HttpEntity httpEntity = localVarBuilder.build();
435-
postBody = httpEntity;
436-
} else {
437-
// normal form params
438-
}
439-
440-
String[] authNames = new String[] { "APIKey", "JWT" };
441-
442-
try {
443-
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
444-
new Response.Listener<String>() {
445-
@Override
446-
public void onResponse(String localVarResponse) {
447-
try {
448-
responseListener.onResponse((List<V1OrderBook>) ApiInvoker.deserialize(localVarResponse, "array", V1OrderBook.class));
449-
} catch (ApiException exception) {
450-
errorListener.onErrorResponse(new VolleyError(exception));
451-
}
452-
}
453-
}, new Response.ErrorListener() {
454-
@Override
455-
public void onErrorResponse(VolleyError error) {
456-
errorListener.onErrorResponse(error);
457-
}
458-
});
459-
} catch (ApiException ex) {
460-
errorListener.onErrorResponse(new VolleyError(ex));
461-
}
462-
}
463-
/**
464-
* Latest data
465-
* Get latest order book snapshots for a specific symbol, returned in time descending order. :::info The historical order book data via the REST API is currently limited by a number of updates and to the maximum number of 20 levels. :::
466-
* @param symbolId Symbol identifier of requested timeseries (from the Metadata -&gt; Symbols)
467-
* @param limit Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)
468-
* @param limitLevels Maximum amount of levels from each side of the book to include in response (optional)
469-
* @return List<V1OrderBook>
470-
*/
471-
public List<V1OrderBook> v1OrderbooksSymbolIdLatestGet (String symbolId, Integer limit, Integer limitLevels) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
472-
Object postBody = null;
473-
// verify the required parameter 'symbolId' is set
474-
if (symbolId == null) {
475-
VolleyError error = new VolleyError("Missing the required parameter 'symbolId' when calling v1OrderbooksSymbolIdLatestGet",
476-
new ApiException(400, "Missing the required parameter 'symbolId' when calling v1OrderbooksSymbolIdLatestGet"));
477-
}
478-
479-
// create path and map variables
480-
String path = "/v1/orderbooks/{symbol_id}/latest".replaceAll("\\{" + "symbol_id" + "\\}", apiInvoker.escapeString(symbolId.toString()));
481-
482-
// query params
483-
List<Pair> queryParams = new ArrayList<Pair>();
484-
// header params
485-
Map<String, String> headerParams = new HashMap<String, String>();
486-
// form params
487-
Map<String, String> formParams = new HashMap<String, String>();
488-
queryParams.addAll(ApiInvoker.parameterToPairs("", "limit", limit));
489-
queryParams.addAll(ApiInvoker.parameterToPairs("", "limit_levels", limitLevels));
490-
String[] contentTypes = {
491-
};
492-
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
493-
494-
if (contentType.startsWith("multipart/form-data")) {
495-
// file uploading
496-
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
497-
HttpEntity httpEntity = localVarBuilder.build();
498-
postBody = httpEntity;
499-
} else {
500-
// normal form params
501-
}
502-
503-
String[] authNames = new String[] { "APIKey", "JWT" };
504-
505-
try {
506-
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
507-
if (localVarResponse != null) {
508-
return (List<V1OrderBook>) ApiInvoker.deserialize(localVarResponse, "array", V1OrderBook.class);
509-
} else {
510-
return null;
511-
}
512-
} catch (ApiException ex) {
513-
throw ex;
514-
} catch (InterruptedException ex) {
515-
throw ex;
516-
} catch (ExecutionException ex) {
517-
if (ex.getCause() instanceof VolleyError) {
518-
VolleyError volleyError = (VolleyError)ex.getCause();
519-
if (volleyError.networkResponse != null) {
520-
throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
521-
}
522-
}
523-
throw ex;
524-
} catch (TimeoutException ex) {
525-
throw ex;
526-
}
527-
}
528-
529-
/**
530-
* Latest data
531-
* Get latest order book snapshots for a specific symbol, returned in time descending order. :::info The historical order book data via the REST API is currently limited by a number of updates and to the maximum number of 20 levels. :::
532-
* @param symbolId Symbol identifier of requested timeseries (from the Metadata -&gt; Symbols) * @param limit Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request) * @param limitLevels Maximum amount of levels from each side of the book to include in response (optional)
533-
*/
534-
public void v1OrderbooksSymbolIdLatestGet (String symbolId, Integer limit, Integer limitLevels, final Response.Listener<List<V1OrderBook>> responseListener, final Response.ErrorListener errorListener) {
535-
Object postBody = null;
536-
537-
// verify the required parameter 'symbolId' is set
538-
if (symbolId == null) {
539-
VolleyError error = new VolleyError("Missing the required parameter 'symbolId' when calling v1OrderbooksSymbolIdLatestGet",
540-
new ApiException(400, "Missing the required parameter 'symbolId' when calling v1OrderbooksSymbolIdLatestGet"));
541-
}
542-
543-
// create path and map variables
544-
String path = "/v1/orderbooks/{symbol_id}/latest".replaceAll("\\{format\\}","json").replaceAll("\\{" + "symbol_id" + "\\}", apiInvoker.escapeString(symbolId.toString()));
545-
546-
// query params
547-
List<Pair> queryParams = new ArrayList<Pair>();
548-
// header params
549-
Map<String, String> headerParams = new HashMap<String, String>();
550-
// form params
551-
Map<String, String> formParams = new HashMap<String, String>();
552-
553-
queryParams.addAll(ApiInvoker.parameterToPairs("", "limit", limit));
554-
queryParams.addAll(ApiInvoker.parameterToPairs("", "limit_levels", limitLevels));
555-
556-
557424
String[] contentTypes = {
558425

559426
};

coinapi/market-data-api-rest/sdk/apex/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ Class | Method | HTTP request | Description
107107
*OASOrderBookApi* | [**v1OrderbooksSymbolIdCurrentGet**](OASOrderBookApi.md#v1OrderbooksSymbolIdCurrentGet) | **GET** /v1/orderbooks/{symbol_id}/current | Get current order book
108108
*OASOrderBookApi* | [**v1OrderbooksSymbolIdDepthCurrentGet**](OASOrderBookApi.md#v1OrderbooksSymbolIdDepthCurrentGet) | **GET** /v1/orderbooks/{symbol_id}/depth/current | Current depth of the order book
109109
*OASOrderBookApi* | [**v1OrderbooksSymbolIdHistoryGet**](OASOrderBookApi.md#v1OrderbooksSymbolIdHistoryGet) | **GET** /v1/orderbooks/{symbol_id}/history | Historical data
110-
*OASOrderBookApi* | [**v1OrderbooksSymbolIdLatestGet**](OASOrderBookApi.md#v1OrderbooksSymbolIdLatestGet) | **GET** /v1/orderbooks/{symbol_id}/latest | Latest data
111110
*OASOrderBookL3Api* | [**v1Orderbooks3CurrentGet**](OASOrderBookL3Api.md#v1Orderbooks3CurrentGet) | **GET** /v1/orderbooks3/current | Current order books
112111
*OASOrderBookL3Api* | [**v1Orderbooks3SymbolIdCurrentGet**](OASOrderBookL3Api.md#v1Orderbooks3SymbolIdCurrentGet) | **GET** /v1/orderbooks3/{symbol_id}/current | Current order book by symbol_id
113112
*OASQuotesApi* | [**v1QuotesCurrentGet**](OASQuotesApi.md#v1QuotesCurrentGet) | **GET** /v1/quotes/current | Current data

coinapi/market-data-api-rest/sdk/apex/force-app/main/default/classes/OASOrderBookApi.cls

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -123,36 +123,4 @@ public class OASOrderBookApi {
123123
List<OASV1OrderBook>.class
124124
);
125125
}
126-
/**
127-
* Latest data
128-
* Get latest order book snapshots for a specific symbol, returned in time descending order.\n \n:::info\nThe historical order book data via the REST API is currently limited by a number of updates and to the maximum number of 20 levels.\n:::
129-
* @param symbolId Symbol identifier of requested timeseries (from the Metadata -&gt; Symbols) (required)
130-
* @param r_limit Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request) (optional, default to 100)
131-
* @param limitLevels Maximum amount of levels from each side of the book to include in response (optional) (optional)
132-
* @return List<OASV1OrderBook>
133-
* @throws OAS.ApiException if fails to make API call
134-
*/
135-
public List<OASV1OrderBook> v1OrderbooksSymbolIdLatestGet(Map<String, Object> params) {
136-
client.assertNotNull(params.get('symbolId'), 'symbolId');
137-
List<OAS.Param> query = new List<OAS.Param>();
138-
139-
// cast query params to verify their expected type
140-
query.addAll(client.makeParam('limit', (Integer) params.get('r_limit')));
141-
query.addAll(client.makeParam('limit_levels', (Integer) params.get('limitLevels')));
142-
143-
List<OAS.Param> form = new List<OAS.Param>();
144-
145-
return (List<OASV1OrderBook>) client.invoke(
146-
'GET', '/v1/orderbooks/{symbol_id}/latest', '',
147-
query, form,
148-
new Map<String, Object>{
149-
'symbol_id' => (String) params.get('symbolId')
150-
},
151-
new Map<String, Object>(),
152-
new List<String>{ 'text/plain', 'application/json', 'text/json', 'application/x-msgpack' },
153-
new List<String>(),
154-
new List<String> { 'APIKey', 'JWT' },
155-
List<OASV1OrderBook>.class
156-
);
157-
}
158126
}

coinapi/market-data-api-rest/sdk/apex/force-app/main/default/classes/OASOrderBookApiTest.cls

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -234,50 +234,4 @@ private class OASOrderBookApiTest {
234234
response = (List<OASV1OrderBook>) api.v1OrderbooksSymbolIdHistoryGet(params);
235235
System.assertEquals(expectedResponse, response);
236236
}
237-
238-
/**
239-
* Latest data
240-
*
241-
* Get latest order book snapshots for a specific symbol, returned in time descending order.\n \n:::info\nThe historical order book data via the REST API is currently limited by a number of updates and to the maximum number of 20 levels.\n:::
242-
*/
243-
@isTest
244-
private static void v1OrderbooksSymbolIdLatestGetTest() {
245-
HttpResponse res = new HttpResponse();
246-
res.setStatusCode(200);
247-
res.setStatus('OK');
248-
Test.setMock(HttpCalloutMock.class, new OASResponseMock(res));
249-
250-
Map<String, Object> params = new Map<String, Object>{
251-
'symbolId' => 'null',
252-
'r_limit' => '',
253-
'limitLevels' => ''
254-
};
255-
256-
OASClient client;
257-
OASOrderBookApi api;
258-
List<OASV1OrderBook> response;
259-
List<OASV1OrderBook> expectedResponse;
260-
String js = '';
261-
262-
client = new OASClient();
263-
api = new OASOrderBookApi(client);
264-
((OAS.ApiKeyAuth)client.getAuthentication('APIKey')).setApiKey('foo-bar-api-key');
265-
266-
267-
js = JSON.serialize(new List<OASV1OrderBook>{OASV1OrderBook.getExample()});
268-
res.setHeader('Content-Type', 'application/json');
269-
res.setBody(js);
270-
expectedResponse = new List<OASV1OrderBook>{OASV1OrderBook.getExample()};
271-
response = (List<OASV1OrderBook>) api.v1OrderbooksSymbolIdLatestGet(params);
272-
System.assertEquals(expectedResponse, response);
273-
client = new OASClient();
274-
api = new OASOrderBookApi(client);
275-
276-
js = JSON.serialize(new List<OASV1OrderBook>{OASV1OrderBook.getExample()});
277-
res.setHeader('Content-Type', 'application/json');
278-
res.setBody(js);
279-
expectedResponse = new List<OASV1OrderBook>{OASV1OrderBook.getExample()};
280-
response = (List<OASV1OrderBook>) api.v1OrderbooksSymbolIdLatestGet(params);
281-
System.assertEquals(expectedResponse, response);
282-
}
283237
}

coinapi/market-data-api-rest/sdk/bash/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ Class | Method | HTTP request | Description
143143
*OrderBookApi* | [**v1OrderbooksSymbolIdCurrentGet**](docs/OrderBookApi.md#v1orderbookssymbolidcurrentget) | **GET** /v1/orderbooks/{symbol_id}/current | Get current order book
144144
*OrderBookApi* | [**v1OrderbooksSymbolIdDepthCurrentGet**](docs/OrderBookApi.md#v1orderbookssymboliddepthcurrentget) | **GET** /v1/orderbooks/{symbol_id}/depth/current | Current depth of the order book
145145
*OrderBookApi* | [**v1OrderbooksSymbolIdHistoryGet**](docs/OrderBookApi.md#v1orderbookssymbolidhistoryget) | **GET** /v1/orderbooks/{symbol_id}/history | Historical data
146-
*OrderBookApi* | [**v1OrderbooksSymbolIdLatestGet**](docs/OrderBookApi.md#v1orderbookssymbolidlatestget) | **GET** /v1/orderbooks/{symbol_id}/latest | Latest data
147146
*OrderBookL3Api* | [**v1Orderbooks3CurrentGet**](docs/OrderBookL3Api.md#v1orderbooks3currentget) | **GET** /v1/orderbooks3/current | Current order books
148147
*OrderBookL3Api* | [**v1Orderbooks3SymbolIdCurrentGet**](docs/OrderBookL3Api.md#v1orderbooks3symbolidcurrentget) | **GET** /v1/orderbooks3/{symbol_id}/current | Current order book by symbol_id
149148
*QuotesApi* | [**v1QuotesCurrentGet**](docs/QuotesApi.md#v1quotescurrentget) | **GET** /v1/quotes/current | Current data

0 commit comments

Comments
 (0)