diff --git a/README.md b/README.md index 47c9091..cba3177 100755 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ Class | Method | HTTP request | Description *ChannelsApi* | [**put_policy_channels_put**](docs/ChannelsApi.md#put_policy_channels_put) | **PUT** /channels/{id} | *DocsApi* | [**get_swagger_json**](docs/DocsApi.md#get_swagger_json) | **GET** /docs/swagger.json | *DocsApi* | [**get_swagger_yml**](docs/DocsApi.md#get_swagger_yml) | **GET** /docs/swagger.yml | +*EventsApi* | [**delete_events_parameters_delete**](docs/EventsApi.md#delete_events_parameters_delete) | **DELETE** /events/parameters/{app_key} | *EventsApi* | [**get_events_get**](docs/EventsApi.md#get_events_get) | **GET** /events/{id} | *EventsApi* | [**get_events_get_all**](docs/EventsApi.md#get_events_get_all) | **GET** /events | *EventsApi* | [**get_events_parameters_get**](docs/EventsApi.md#get_events_parameters_get) | **GET** /events/parameters | diff --git a/docs/EventsApi.md b/docs/EventsApi.md index 1f39106..4fba137 100644 --- a/docs/EventsApi.md +++ b/docs/EventsApi.md @@ -4,12 +4,87 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- +[**delete_events_parameters_delete**](EventsApi.md#delete_events_parameters_delete) | **DELETE** /events/parameters/{app_key} | [**get_events_get**](EventsApi.md#get_events_get) | **GET** /events/{id} | [**get_events_get_all**](EventsApi.md#get_events_get_all) | **GET** /events | [**get_events_parameters_get**](EventsApi.md#get_events_parameters_get) | **GET** /events/parameters | [**post_events_post**](EventsApi.md#post_events_post) | **POST** /events | +# **delete_events_parameters_delete** +> str delete_events_parameters_delete(app_key) + + + +### Example + +* Api Key Authentication (auth_token): +```python +import time +import os +import labs_alert_manager_client +from labs_alert_manager_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = labs_alert_manager_client.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: auth_token +configuration.api_key['auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with labs_alert_manager_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = labs_alert_manager_client.EventsApi(api_client) + app_key = 'app_key_example' # str | + + try: + api_response = api_instance.delete_events_parameters_delete(app_key) + print("The response of EventsApi->delete_events_parameters_delete:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EventsApi->delete_events_parameters_delete: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_key** | **str**| | + +### Return type + +**str** + +### Authorization + +[auth_token](../README.md#auth_token) + +### 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) + # **get_events_get** > EventSchema get_events_get(id) diff --git a/labs_alert_manager_client/api/events_api.py b/labs_alert_manager_client/api/events_api.py index d753760..0d78b27 100644 --- a/labs_alert_manager_client/api/events_api.py +++ b/labs_alert_manager_client/api/events_api.py @@ -46,6 +46,143 @@ def __init__(self, api_client=None): api_client = ApiClient.get_default() self.api_client = api_client + @validate_arguments + def delete_events_parameters_delete(self, app_key : StrictStr, **kwargs) -> str: # noqa: E501 + """delete_events_parameters_delete # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_events_parameters_delete(app_key, async_req=True) + >>> result = thread.get() + + :param app_key: (required) + :type app_key: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the delete_events_parameters_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.delete_events_parameters_delete_with_http_info(app_key, **kwargs) # noqa: E501 + + @validate_arguments + def delete_events_parameters_delete_with_http_info(self, app_key : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 + """delete_events_parameters_delete # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_events_parameters_delete_with_http_info(app_key, async_req=True) + >>> result = thread.get() + + :param app_key: (required) + :type app_key: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [ + 'app_key' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_events_parameters_delete" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['app_key']: + _path_params['app_key'] = _params['app_key'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # authentication setting + _auth_settings = ['auth_token'] # noqa: E501 + + _response_types_map = { + '200': "str", + } + + return self.api_client.call_api( + '/events/parameters/{app_key}', 'DELETE', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + @validate_arguments def get_events_get(self, id : StrictStr, **kwargs) -> EventSchema: # noqa: E501 """get_events_get # noqa: E501 diff --git a/test/test_events_api.py b/test/test_events_api.py index 8548569..2b78465 100644 --- a/test/test_events_api.py +++ b/test/test_events_api.py @@ -28,6 +28,12 @@ def setUp(self): def tearDown(self): pass + def test_delete_events_parameters_delete(self): + """Test case for delete_events_parameters_delete + + """ + pass + def test_get_events_get(self): """Test case for get_events_get