From 3f6742baa07073f706d8fe1d36e05f33fe586a83 Mon Sep 17 00:00:00 2001 From: Euan Clark Date: Thu, 1 Oct 2020 02:05:12 +1300 Subject: [PATCH] Added App deletion methods. --- setup.py | 2 +- stcloud/api/apps_api.py | 97 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3418220..3fa9d73 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ from setuptools import setup, find_packages # mypy: disable=W0611 # noqa: NAME = "sematext-cloud-client" -VERSION = "0.1.6" +VERSION = "0.1.7" # To install the library, run the following # # python setup.py install diff --git a/stcloud/api/apps_api.py b/stcloud/api/apps_api.py index 5cda8ee..86f7b6c 100644 --- a/stcloud/api/apps_api.py +++ b/stcloud/api/apps_api.py @@ -33,6 +33,103 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client + def delete_using_delete(self, any_state_app_id, **kwargs): # noqa: E501 + """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_using_delete(any_state_app_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int any_state_app_id: anyStateAppId (required) + :return: GenericApiResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_using_delete_with_http_info(any_state_app_id, **kwargs) # noqa: E501 + else: + (data) = self.delete_using_delete_with_http_info(any_state_app_id, **kwargs) # noqa: E501 + return data + + def delete_using_delete_with_http_info(self, any_state_app_id, **kwargs): # noqa: E501 + """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_using_delete_with_http_info(any_state_app_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int any_state_app_id: anyStateAppId (required) + :return: GenericApiResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['any_state_app_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_using_delete" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'any_state_app_id' is set + if ('any_state_app_id' not in params or + params['any_state_app_id'] is None): + raise ValueError("Missing the required parameter `any_state_app_id` when calling `delete_using_delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'any_state_app_id' in params: + path_params['anyStateAppId'] = params['any_state_app_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/users-web/api/v3/apps/{anyStateAppId}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GenericApiResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + def get_app_types_using_get(self, **kwargs): # noqa: E501 """Get all App types supported for the account identified with apiKey # noqa: E501