Skip to content

Commit 0f3b355

Browse files
author
Sentio Bot
committed
chore: update
1 parent f1334a6 commit 0f3b355

File tree

5 files changed

+207
-59
lines changed

5 files changed

+207
-59
lines changed

doc/index.html

Lines changed: 82 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3165,6 +3165,25 @@
31653165
"type" : "string"
31663166
}
31673167
}
3168+
};
3169+
defs["price_service.BatchGetPricesRequest"] = {
3170+
"title" : "GetPricesRequest is the request for GetPrices.\nreturn every price on every given timestamp (if exact exists) for the given coin",
3171+
"type" : "object",
3172+
"properties" : {
3173+
"timestamps" : {
3174+
"type" : "array",
3175+
"items" : {
3176+
"type" : "string",
3177+
"format" : "date-time"
3178+
}
3179+
},
3180+
"coinIds" : {
3181+
"type" : "array",
3182+
"items" : {
3183+
"$ref" : "#/components/schemas/price_service.CoinID"
3184+
}
3185+
}
3186+
}
31683187
};
31693188
defs["price_service.BatchGetPricesResponse"] = {
31703189
"type" : "object",
@@ -23135,7 +23154,7 @@ <h1>batchGetPrices</h1>
2313523154
<p class="marked"></p>
2313623155
<p></p>
2313723156
<br />
23138-
<pre class="prettyprint language-html prettyprinted" data-type="get"><code><span class="pln">/api/v1/prices/batch</span></code></pre>
23157+
<pre class="prettyprint language-html prettyprinted" data-type="post"><code><span class="pln">/api/v1/prices/batch</span></code></pre>
2313923158
<p>
2314023159
<h3>Usage and SDK Samples</h3>
2314123160
</p>
@@ -23157,10 +23176,12 @@ <h3>Usage and SDK Samples</h3>
2315723176

2315823177
<div class="tab-content">
2315923178
<div class="tab-pane active" id="examples-Price-batchGetPrices-0-curl">
23160-
<pre class="prettyprint"><code class="language-bsh">curl -X GET \
23179+
<pre class="prettyprint"><code class="language-bsh">curl -X POST \
2316123180
-H "api-key: [[apiKey]]" \
2316223181
-H "Accept: application/json" \
23163-
"https://app.sentio.xyz/api/v1/prices/batch?timestamps="
23182+
-H "Content-Type: application/json" \
23183+
"https://app.sentio.xyz/api/v1/prices/batch" \
23184+
-d ''
2316423185
</code></pre>
2316523186
</div>
2316623187
<div class="tab-pane" id="examples-Price-batchGetPrices-0-java">
@@ -23184,10 +23205,10 @@ <h3>Usage and SDK Samples</h3>
2318423205

2318523206
// Create an instance of the API class
2318623207
PriceApi apiInstance = new PriceApi();
23187-
array[Date] timestamps = ; // array[Date] |
23208+
PriceServiceBatchGetPricesRequest body = ; // PriceServiceBatchGetPricesRequest |
2318823209

2318923210
try {
23190-
price_service.BatchGetPricesResponse result = apiInstance.batchGetPrices(timestamps);
23211+
price_service.BatchGetPricesResponse result = apiInstance.batchGetPrices(body);
2319123212
System.out.println(result);
2319223213
} catch (ApiException e) {
2319323214
System.err.println("Exception when calling PriceApi#batchGetPrices");
@@ -23203,10 +23224,10 @@ <h3>Usage and SDK Samples</h3>
2320323224

2320423225
final api_instance = DefaultApi();
2320523226

23206-
final array[Date] timestamps = new array[Date](); // array[Date] |
23227+
final PriceServiceBatchGetPricesRequest body = new PriceServiceBatchGetPricesRequest(); // PriceServiceBatchGetPricesRequest |
2320723228

2320823229
try {
23209-
final result = await api_instance.batchGetPrices(timestamps);
23230+
final result = await api_instance.batchGetPrices(body);
2321023231
print(result);
2321123232
} catch (e) {
2321223233
print('Exception when calling DefaultApi->batchGetPrices: $e\n');
@@ -23221,10 +23242,10 @@ <h3>Usage and SDK Samples</h3>
2322123242
public class PriceApiExample {
2322223243
public static void main(String[] args) {
2322323244
PriceApi apiInstance = new PriceApi();
23224-
array[Date] timestamps = ; // array[Date] |
23245+
PriceServiceBatchGetPricesRequest body = ; // PriceServiceBatchGetPricesRequest |
2322523246

2322623247
try {
23227-
price_service.BatchGetPricesResponse result = apiInstance.batchGetPrices(timestamps);
23248+
price_service.BatchGetPricesResponse result = apiInstance.batchGetPrices(body);
2322823249
System.out.println(result);
2322923250
} catch (ApiException e) {
2323023251
System.err.println("Exception when calling PriceApi#batchGetPrices");
@@ -23248,10 +23269,10 @@ <h3>Usage and SDK Samples</h3>
2324823269

2324923270
// Create an instance of the API class
2325023271
PriceApi *apiInstance = [[PriceApi alloc] init];
23251-
array[Date] *timestamps = ; // (optional) (default to null)
23272+
PriceServiceBatchGetPricesRequest *body = ; //
2325223273

2325323274
// Batch get prices
23254-
[apiInstance batchGetPricesWith:timestamps
23275+
[apiInstance batchGetPricesWith:body
2325523276
completionHandler: ^(price_service.BatchGetPricesResponse output, NSError* error) {
2325623277
if (output) {
2325723278
NSLog(@"%@", output);
@@ -23275,9 +23296,7 @@ <h3>Usage and SDK Samples</h3>
2327523296

2327623297
// Create an instance of the API class
2327723298
var api = new SentioApi.PriceApi()
23278-
var opts = {
23279-
'timestamps': // {array[Date]}
23280-
};
23299+
var body = ; // {PriceServiceBatchGetPricesRequest}
2328123300

2328223301
var callback = function(error, data, response) {
2328323302
if (error) {
@@ -23286,7 +23305,7 @@ <h3>Usage and SDK Samples</h3>
2328623305
console.log('API called successfully. Returned data: ' + data);
2328723306
}
2328823307
};
23289-
api.batchGetPrices(opts, callback);
23308+
api.batchGetPrices(body, callback);
2329023309
</code></pre>
2329123310
</div>
2329223311

@@ -23313,11 +23332,11 @@ <h3>Usage and SDK Samples</h3>
2331323332

2331423333
// Create an instance of the API class
2331523334
var apiInstance = new PriceApi();
23316-
var timestamps = new array[Date](); // array[Date] | (optional) (default to null)
23335+
var body = new PriceServiceBatchGetPricesRequest(); // PriceServiceBatchGetPricesRequest |
2331723336

2331823337
try {
2331923338
// Batch get prices
23320-
price_service.BatchGetPricesResponse result = apiInstance.batchGetPrices(timestamps);
23339+
price_service.BatchGetPricesResponse result = apiInstance.batchGetPrices(body);
2332123340
Debug.WriteLine(result);
2332223341
} catch (Exception e) {
2332323342
Debug.Print("Exception when calling PriceApi.batchGetPrices: " + e.Message );
@@ -23339,10 +23358,10 @@ <h3>Usage and SDK Samples</h3>
2333923358

2334023359
// Create an instance of the API class
2334123360
$api_instance = new OpenAPITools\Client\Api\PriceApi();
23342-
$timestamps = ; // array[Date] |
23361+
$body = ; // PriceServiceBatchGetPricesRequest |
2334323362

2334423363
try {
23345-
$result = $api_instance->batchGetPrices($timestamps);
23364+
$result = $api_instance->batchGetPrices($body);
2334623365
print_r($result);
2334723366
} catch (Exception $e) {
2334823367
echo 'Exception when calling PriceApi->batchGetPrices: ', $e->getMessage(), PHP_EOL;
@@ -23362,10 +23381,10 @@ <h3>Usage and SDK Samples</h3>
2336223381

2336323382
# Create an instance of the API class
2336423383
my $api_instance = WWW::OPenAPIClient::PriceApi->new();
23365-
my $timestamps = []; # array[Date] |
23384+
my $body = WWW::OPenAPIClient::Object::PriceServiceBatchGetPricesRequest->new(); # PriceServiceBatchGetPricesRequest |
2336623385

2336723386
eval {
23368-
my $result = $api_instance->batchGetPrices(timestamps => $timestamps);
23387+
my $result = $api_instance->batchGetPrices(body => $body);
2336923388
print Dumper($result);
2337023389
};
2337123390
if ($@) {
@@ -23387,11 +23406,11 @@ <h3>Usage and SDK Samples</h3>
2338723406

2338823407
# Create an instance of the API class
2338923408
api_instance = openapi_client.PriceApi()
23390-
timestamps = # array[Date] | (optional) (default to null)
23409+
body = # PriceServiceBatchGetPricesRequest |
2339123410

2339223411
try:
2339323412
# Batch get prices
23394-
api_response = api_instance.batch_get_prices(timestamps=timestamps)
23413+
api_response = api_instance.batch_get_prices(body)
2339523414
pprint(api_response)
2339623415
except ApiException as e:
2339723416
print("Exception when calling PriceApi->batchGetPrices: %s\n" % e)</code></pre>
@@ -23401,10 +23420,10 @@ <h3>Usage and SDK Samples</h3>
2340123420
<pre class="prettyprint"><code class="language-rust">extern crate PriceApi;
2340223421

2340323422
pub fn main() {
23404-
let timestamps = ; // array[Date]
23423+
let body = ; // PriceServiceBatchGetPricesRequest
2340523424

2340623425
let mut context = PriceApi::Context::default();
23407-
let result = client.batchGetPrices(timestamps, &context).wait();
23426+
let result = client.batchGetPrices(body, &context).wait();
2340823427

2340923428
println!("{:?}", result);
2341023429
}
@@ -23421,36 +23440,57 @@ <h2>Parameters</h2>
2342123440

2342223441

2342323442

23424-
23425-
23426-
<div class="methodsubtabletitle">Query parameters</div>
23443+
<div class="methodsubtabletitle">Body parameters</div>
2342723444
<table id="methodsubtable">
2342823445
<tr>
2342923446
<th width="150px">Name</th>
2343023447
<th>Description</th>
2343123448
</tr>
23432-
<tr><td style="width:150px;">timestamps</td>
23449+
<tr><td style="width:150px;">body <span style="color:red;">*</span></td>
2343323450
<td>
23451+
<p class="marked"></p>
23452+
<script>
23453+
$(document).ready(function() {
23454+
var schemaWrapper = {
23455+
"content" : {
23456+
"application/json" : {
23457+
"schema" : {
23458+
"$ref" : "#/components/schemas/price_service.BatchGetPricesRequest"
23459+
}
23460+
}
23461+
},
23462+
"required" : true
23463+
};
2343423464

23465+
var schema = findNode('schema',schemaWrapper).schema;
23466+
if (!schema) {
23467+
schema = schemaWrapper.schema;
23468+
}
23469+
if (schema.$ref != null) {
23470+
schema = defsParser.$refs.get(schema.$ref);
23471+
} else if (schema.items != null && schema.items.$ref != null) {
23472+
schema.items = defsParser.$refs.get(schema.items.$ref);
23473+
} else {
23474+
schemaWrapper.definitions = Object.assign({}, defs);
23475+
$RefParser.dereference(schemaWrapper).catch(function(err) {
23476+
console.log(err);
23477+
});
23478+
}
2343523479

23436-
<div id="d2e199_batchGetPrices_timestamps">
23437-
<div class="json-schema-view">
23438-
<div class="primitive">
23439-
<span class="type">
23440-
array[Date]
23441-
</span>
23442-
<span class="format">
23443-
(date-time)
23444-
</span>
23445-
23446-
</div>
23447-
</div>
23448-
</div>
23480+
var view = new JSONSchemaView(schema,2,{isBodyParam: true});
23481+
var result = $('#d2e199_batchGetPrices_body');
23482+
result.empty();
23483+
result.append(view.render());
23484+
});
23485+
</script>
23486+
<div id="d2e199_batchGetPrices_body"></div>
2344923487
</td>
2345023488
</tr>
2345123489

2345223490
</table>
2345323491

23492+
23493+
2345423494
<h2>Responses</h2>
2345523495
<h3 id="examples-Price-batchGetPrices-title-200"></h3>
2345623496
<p id="examples-Price-batchGetPrices-description-200" class="marked"></p>

openapi.json

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@
848848
}
849849
},
850850
"/api/v1/prices/batch": {
851-
"get": {
851+
"post": {
852852
"summary": "Batch get prices",
853853
"operationId": "BatchGetPrices",
854854
"responses": {
@@ -861,15 +861,12 @@
861861
},
862862
"parameters": [
863863
{
864-
"name": "timestamps",
865-
"in": "query",
866-
"required": false,
867-
"type": "array",
868-
"items": {
869-
"type": "string",
870-
"format": "date-time"
871-
},
872-
"collectionFormat": "multi"
864+
"name": "body",
865+
"in": "body",
866+
"required": true,
867+
"schema": {
868+
"$ref": "#/definitions/price_service.BatchGetPricesRequest"
869+
}
873870
}
874871
],
875872
"tags": [
@@ -4822,6 +4819,26 @@
48224819
}
48234820
}
48244821
},
4822+
"price_service.BatchGetPricesRequest": {
4823+
"type": "object",
4824+
"properties": {
4825+
"timestamps": {
4826+
"type": "array",
4827+
"items": {
4828+
"type": "string",
4829+
"format": "date-time"
4830+
}
4831+
},
4832+
"coinIds": {
4833+
"type": "array",
4834+
"items": {
4835+
"type": "object",
4836+
"$ref": "#/definitions/price_service.CoinID"
4837+
}
4838+
}
4839+
},
4840+
"title": "GetPricesRequest is the request for GetPrices.\nreturn every price on every given timestamp (if exact exists) for the given coin"
4841+
},
48254842
"price_service.BatchGetPricesResponse": {
48264843
"type": "object",
48274844
"properties": {

src/apis/PriceApi.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@
1515

1616
import * as runtime from '../runtime.js';
1717
import type {
18+
PriceServiceBatchGetPricesRequest,
1819
PriceServiceBatchGetPricesResponse,
1920
PriceServiceCheckLatestPriceResponse,
2021
PriceServiceGetPriceResponse,
2122
PriceServiceListCoinsResponse,
2223
} from '../models/index.js';
2324
import {
25+
PriceServiceBatchGetPricesRequestFromJSON,
26+
PriceServiceBatchGetPricesRequestToJSON,
2427
PriceServiceBatchGetPricesResponseFromJSON,
2528
PriceServiceBatchGetPricesResponseToJSON,
2629
PriceServiceCheckLatestPriceResponseFromJSON,
@@ -32,7 +35,7 @@ import {
3235
} from '../models/index.js';
3336

3437
export interface BatchGetPricesRequest {
35-
timestamps?: Array<Date>;
38+
body: PriceServiceBatchGetPricesRequest;
3639
}
3740

3841
export interface GetPriceRequest {
@@ -59,23 +62,29 @@ export class PriceApi extends runtime.BaseAPI {
5962
* Batch get prices
6063
*/
6164
async batchGetPricesRaw(requestParameters: BatchGetPricesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PriceServiceBatchGetPricesResponse>> {
62-
const queryParameters: any = {};
63-
64-
if (requestParameters['timestamps'] != null) {
65-
queryParameters['timestamps'] = requestParameters['timestamps'];
65+
if (requestParameters['body'] == null) {
66+
throw new runtime.RequiredError(
67+
'body',
68+
'Required parameter "body" was null or undefined when calling batchGetPrices().'
69+
);
6670
}
6771

72+
const queryParameters: any = {};
73+
6874
const headerParameters: runtime.HTTPHeaders = {};
6975

76+
headerParameters['Content-Type'] = 'application/json';
77+
7078
if (this.configuration && this.configuration.apiKey) {
7179
headerParameters["api-key"] = await this.configuration.apiKey("api-key"); // ApiKeyAuth authentication
7280
}
7381

7482
const response = await this.request({
7583
path: `/api/v1/prices/batch`,
76-
method: 'GET',
84+
method: 'POST',
7785
headers: headerParameters,
7886
query: queryParameters,
87+
body: PriceServiceBatchGetPricesRequestToJSON(requestParameters['body']),
7988
}, initOverrides);
8089

8190
return new runtime.JSONApiResponse(response, (jsonValue) => PriceServiceBatchGetPricesResponseFromJSON(jsonValue));
@@ -84,7 +93,7 @@ export class PriceApi extends runtime.BaseAPI {
8493
/**
8594
* Batch get prices
8695
*/
87-
async batchGetPrices(requestParameters: BatchGetPricesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PriceServiceBatchGetPricesResponse> {
96+
async batchGetPrices(requestParameters: BatchGetPricesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PriceServiceBatchGetPricesResponse> {
8897
const response = await this.batchGetPricesRaw(requestParameters, initOverrides);
8998
return await response.value();
9099
}

0 commit comments

Comments
 (0)