diff --git a/doc/index.html b/doc/index.html index 45592c9..86aa569 100755 --- a/doc/index.html +++ b/doc/index.html @@ -3701,6 +3701,47 @@ "type" : "string" } } +}; + defs["price_service.AddCoinByGeckoRequest"] = { + "type" : "object", + "properties" : { + "coingeckoId" : { + "type" : "string" + } + } +}; + defs["price_service.AddCoinByGeckoResponse"] = { + "type" : "object", + "properties" : { + "status" : { + "$ref" : "#/components/schemas/price_service.AddCoinByGeckoResponse.Status" + }, + "message" : { + "type" : "string" + }, + "currentPrice" : { + "type" : "number", + "format" : "double" + }, + "timestamp" : { + "type" : "string", + "format" : "date-time" + }, + "symbol" : { + "type" : "string" + }, + "coins" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/price_service.CoinID" + } + } + } +}; + defs["price_service.AddCoinByGeckoResponse.Status"] = { + "type" : "string", + "default" : "OK", + "enum" : [ "OK", "ALREADY_EXISTS", "MISMATCH_WITH_EXISTING", "GECKO_NOT_FOUND", "GECKO_RETURN_NON_SUPPORTED_CHAIN" ] }; 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", @@ -5691,6 +5732,10 @@
  • simulateTransactionBundle
  • + +
  • + addCoinByGecko +
  • createFork @@ -21280,6 +21325,435 @@


    +
    +

    Default

    +
    +
    +
    +

    addCoinByGecko

    +

    +
    +
    +
    +

    +

    +

    +
    +
    /api/v1/prices/add_coin_by_gecko
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST \
    +-H "api-key: [[apiKey]]" \
    + -H "Accept: application/json" \
    + -H "Content-Type: application/json" \
    + "https://app.sentio.xyz/api/v1/prices/add_coin_by_gecko" \
    + -d ''
    +
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.DefaultApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class DefaultApiExample {
    +    public static void main(String[] args) {
    +        ApiClient defaultClient = Configuration.getDefaultApiClient();
    +
    +        // Configure API key authorization: ApiKeyAuth
    +        ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
    +        ApiKeyAuth.setApiKey("YOUR API KEY");
    +        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +        //ApiKeyAuth.setApiKeyPrefix("Token");
    +
    +        // Create an instance of the API class
    +        DefaultApi apiInstance = new DefaultApi();
    +        PriceServiceAddCoinByGeckoRequest body = ; // PriceServiceAddCoinByGeckoRequest | 
    +
    +        try {
    +            price_service.AddCoinByGeckoResponse result = apiInstance.addCoinByGecko(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DefaultApi#addCoinByGecko");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    +
    + +
    +
    import 'package:openapi/api.dart';
    +
    +final api_instance = DefaultApi();
    +
    +final PriceServiceAddCoinByGeckoRequest body = new PriceServiceAddCoinByGeckoRequest(); // PriceServiceAddCoinByGeckoRequest | 
    +
    +try {
    +    final result = await api_instance.addCoinByGecko(body);
    +    print(result);
    +} catch (e) {
    +    print('Exception when calling DefaultApi->addCoinByGecko: $e\n');
    +}
    +
    +
    +
    + +
    +
    import org.openapitools.client.api.DefaultApi;
    +
    +public class DefaultApiExample {
    +    public static void main(String[] args) {
    +        DefaultApi apiInstance = new DefaultApi();
    +        PriceServiceAddCoinByGeckoRequest body = ; // PriceServiceAddCoinByGeckoRequest | 
    +
    +        try {
    +            price_service.AddCoinByGeckoResponse result = apiInstance.addCoinByGecko(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DefaultApi#addCoinByGecko");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Configuration *apiConfig = [Configuration sharedConfig];
    +
    +// Configure API key authorization: (authentication scheme: ApiKeyAuth)
    +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api-key"];
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api-key"];
    +
    +
    +// Create an instance of the API class
    +DefaultApi *apiInstance = [[DefaultApi alloc] init];
    +PriceServiceAddCoinByGeckoRequest *body = ; // 
    +
    +[apiInstance addCoinByGeckoWith:body
    +              completionHandler: ^(price_service.AddCoinByGeckoResponse output, NSError* error) {
    +    if (output) {
    +        NSLog(@"%@", output);
    +    }
    +    if (error) {
    +        NSLog(@"Error: %@", error);
    +    }
    +}];
    +
    +
    + +
    +
    var SentioApi = require('sentio_api');
    +var defaultClient = SentioApi.ApiClient.instance;
    +
    +// Configure API key authorization: ApiKeyAuth
    +var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
    +ApiKeyAuth.apiKey = "YOUR API KEY";
    +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +//ApiKeyAuth.apiKeyPrefix['api-key'] = "Token";
    +
    +// Create an instance of the API class
    +var api = new SentioApi.DefaultApi()
    +var body = ; // {PriceServiceAddCoinByGeckoRequest} 
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.addCoinByGecko(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class addCoinByGeckoExample
    +    {
    +        public void main()
    +        {
    +            // Configure API key authorization: ApiKeyAuth
    +            Configuration.Default.ApiKey.Add("api-key", "YOUR_API_KEY");
    +            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +            // Configuration.Default.ApiKeyPrefix.Add("api-key", "Bearer");
    +
    +            // Create an instance of the API class
    +            var apiInstance = new DefaultApi();
    +            var body = new PriceServiceAddCoinByGeckoRequest(); // PriceServiceAddCoinByGeckoRequest | 
    +
    +            try {
    +                price_service.AddCoinByGeckoResponse result = apiInstance.addCoinByGecko(body);
    +                Debug.WriteLine(result);
    +            } catch (Exception e) {
    +                Debug.Print("Exception when calling DefaultApi.addCoinByGecko: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +// Configure API key authorization: ApiKeyAuth
    +OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
    +
    +// Create an instance of the API class
    +$api_instance = new OpenAPITools\Client\Api\DefaultApi();
    +$body = ; // PriceServiceAddCoinByGeckoRequest | 
    +
    +try {
    +    $result = $api_instance->addCoinByGecko($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling DefaultApi->addCoinByGecko: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::DefaultApi;
    +
    +# Configure API key authorization: ApiKeyAuth
    +$WWW::OPenAPIClient::Configuration::api_key->{'api-key'} = 'YOUR_API_KEY';
    +# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'api-key'} = "Bearer";
    +
    +# Create an instance of the API class
    +my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
    +my $body = WWW::OPenAPIClient::Object::PriceServiceAddCoinByGeckoRequest->new(); # PriceServiceAddCoinByGeckoRequest | 
    +
    +eval {
    +    my $result = $api_instance->addCoinByGecko(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling DefaultApi->addCoinByGecko: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure API key authorization: ApiKeyAuth
    +openapi_client.configuration.api_key['api-key'] = 'YOUR_API_KEY'
    +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +# openapi_client.configuration.api_key_prefix['api-key'] = 'Bearer'
    +
    +# Create an instance of the API class
    +api_instance = openapi_client.DefaultApi()
    +body =  # PriceServiceAddCoinByGeckoRequest | 
    +
    +try:
    +    api_response = api_instance.add_coin_by_gecko(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling DefaultApi->addCoinByGecko: %s\n" % e)
    +
    + +
    +
    extern crate DefaultApi;
    +
    +pub fn main() {
    +    let body = ; // PriceServiceAddCoinByGeckoRequest
    +
    +    let mut context = DefaultApi::Context::default();
    +    let result = client.addCoinByGecko(body, &context).wait();
    +
    +    println!("{:?}", result);
    +}
    +
    +
    +
    + +

    Scopes

    + + +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * +

    + +
    +
    + + + +

    Responses

    +

    +

    + + + + + + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    +

    Forks

    diff --git a/openapi.json b/openapi.json index 99c510d..c7a98b7 100644 --- a/openapi.json +++ b/openapi.json @@ -1176,6 +1176,29 @@ ] } }, + "/api/v1/prices/add_coin_by_gecko": { + "post": { + "operationId": "AddCoinByGecko", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/price_service.AddCoinByGeckoResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/price_service.AddCoinByGeckoRequest" + } + } + ] + } + }, "/api/v1/prices/batch": { "post": { "summary": "Batch get prices", @@ -5586,6 +5609,54 @@ } } }, + "price_service.AddCoinByGeckoRequest": { + "type": "object", + "properties": { + "coingeckoId": { + "type": "string" + } + } + }, + "price_service.AddCoinByGeckoResponse": { + "type": "object", + "properties": { + "status": { + "$ref": "#/definitions/price_service.AddCoinByGeckoResponse.Status" + }, + "message": { + "type": "string" + }, + "currentPrice": { + "type": "number", + "format": "double" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "symbol": { + "type": "string" + }, + "coins": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/price_service.CoinID" + } + } + } + }, + "price_service.AddCoinByGeckoResponse.Status": { + "type": "string", + "enum": [ + "OK", + "ALREADY_EXISTS", + "MISMATCH_WITH_EXISTING", + "GECKO_NOT_FOUND", + "GECKO_RETURN_NON_SUPPORTED_CHAIN" + ], + "default": "OK" + }, "price_service.BatchGetPricesRequest": { "type": "object", "properties": { diff --git a/src/DefaultApi.md b/src/DefaultApi.md new file mode 100755 index 0000000..bc8485b --- /dev/null +++ b/src/DefaultApi.md @@ -0,0 +1,64 @@ +# .DefaultApi + +All URIs are relative to *https://app.sentio.xyz* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addCoinByGecko**](DefaultApi.md#addCoinByGecko) | **POST** /api/v1/prices/add_coin_by_gecko | + + +# **addCoinByGecko** +> PriceServiceAddCoinByGeckoResponse addCoinByGecko(body) + + +### Example + + +```typescript +import { createConfiguration, DefaultApi } from ''; +import type { DefaultApiAddCoinByGeckoRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new DefaultApi(configuration); + +const request: DefaultApiAddCoinByGeckoRequest = { + + body: { + coingeckoId: "coingeckoId_example", + }, +}; + +const data = await apiInstance.addCoinByGecko(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **PriceServiceAddCoinByGeckoRequest**| | + + +### Return type + +**PriceServiceAddCoinByGeckoResponse** + +### Authorization + +[ApiKeyAuth](README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + + diff --git a/src/apis/DefaultApi.ts b/src/apis/DefaultApi.ts new file mode 100755 index 0000000..9a3d47e --- /dev/null +++ b/src/apis/DefaultApi.ts @@ -0,0 +1,98 @@ +// TODO: better import syntax? +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi.js'; +import {Configuration} from '../configuration.js'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http.js'; +import {ObjectSerializer} from '../models/ObjectSerializer.js'; +import {ApiException} from './exception.js'; +import {canConsumeForm, isCodeInRange} from '../util.js'; +import {SecurityAuthentication} from '../auth/auth.js'; + + +import { PriceServiceAddCoinByGeckoRequest } from '../models/PriceServiceAddCoinByGeckoRequest.js'; +import { PriceServiceAddCoinByGeckoResponse } from '../models/PriceServiceAddCoinByGeckoResponse.js'; + +/** + * no description + */ +export class DefaultApiRequestFactory extends BaseAPIRequestFactory { + + /** + * @param body + */ + public async addCoinByGecko(body: PriceServiceAddCoinByGeckoRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("DefaultApi", "addCoinByGecko", "body"); + } + + + // Path Params + const localVarPath = '/api/v1/prices/add_coin_by_gecko'; + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "PriceServiceAddCoinByGeckoRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["ApiKeyAuth"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + +} + +export class DefaultApiResponseProcessor { + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to addCoinByGecko + * @throws ApiException if the response code was not in [200, 299] + */ + public async addCoinByGeckoWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: PriceServiceAddCoinByGeckoResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "PriceServiceAddCoinByGeckoResponse", "" + ) as PriceServiceAddCoinByGeckoResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: PriceServiceAddCoinByGeckoResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "PriceServiceAddCoinByGeckoResponse", "" + ) as PriceServiceAddCoinByGeckoResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + } + +} diff --git a/src/index.ts b/src/index.ts index 451a5d8..063bb4b 100755 --- a/src/index.ts +++ b/src/index.ts @@ -8,5 +8,5 @@ export * from "./servers.js"; export { RequiredError } from "./apis/baseapi.js"; export type { PromiseMiddleware as Middleware } from './middleware.js'; -export { PromiseAlertsApi as AlertsApi, PromiseDataApi as DataApi, PromiseDebugAndSimulationApi as DebugAndSimulationApi, PromiseForksApi as ForksApi, PromisePriceApi as PriceApi, PromiseWebApi as WebApi } from './types/PromiseAPI.js'; +export { PromiseAlertsApi as AlertsApi, PromiseDataApi as DataApi, PromiseDebugAndSimulationApi as DebugAndSimulationApi, PromiseDefaultApi as DefaultApi, PromiseForksApi as ForksApi, PromisePriceApi as PriceApi, PromiseWebApi as WebApi } from './types/PromiseAPI.js'; diff --git a/src/models/ObjectSerializer.ts b/src/models/ObjectSerializer.ts index a3a28f2..98ec158 100755 --- a/src/models/ObjectSerializer.ts +++ b/src/models/ObjectSerializer.ts @@ -144,6 +144,9 @@ export * from '../models/MetricsServiceObservabilityServiceQueryBody.js'; export * from '../models/MetricsServiceObservabilityServiceQueryRangeBody.js'; export * from '../models/MetricsServiceQueryValueResponse.js'; export * from '../models/MetricsServiceQueryValueResponseResult.js'; +export * from '../models/PriceServiceAddCoinByGeckoRequest.js'; +export * from '../models/PriceServiceAddCoinByGeckoResponse.js'; +export * from '../models/PriceServiceAddCoinByGeckoResponseStatus.js'; export * from '../models/PriceServiceBatchGetPricesRequest.js'; export * from '../models/PriceServiceBatchGetPricesResponse.js'; export * from '../models/PriceServiceBatchGetPricesResponseCoinPrice.js'; @@ -403,6 +406,9 @@ import { MetricsServiceObservabilityServiceQueryBody } from '../models/MetricsSe import { MetricsServiceObservabilityServiceQueryRangeBody } from '../models/MetricsServiceObservabilityServiceQueryRangeBody.js'; import { MetricsServiceQueryValueResponse } from '../models/MetricsServiceQueryValueResponse.js'; import { MetricsServiceQueryValueResponseResult } from '../models/MetricsServiceQueryValueResponseResult.js'; +import { PriceServiceAddCoinByGeckoRequest } from '../models/PriceServiceAddCoinByGeckoRequest.js'; +import { PriceServiceAddCoinByGeckoResponse } from '../models/PriceServiceAddCoinByGeckoResponse.js'; +import { PriceServiceAddCoinByGeckoResponseStatus } from '../models/PriceServiceAddCoinByGeckoResponseStatus.js'; import { PriceServiceBatchGetPricesRequest } from '../models/PriceServiceBatchGetPricesRequest.js'; import { PriceServiceBatchGetPricesResponse } from '../models/PriceServiceBatchGetPricesResponse.js'; import { PriceServiceBatchGetPricesResponseCoinPrice } from '../models/PriceServiceBatchGetPricesResponseCoinPrice.js'; @@ -554,6 +560,7 @@ let enumsMap: Set = new Set([ "CommonUserAccountStatus", "GoogleProtobufNullValue", "InsightsServiceDataSource", + "PriceServiceAddCoinByGeckoResponseStatus", "SolidityServiceForkType", "SolidityServiceSourceFetcherType", "WebServiceChartChartType", @@ -694,6 +701,8 @@ let typeMap: {[index: string]: any} = { "MetricsServiceObservabilityServiceQueryRangeBody": MetricsServiceObservabilityServiceQueryRangeBody, "MetricsServiceQueryValueResponse": MetricsServiceQueryValueResponse, "MetricsServiceQueryValueResponseResult": MetricsServiceQueryValueResponseResult, + "PriceServiceAddCoinByGeckoRequest": PriceServiceAddCoinByGeckoRequest, + "PriceServiceAddCoinByGeckoResponse": PriceServiceAddCoinByGeckoResponse, "PriceServiceBatchGetPricesRequest": PriceServiceBatchGetPricesRequest, "PriceServiceBatchGetPricesResponse": PriceServiceBatchGetPricesResponse, "PriceServiceBatchGetPricesResponseCoinPrice": PriceServiceBatchGetPricesResponseCoinPrice, diff --git a/src/models/PriceServiceAddCoinByGeckoRequest.ts b/src/models/PriceServiceAddCoinByGeckoRequest.ts new file mode 100755 index 0000000..40c67cc --- /dev/null +++ b/src/models/PriceServiceAddCoinByGeckoRequest.ts @@ -0,0 +1,36 @@ +/** + * Sentio API + * Sentio Open API for query data + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http.js'; + +export class PriceServiceAddCoinByGeckoRequest { + 'coingeckoId'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "coingeckoId", + "baseName": "coingeckoId", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return PriceServiceAddCoinByGeckoRequest.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/PriceServiceAddCoinByGeckoResponse.ts b/src/models/PriceServiceAddCoinByGeckoResponse.ts new file mode 100755 index 0000000..62b125e --- /dev/null +++ b/src/models/PriceServiceAddCoinByGeckoResponse.ts @@ -0,0 +1,75 @@ +/** + * Sentio API + * Sentio Open API for query data + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { PriceServiceAddCoinByGeckoResponseStatus } from '../models/PriceServiceAddCoinByGeckoResponseStatus.js'; +import { PriceServiceCoinID } from '../models/PriceServiceCoinID.js'; +import { HttpFile } from '../http/http.js'; + +export class PriceServiceAddCoinByGeckoResponse { + 'status'?: PriceServiceAddCoinByGeckoResponseStatus; + 'message'?: string; + 'currentPrice'?: number; + 'timestamp'?: Date; + 'symbol'?: string; + 'coins'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "status", + "baseName": "status", + "type": "PriceServiceAddCoinByGeckoResponseStatus", + "format": "" + }, + { + "name": "message", + "baseName": "message", + "type": "string", + "format": "" + }, + { + "name": "currentPrice", + "baseName": "currentPrice", + "type": "number", + "format": "double" + }, + { + "name": "timestamp", + "baseName": "timestamp", + "type": "Date", + "format": "date-time" + }, + { + "name": "symbol", + "baseName": "symbol", + "type": "string", + "format": "" + }, + { + "name": "coins", + "baseName": "coins", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return PriceServiceAddCoinByGeckoResponse.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/PriceServiceAddCoinByGeckoResponseStatus.ts b/src/models/PriceServiceAddCoinByGeckoResponseStatus.ts new file mode 100755 index 0000000..be0f6c8 --- /dev/null +++ b/src/models/PriceServiceAddCoinByGeckoResponseStatus.ts @@ -0,0 +1,21 @@ +/** + * Sentio API + * Sentio Open API for query data + * + * OpenAPI spec version: version not set + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http.js'; + +export enum PriceServiceAddCoinByGeckoResponseStatus { + Ok = 'OK', + AlreadyExists = 'ALREADY_EXISTS', + MismatchWithExisting = 'MISMATCH_WITH_EXISTING', + GeckoNotFound = 'GECKO_NOT_FOUND', + GeckoReturnNonSupportedChain = 'GECKO_RETURN_NON_SUPPORTED_CHAIN' +} diff --git a/src/models/all.ts b/src/models/all.ts index 4a19483..2e76cbf 100755 --- a/src/models/all.ts +++ b/src/models/all.ts @@ -144,6 +144,9 @@ export * from '../models/MetricsServiceObservabilityServiceQueryBody.js' export * from '../models/MetricsServiceObservabilityServiceQueryRangeBody.js' export * from '../models/MetricsServiceQueryValueResponse.js' export * from '../models/MetricsServiceQueryValueResponseResult.js' +export * from '../models/PriceServiceAddCoinByGeckoRequest.js' +export * from '../models/PriceServiceAddCoinByGeckoResponse.js' +export * from '../models/PriceServiceAddCoinByGeckoResponseStatus.js' export * from '../models/PriceServiceBatchGetPricesRequest.js' export * from '../models/PriceServiceBatchGetPricesResponse.js' export * from '../models/PriceServiceBatchGetPricesResponseCoinPrice.js' diff --git a/src/types/ObjectParamAPI.ts b/src/types/ObjectParamAPI.ts index e4c4c0a..f826313 100755 --- a/src/types/ObjectParamAPI.ts +++ b/src/types/ObjectParamAPI.ts @@ -147,6 +147,9 @@ import { MetricsServiceObservabilityServiceQueryBody } from '../models/MetricsSe import { MetricsServiceObservabilityServiceQueryRangeBody } from '../models/MetricsServiceObservabilityServiceQueryRangeBody.js'; import { MetricsServiceQueryValueResponse } from '../models/MetricsServiceQueryValueResponse.js'; import { MetricsServiceQueryValueResponseResult } from '../models/MetricsServiceQueryValueResponseResult.js'; +import { PriceServiceAddCoinByGeckoRequest } from '../models/PriceServiceAddCoinByGeckoRequest.js'; +import { PriceServiceAddCoinByGeckoResponse } from '../models/PriceServiceAddCoinByGeckoResponse.js'; +import { PriceServiceAddCoinByGeckoResponseStatus } from '../models/PriceServiceAddCoinByGeckoResponseStatus.js'; import { PriceServiceBatchGetPricesRequest } from '../models/PriceServiceBatchGetPricesRequest.js'; import { PriceServiceBatchGetPricesResponse } from '../models/PriceServiceBatchGetPricesResponse.js'; import { PriceServiceBatchGetPricesResponseCoinPrice } from '../models/PriceServiceBatchGetPricesResponseCoinPrice.js'; @@ -1792,6 +1795,41 @@ export class ObjectDebugAndSimulationApi { } +import { ObservableDefaultApi } from "./ObservableAPI.js"; +import { DefaultApiRequestFactory, DefaultApiResponseProcessor} from "../apis/DefaultApi.js"; + +export interface DefaultApiAddCoinByGeckoRequest { + /** + * + * @type PriceServiceAddCoinByGeckoRequest + * @memberof DefaultApiaddCoinByGecko + */ + body: PriceServiceAddCoinByGeckoRequest +} + +export class ObjectDefaultApi { + private api: ObservableDefaultApi + + public constructor(configuration: Configuration, requestFactory?: DefaultApiRequestFactory, responseProcessor?: DefaultApiResponseProcessor) { + this.api = new ObservableDefaultApi(configuration, requestFactory, responseProcessor); + } + + /** + * @param param the request object + */ + public addCoinByGeckoWithHttpInfo(param: DefaultApiAddCoinByGeckoRequest, options?: Configuration): Promise> { + return this.api.addCoinByGeckoWithHttpInfo(param.body, options).toPromise(); + } + + /** + * @param param the request object + */ + public addCoinByGecko(param: DefaultApiAddCoinByGeckoRequest, options?: Configuration): Promise { + return this.api.addCoinByGecko(param.body, options).toPromise(); + } + +} + import { ObservableForksApi } from "./ObservableAPI.js"; import { ForksApiRequestFactory, ForksApiResponseProcessor} from "../apis/ForksApi.js"; diff --git a/src/types/ObservableAPI.ts b/src/types/ObservableAPI.ts index 4827c33..63729d3 100755 --- a/src/types/ObservableAPI.ts +++ b/src/types/ObservableAPI.ts @@ -148,6 +148,9 @@ import { MetricsServiceObservabilityServiceQueryBody } from '../models/MetricsSe import { MetricsServiceObservabilityServiceQueryRangeBody } from '../models/MetricsServiceObservabilityServiceQueryRangeBody.js'; import { MetricsServiceQueryValueResponse } from '../models/MetricsServiceQueryValueResponse.js'; import { MetricsServiceQueryValueResponseResult } from '../models/MetricsServiceQueryValueResponseResult.js'; +import { PriceServiceAddCoinByGeckoRequest } from '../models/PriceServiceAddCoinByGeckoRequest.js'; +import { PriceServiceAddCoinByGeckoResponse } from '../models/PriceServiceAddCoinByGeckoResponse.js'; +import { PriceServiceAddCoinByGeckoResponseStatus } from '../models/PriceServiceAddCoinByGeckoResponseStatus.js'; import { PriceServiceBatchGetPricesRequest } from '../models/PriceServiceBatchGetPricesRequest.js'; import { PriceServiceBatchGetPricesResponse } from '../models/PriceServiceBatchGetPricesResponse.js'; import { PriceServiceBatchGetPricesResponseCoinPrice } from '../models/PriceServiceBatchGetPricesResponseCoinPrice.js'; @@ -1450,6 +1453,53 @@ export class ObservableDebugAndSimulationApi { } +import { DefaultApiRequestFactory, DefaultApiResponseProcessor} from "../apis/DefaultApi.js"; +export class ObservableDefaultApi { + private requestFactory: DefaultApiRequestFactory; + private responseProcessor: DefaultApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: DefaultApiRequestFactory, + responseProcessor?: DefaultApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new DefaultApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new DefaultApiResponseProcessor(); + } + + /** + * @param body + */ + public addCoinByGeckoWithHttpInfo(body: PriceServiceAddCoinByGeckoRequest, _options?: Configuration): Observable> { + const requestContextPromise = this.requestFactory.addCoinByGecko(body, _options); + + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of this.configuration.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of this.configuration.middleware) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.addCoinByGeckoWithHttpInfo(rsp))); + })); + } + + /** + * @param body + */ + public addCoinByGecko(body: PriceServiceAddCoinByGeckoRequest, _options?: Configuration): Observable { + return this.addCoinByGeckoWithHttpInfo(body, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + +} + import { ForksApiRequestFactory, ForksApiResponseProcessor} from "../apis/ForksApi.js"; export class ObservableForksApi { private requestFactory: ForksApiRequestFactory; diff --git a/src/types/PromiseAPI.ts b/src/types/PromiseAPI.ts index 85a045e..b36e637 100755 --- a/src/types/PromiseAPI.ts +++ b/src/types/PromiseAPI.ts @@ -147,6 +147,9 @@ import { MetricsServiceObservabilityServiceQueryBody } from '../models/MetricsSe import { MetricsServiceObservabilityServiceQueryRangeBody } from '../models/MetricsServiceObservabilityServiceQueryRangeBody.js'; import { MetricsServiceQueryValueResponse } from '../models/MetricsServiceQueryValueResponse.js'; import { MetricsServiceQueryValueResponseResult } from '../models/MetricsServiceQueryValueResponseResult.js'; +import { PriceServiceAddCoinByGeckoRequest } from '../models/PriceServiceAddCoinByGeckoRequest.js'; +import { PriceServiceAddCoinByGeckoResponse } from '../models/PriceServiceAddCoinByGeckoResponse.js'; +import { PriceServiceAddCoinByGeckoResponseStatus } from '../models/PriceServiceAddCoinByGeckoResponseStatus.js'; import { PriceServiceBatchGetPricesRequest } from '../models/PriceServiceBatchGetPricesRequest.js'; import { PriceServiceBatchGetPricesResponse } from '../models/PriceServiceBatchGetPricesResponse.js'; import { PriceServiceBatchGetPricesResponseCoinPrice } from '../models/PriceServiceBatchGetPricesResponseCoinPrice.js'; @@ -1074,6 +1077,41 @@ export class PromiseDebugAndSimulationApi { +import { ObservableDefaultApi } from './ObservableAPI.js'; + +import { DefaultApiRequestFactory, DefaultApiResponseProcessor} from "../apis/DefaultApi.js"; +export class PromiseDefaultApi { + private api: ObservableDefaultApi + + public constructor( + configuration: Configuration, + requestFactory?: DefaultApiRequestFactory, + responseProcessor?: DefaultApiResponseProcessor + ) { + this.api = new ObservableDefaultApi(configuration, requestFactory, responseProcessor); + } + + /** + * @param body + */ + public addCoinByGeckoWithHttpInfo(body: PriceServiceAddCoinByGeckoRequest, _options?: Configuration): Promise> { + const result = this.api.addCoinByGeckoWithHttpInfo(body, _options); + return result.toPromise(); + } + + /** + * @param body + */ + public addCoinByGecko(body: PriceServiceAddCoinByGeckoRequest, _options?: Configuration): Promise { + const result = this.api.addCoinByGecko(body, _options); + return result.toPromise(); + } + + +} + + + import { ObservableForksApi } from './ObservableAPI.js'; import { ForksApiRequestFactory, ForksApiResponseProcessor} from "../apis/ForksApi.js";