Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Sentio Bot committed Nov 6, 2024
1 parent f1334a6 commit 0f3b355
Show file tree
Hide file tree
Showing 5 changed files with 207 additions and 59 deletions.
124 changes: 82 additions & 42 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3165,6 +3165,25 @@
"type" : "string"
}
}
};
defs["price_service.BatchGetPricesRequest"] = {
"title" : "GetPricesRequest is the request for GetPrices.\nreturn every price on every given timestamp (if exact exists) for the given coin",
"type" : "object",
"properties" : {
"timestamps" : {
"type" : "array",
"items" : {
"type" : "string",
"format" : "date-time"
}
},
"coinIds" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/price_service.CoinID"
}
}
}
};
defs["price_service.BatchGetPricesResponse"] = {
"type" : "object",
Expand Down Expand Up @@ -23135,7 +23154,7 @@ <h1>batchGetPrices</h1>
<p class="marked"></p>
<p></p>
<br />
<pre class="prettyprint language-html prettyprinted" data-type="get"><code><span class="pln">/api/v1/prices/batch</span></code></pre>
<pre class="prettyprint language-html prettyprinted" data-type="post"><code><span class="pln">/api/v1/prices/batch</span></code></pre>
<p>
<h3>Usage and SDK Samples</h3>
</p>
Expand All @@ -23157,10 +23176,12 @@ <h3>Usage and SDK Samples</h3>

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

// Create an instance of the API class
PriceApi apiInstance = new PriceApi();
array[Date] timestamps = ; // array[Date] |
PriceServiceBatchGetPricesRequest body = ; // PriceServiceBatchGetPricesRequest |

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

final api_instance = DefaultApi();

final array[Date] timestamps = new array[Date](); // array[Date] |
final PriceServiceBatchGetPricesRequest body = new PriceServiceBatchGetPricesRequest(); // PriceServiceBatchGetPricesRequest |

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

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

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

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

// Create an instance of the API class
var api = new SentioApi.PriceApi()
var opts = {
'timestamps': // {array[Date]}
};
var body = ; // {PriceServiceBatchGetPricesRequest}

var callback = function(error, data, response) {
if (error) {
Expand All @@ -23286,7 +23305,7 @@ <h3>Usage and SDK Samples</h3>
console.log('API called successfully. Returned data: ' + data);
}
};
api.batchGetPrices(opts, callback);
api.batchGetPrices(body, callback);
</code></pre>
</div>

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

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

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

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

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

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

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

# Create an instance of the API class
api_instance = openapi_client.PriceApi()
timestamps = # array[Date] | (optional) (default to null)
body = # PriceServiceBatchGetPricesRequest |

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

pub fn main() {
let timestamps = ; // array[Date]
let body = ; // PriceServiceBatchGetPricesRequest

let mut context = PriceApi::Context::default();
let result = client.batchGetPrices(timestamps, &context).wait();
let result = client.batchGetPrices(body, &context).wait();

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





<div class="methodsubtabletitle">Query parameters</div>
<div class="methodsubtabletitle">Body parameters</div>
<table id="methodsubtable">
<tr>
<th width="150px">Name</th>
<th>Description</th>
</tr>
<tr><td style="width:150px;">timestamps</td>
<tr><td style="width:150px;">body <span style="color:red;">*</span></td>
<td>
<p class="marked"></p>
<script>
$(document).ready(function() {
var schemaWrapper = {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/price_service.BatchGetPricesRequest"
}
}
},
"required" : true
};

var schema = findNode('schema',schemaWrapper).schema;
if (!schema) {
schema = schemaWrapper.schema;
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}

<div id="d2e199_batchGetPrices_timestamps">
<div class="json-schema-view">
<div class="primitive">
<span class="type">
array[Date]
</span>
<span class="format">
(date-time)
</span>

</div>
</div>
</div>
var view = new JSONSchemaView(schema,2,{isBodyParam: true});
var result = $('#d2e199_batchGetPrices_body');
result.empty();
result.append(view.render());
});
</script>
<div id="d2e199_batchGetPrices_body"></div>
</td>
</tr>

</table>



<h2>Responses</h2>
<h3 id="examples-Price-batchGetPrices-title-200"></h3>
<p id="examples-Price-batchGetPrices-description-200" class="marked"></p>
Expand Down
37 changes: 27 additions & 10 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@
}
},
"/api/v1/prices/batch": {
"get": {
"post": {
"summary": "Batch get prices",
"operationId": "BatchGetPrices",
"responses": {
Expand All @@ -861,15 +861,12 @@
},
"parameters": [
{
"name": "timestamps",
"in": "query",
"required": false,
"type": "array",
"items": {
"type": "string",
"format": "date-time"
},
"collectionFormat": "multi"
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/price_service.BatchGetPricesRequest"
}
}
],
"tags": [
Expand Down Expand Up @@ -4822,6 +4819,26 @@
}
}
},
"price_service.BatchGetPricesRequest": {
"type": "object",
"properties": {
"timestamps": {
"type": "array",
"items": {
"type": "string",
"format": "date-time"
}
},
"coinIds": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/price_service.CoinID"
}
}
},
"title": "GetPricesRequest is the request for GetPrices.\nreturn every price on every given timestamp (if exact exists) for the given coin"
},
"price_service.BatchGetPricesResponse": {
"type": "object",
"properties": {
Expand Down
23 changes: 16 additions & 7 deletions src/apis/PriceApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@

import * as runtime from '../runtime.js';
import type {
PriceServiceBatchGetPricesRequest,
PriceServiceBatchGetPricesResponse,
PriceServiceCheckLatestPriceResponse,
PriceServiceGetPriceResponse,
PriceServiceListCoinsResponse,
} from '../models/index.js';
import {
PriceServiceBatchGetPricesRequestFromJSON,
PriceServiceBatchGetPricesRequestToJSON,
PriceServiceBatchGetPricesResponseFromJSON,
PriceServiceBatchGetPricesResponseToJSON,
PriceServiceCheckLatestPriceResponseFromJSON,
Expand All @@ -32,7 +35,7 @@ import {
} from '../models/index.js';

export interface BatchGetPricesRequest {
timestamps?: Array<Date>;
body: PriceServiceBatchGetPricesRequest;
}

export interface GetPriceRequest {
Expand All @@ -59,23 +62,29 @@ export class PriceApi extends runtime.BaseAPI {
* Batch get prices
*/
async batchGetPricesRaw(requestParameters: BatchGetPricesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PriceServiceBatchGetPricesResponse>> {
const queryParameters: any = {};

if (requestParameters['timestamps'] != null) {
queryParameters['timestamps'] = requestParameters['timestamps'];
if (requestParameters['body'] == null) {
throw new runtime.RequiredError(
'body',
'Required parameter "body" was null or undefined when calling batchGetPrices().'
);
}

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

headerParameters['Content-Type'] = 'application/json';

if (this.configuration && this.configuration.apiKey) {
headerParameters["api-key"] = await this.configuration.apiKey("api-key"); // ApiKeyAuth authentication
}

const response = await this.request({
path: `/api/v1/prices/batch`,
method: 'GET',
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: PriceServiceBatchGetPricesRequestToJSON(requestParameters['body']),
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => PriceServiceBatchGetPricesResponseFromJSON(jsonValue));
Expand All @@ -84,7 +93,7 @@ export class PriceApi extends runtime.BaseAPI {
/**
* Batch get prices
*/
async batchGetPrices(requestParameters: BatchGetPricesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PriceServiceBatchGetPricesResponse> {
async batchGetPrices(requestParameters: BatchGetPricesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PriceServiceBatchGetPricesResponse> {
const response = await this.batchGetPricesRaw(requestParameters, initOverrides);
return await response.value();
}
Expand Down
Loading

0 comments on commit 0f3b355

Please sign in to comment.