diff --git a/doc/index.html b/doc/index.html index d845cd8..9e97c97 100755 --- a/doc/index.html +++ b/doc/index.html @@ -5489,6 +5489,10 @@
  • simulateTransactionBundle
  • + +
  • + deleteAlertRule +
  • createFork @@ -18609,6 +18613,412 @@


    +
    +

    Default

    +
    +
    +
    +

    deleteAlertRule

    +

    +
    +
    +
    +

    +

    +

    +
    +
    /api/v1/alerts/rule/{id}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X DELETE \
    +-H "api-key: [[apiKey]]" \
    + -H "Accept: application/json" \
    + "https://app.sentio.xyz/api/v1/alerts/rule/{id}"
    +
    +
    +
    +
    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();
    +        String id = id_example; // String | 
    +
    +        try {
    +            Object result = apiInstance.deleteAlertRule(id);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DefaultApi#deleteAlertRule");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    +
    + +
    +
    import 'package:openapi/api.dart';
    +
    +final api_instance = DefaultApi();
    +
    +final String id = new String(); // String | 
    +
    +try {
    +    final result = await api_instance.deleteAlertRule(id);
    +    print(result);
    +} catch (e) {
    +    print('Exception when calling DefaultApi->deleteAlertRule: $e\n');
    +}
    +
    +
    +
    + +
    +
    import org.openapitools.client.api.DefaultApi;
    +
    +public class DefaultApiExample {
    +    public static void main(String[] args) {
    +        DefaultApi apiInstance = new DefaultApi();
    +        String id = id_example; // String | 
    +
    +        try {
    +            Object result = apiInstance.deleteAlertRule(id);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling DefaultApi#deleteAlertRule");
    +            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];
    +String *id = id_example; //  (default to null)
    +
    +[apiInstance deleteAlertRuleWith:id
    +              completionHandler: ^(Object 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 id = id_example; // {String} 
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.deleteAlertRule(id, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class deleteAlertRuleExample
    +    {
    +        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 id = id_example;  // String |  (default to null)
    +
    +            try {
    +                Object result = apiInstance.deleteAlertRule(id);
    +                Debug.WriteLine(result);
    +            } catch (Exception e) {
    +                Debug.Print("Exception when calling DefaultApi.deleteAlertRule: " + 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();
    +$id = id_example; // String | 
    +
    +try {
    +    $result = $api_instance->deleteAlertRule($id);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling DefaultApi->deleteAlertRule: ', $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 $id = id_example; # String | 
    +
    +eval {
    +    my $result = $api_instance->deleteAlertRule(id => $id);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling DefaultApi->deleteAlertRule: $@\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()
    +id = id_example # String |  (default to null)
    +
    +try:
    +    api_response = api_instance.delete_alert_rule(id)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling DefaultApi->deleteAlertRule: %s\n" % e)
    +
    + +
    +
    extern crate DefaultApi;
    +
    +pub fn main() {
    +    let id = id_example; // String
    +
    +    let mut context = DefaultApi::Context::default();
    +    let result = client.deleteAlertRule(id, &context).wait();
    +
    +    println!("{:?}", result);
    +}
    +
    +
    +
    + +

    Scopes

    + + +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    id* + + +
    +
    +
    + + String + + +
    +
    + Required +
    +
    +
    +
    + + + + + +

    Responses

    +

    +

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

    Forks

    diff --git a/openapi.json b/openapi.json index c373a2b..22e035b 100644 --- a/openapi.json +++ b/openapi.json @@ -70,6 +70,26 @@ } }, "/api/v1/alerts/rule/{id}": { + "delete": { + "operationId": "DeleteAlertRule", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": {} + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ] + }, "put": { "summary": "Save an alert rule", "operationId": "SaveAlertRule2", diff --git a/src/DefaultApi.md b/src/DefaultApi.md new file mode 100755 index 0000000..4f9ba97 --- /dev/null +++ b/src/DefaultApi.md @@ -0,0 +1,62 @@ +# .DefaultApi + +All URIs are relative to *https://app.sentio.xyz* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteAlertRule**](DefaultApi.md#deleteAlertRule) | **DELETE** /api/v1/alerts/rule/{id} | + + +# **deleteAlertRule** +> any deleteAlertRule() + + +### Example + + +```typescript +import { createConfiguration, DefaultApi } from ''; +import type { DefaultApiDeleteAlertRuleRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new DefaultApi(configuration); + +const request: DefaultApiDeleteAlertRuleRequest = { + + id: "id_example", +}; + +const data = await apiInstance.deleteAlertRule(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | [**string**] | | defaults to undefined + + +### Return type + +**any** + +### Authorization + +[ApiKeyAuth](README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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..5dbb622 --- /dev/null +++ b/src/apis/DefaultApi.ts @@ -0,0 +1,86 @@ +// 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'; + + + +/** + * no description + */ +export class DefaultApiRequestFactory extends BaseAPIRequestFactory { + + /** + * @param id + */ + public async deleteAlertRule(id: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("DefaultApi", "deleteAlertRule", "id"); + } + + + // Path Params + const localVarPath = '/api/v1/alerts/rule/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + 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 deleteAlertRule + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteAlertRuleWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: any = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "any", "" + ) as any; + 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: any = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "any", "" + ) as any; + 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/types/ObjectParamAPI.ts b/src/types/ObjectParamAPI.ts index 25cdf66..ee1919c 100755 --- a/src/types/ObjectParamAPI.ts +++ b/src/types/ObjectParamAPI.ts @@ -1577,6 +1577,42 @@ export class ObjectDebugAndSimulationApi { } +import { ObservableDefaultApi } from "./ObservableAPI.js"; +import { DefaultApiRequestFactory, DefaultApiResponseProcessor} from "../apis/DefaultApi.js"; + +export interface DefaultApiDeleteAlertRuleRequest { + /** + * + * Defaults to: undefined + * @type string + * @memberof DefaultApideleteAlertRule + */ + id: string +} + +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 deleteAlertRuleWithHttpInfo(param: DefaultApiDeleteAlertRuleRequest, options?: Configuration): Promise> { + return this.api.deleteAlertRuleWithHttpInfo(param.id, options).toPromise(); + } + + /** + * @param param the request object + */ + public deleteAlertRule(param: DefaultApiDeleteAlertRuleRequest, options?: Configuration): Promise { + return this.api.deleteAlertRule(param.id, 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 506c419..ca339b7 100755 --- a/src/types/ObservableAPI.ts +++ b/src/types/ObservableAPI.ts @@ -1257,6 +1257,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 id + */ + public deleteAlertRuleWithHttpInfo(id: string, _options?: Configuration): Observable> { + const requestContextPromise = this.requestFactory.deleteAlertRule(id, _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.deleteAlertRuleWithHttpInfo(rsp))); + })); + } + + /** + * @param id + */ + public deleteAlertRule(id: string, _options?: Configuration): Observable { + return this.deleteAlertRuleWithHttpInfo(id, _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 a1e59c5..d703a6e 100755 --- a/src/types/PromiseAPI.ts +++ b/src/types/PromiseAPI.ts @@ -946,6 +946,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 id + */ + public deleteAlertRuleWithHttpInfo(id: string, _options?: Configuration): Promise> { + const result = this.api.deleteAlertRuleWithHttpInfo(id, _options); + return result.toPromise(); + } + + /** + * @param id + */ + public deleteAlertRule(id: string, _options?: Configuration): Promise { + const result = this.api.deleteAlertRule(id, _options); + return result.toPromise(); + } + + +} + + + import { ObservableForksApi } from './ObservableAPI.js'; import { ForksApiRequestFactory, ForksApiResponseProcessor} from "../apis/ForksApi.js";