Skip to content

Commit

Permalink
Merge pull request #18 from sematext/feature-apptypes-appdelete
Browse files Browse the repository at this point in the history
Added App deletion methods.
  • Loading branch information
hollerloudly authored Sep 30, 2020
2 parents 93fe14f + 3f6742b commit db8fd99
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
97 changes: 97 additions & 0 deletions stcloud/api/apps_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit db8fd99

Please sign in to comment.