Skip to content

Commit 8c0d10c

Browse files
chore: regenerate client from OpenAPI spec
1 parent 147df60 commit 8c0d10c

3 files changed

Lines changed: 349 additions & 1 deletion

File tree

.openapi-generator/FILES

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,5 +289,4 @@ requirements.txt
289289
setup.cfg
290290
test-requirements.txt
291291
test/__init__.py
292-
test/test_results_format_query.py
293292
tox.ini

docs/WorkspacesApi.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ All URIs are relative to *https://api.hotdata.dev*
55
Method | HTTP request | Description
66
------------- | ------------- | -------------
77
[**create_workspace**](WorkspacesApi.md#create_workspace) | **POST** /v1/workspaces | Create a workspace
8+
[**delete_workspace**](WorkspacesApi.md#delete_workspace) | **DELETE** /v1/workspaces/{public_id} | Delete a workspace
89
[**list_workspaces**](WorkspacesApi.md#list_workspaces) | **GET** /v1/workspaces | List workspaces
910

1011

@@ -92,6 +93,84 @@ Name | Type | Description | Notes
9293

9394
[[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)
9495

96+
# **delete_workspace**
97+
> delete_workspace(public_id)
98+
99+
Delete a workspace
100+
101+
Hard-deletes the workspace. Namespace, storage, and catalog deprovisioning runs asynchronously after the row is removed.
102+
103+
### Example
104+
105+
* Bearer Authentication (BearerAuth):
106+
107+
```python
108+
import hotdata
109+
from hotdata.rest import ApiException
110+
from pprint import pprint
111+
112+
# Defining the host is optional and defaults to https://api.hotdata.dev
113+
# See configuration.py for a list of all supported configuration parameters.
114+
configuration = hotdata.Configuration(
115+
host = "https://api.hotdata.dev"
116+
)
117+
118+
# The client must configure the authentication and authorization parameters
119+
# in accordance with the API server security policy.
120+
# Examples for each auth method are provided below, use the example that
121+
# satisfies your auth use case.
122+
123+
# Configure Bearer authorization: BearerAuth
124+
configuration = hotdata.Configuration(
125+
access_token = os.environ["BEARER_TOKEN"]
126+
)
127+
128+
# Enter a context with an instance of the API client
129+
with hotdata.ApiClient(configuration) as api_client:
130+
# Create an instance of the API class
131+
api_instance = hotdata.WorkspacesApi(api_client)
132+
public_id = 'public_id_example' # str | Public id of the workspace.
133+
134+
try:
135+
# Delete a workspace
136+
api_instance.delete_workspace(public_id)
137+
except Exception as e:
138+
print("Exception when calling WorkspacesApi->delete_workspace: %s\n" % e)
139+
```
140+
141+
142+
143+
### Parameters
144+
145+
146+
Name | Type | Description | Notes
147+
------------- | ------------- | ------------- | -------------
148+
**public_id** | **str**| Public id of the workspace. |
149+
150+
### Return type
151+
152+
void (empty response body)
153+
154+
### Authorization
155+
156+
[BearerAuth](../README.md#BearerAuth)
157+
158+
### HTTP request headers
159+
160+
- **Content-Type**: Not defined
161+
- **Accept**: application/json
162+
163+
### HTTP response details
164+
165+
| Status code | Description | Response headers |
166+
|-------------|-------------|------------------|
167+
**204** | Workspace deleted | - |
168+
**401** | Missing or invalid authorization | - |
169+
**403** | Workspace-scoped tokens are not allowed | - |
170+
**404** | Workspace not found, or caller is not a member of its organization | - |
171+
172+
[[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)
173+
95174
# **list_workspaces**
96175
> ListWorkspacesResponse list_workspaces(organization_public_id=organization_public_id)
97176

hotdata/api/workspaces_api.py

Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,276 @@ def _create_workspace_serialize(
330330

331331

332332

333+
@validate_call
334+
def delete_workspace(
335+
self,
336+
public_id: Annotated[StrictStr, Field(description="Public id of the workspace.")],
337+
_request_timeout: Union[
338+
None,
339+
Annotated[StrictFloat, Field(gt=0)],
340+
Tuple[
341+
Annotated[StrictFloat, Field(gt=0)],
342+
Annotated[StrictFloat, Field(gt=0)]
343+
]
344+
] = None,
345+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
346+
_content_type: Optional[StrictStr] = None,
347+
_headers: Optional[Dict[StrictStr, Any]] = None,
348+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
349+
) -> None:
350+
"""Delete a workspace
351+
352+
Hard-deletes the workspace. Namespace, storage, and catalog deprovisioning runs asynchronously after the row is removed.
353+
354+
:param public_id: Public id of the workspace. (required)
355+
:type public_id: str
356+
:param _request_timeout: timeout setting for this request. If one
357+
number provided, it will be total request
358+
timeout. It can also be a pair (tuple) of
359+
(connection, read) timeouts.
360+
:type _request_timeout: int, tuple(int, int), optional
361+
:param _request_auth: set to override the auth_settings for an a single
362+
request; this effectively ignores the
363+
authentication in the spec for a single request.
364+
:type _request_auth: dict, optional
365+
:param _content_type: force content-type for the request.
366+
:type _content_type: str, Optional
367+
:param _headers: set to override the headers for a single
368+
request; this effectively ignores the headers
369+
in the spec for a single request.
370+
:type _headers: dict, optional
371+
:param _host_index: set to override the host_index for a single
372+
request; this effectively ignores the host_index
373+
in the spec for a single request.
374+
:type _host_index: int, optional
375+
:return: Returns the result object.
376+
""" # noqa: E501
377+
378+
_param = self._delete_workspace_serialize(
379+
public_id=public_id,
380+
_request_auth=_request_auth,
381+
_content_type=_content_type,
382+
_headers=_headers,
383+
_host_index=_host_index
384+
)
385+
386+
_response_types_map: Dict[str, Optional[str]] = {
387+
'204': None,
388+
'401': "Error",
389+
'403': "Error",
390+
'404': "Error",
391+
}
392+
response_data = self.api_client.call_api(
393+
*_param,
394+
_request_timeout=_request_timeout
395+
)
396+
response_data.read()
397+
return self.api_client.response_deserialize(
398+
response_data=response_data,
399+
response_types_map=_response_types_map,
400+
).data
401+
402+
403+
@validate_call
404+
def delete_workspace_with_http_info(
405+
self,
406+
public_id: Annotated[StrictStr, Field(description="Public id of the workspace.")],
407+
_request_timeout: Union[
408+
None,
409+
Annotated[StrictFloat, Field(gt=0)],
410+
Tuple[
411+
Annotated[StrictFloat, Field(gt=0)],
412+
Annotated[StrictFloat, Field(gt=0)]
413+
]
414+
] = None,
415+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
416+
_content_type: Optional[StrictStr] = None,
417+
_headers: Optional[Dict[StrictStr, Any]] = None,
418+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
419+
) -> ApiResponse[None]:
420+
"""Delete a workspace
421+
422+
Hard-deletes the workspace. Namespace, storage, and catalog deprovisioning runs asynchronously after the row is removed.
423+
424+
:param public_id: Public id of the workspace. (required)
425+
:type public_id: str
426+
:param _request_timeout: timeout setting for this request. If one
427+
number provided, it will be total request
428+
timeout. It can also be a pair (tuple) of
429+
(connection, read) timeouts.
430+
:type _request_timeout: int, tuple(int, int), optional
431+
:param _request_auth: set to override the auth_settings for an a single
432+
request; this effectively ignores the
433+
authentication in the spec for a single request.
434+
:type _request_auth: dict, optional
435+
:param _content_type: force content-type for the request.
436+
:type _content_type: str, Optional
437+
:param _headers: set to override the headers for a single
438+
request; this effectively ignores the headers
439+
in the spec for a single request.
440+
:type _headers: dict, optional
441+
:param _host_index: set to override the host_index for a single
442+
request; this effectively ignores the host_index
443+
in the spec for a single request.
444+
:type _host_index: int, optional
445+
:return: Returns the result object.
446+
""" # noqa: E501
447+
448+
_param = self._delete_workspace_serialize(
449+
public_id=public_id,
450+
_request_auth=_request_auth,
451+
_content_type=_content_type,
452+
_headers=_headers,
453+
_host_index=_host_index
454+
)
455+
456+
_response_types_map: Dict[str, Optional[str]] = {
457+
'204': None,
458+
'401': "Error",
459+
'403': "Error",
460+
'404': "Error",
461+
}
462+
response_data = self.api_client.call_api(
463+
*_param,
464+
_request_timeout=_request_timeout
465+
)
466+
response_data.read()
467+
return self.api_client.response_deserialize(
468+
response_data=response_data,
469+
response_types_map=_response_types_map,
470+
)
471+
472+
473+
@validate_call
474+
def delete_workspace_without_preload_content(
475+
self,
476+
public_id: Annotated[StrictStr, Field(description="Public id of the workspace.")],
477+
_request_timeout: Union[
478+
None,
479+
Annotated[StrictFloat, Field(gt=0)],
480+
Tuple[
481+
Annotated[StrictFloat, Field(gt=0)],
482+
Annotated[StrictFloat, Field(gt=0)]
483+
]
484+
] = None,
485+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
486+
_content_type: Optional[StrictStr] = None,
487+
_headers: Optional[Dict[StrictStr, Any]] = None,
488+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
489+
) -> RESTResponseType:
490+
"""Delete a workspace
491+
492+
Hard-deletes the workspace. Namespace, storage, and catalog deprovisioning runs asynchronously after the row is removed.
493+
494+
:param public_id: Public id of the workspace. (required)
495+
:type public_id: str
496+
:param _request_timeout: timeout setting for this request. If one
497+
number provided, it will be total request
498+
timeout. It can also be a pair (tuple) of
499+
(connection, read) timeouts.
500+
:type _request_timeout: int, tuple(int, int), optional
501+
:param _request_auth: set to override the auth_settings for an a single
502+
request; this effectively ignores the
503+
authentication in the spec for a single request.
504+
:type _request_auth: dict, optional
505+
:param _content_type: force content-type for the request.
506+
:type _content_type: str, Optional
507+
:param _headers: set to override the headers for a single
508+
request; this effectively ignores the headers
509+
in the spec for a single request.
510+
:type _headers: dict, optional
511+
:param _host_index: set to override the host_index for a single
512+
request; this effectively ignores the host_index
513+
in the spec for a single request.
514+
:type _host_index: int, optional
515+
:return: Returns the result object.
516+
""" # noqa: E501
517+
518+
_param = self._delete_workspace_serialize(
519+
public_id=public_id,
520+
_request_auth=_request_auth,
521+
_content_type=_content_type,
522+
_headers=_headers,
523+
_host_index=_host_index
524+
)
525+
526+
_response_types_map: Dict[str, Optional[str]] = {
527+
'204': None,
528+
'401': "Error",
529+
'403': "Error",
530+
'404': "Error",
531+
}
532+
response_data = self.api_client.call_api(
533+
*_param,
534+
_request_timeout=_request_timeout
535+
)
536+
return response_data.response
537+
538+
539+
def _delete_workspace_serialize(
540+
self,
541+
public_id,
542+
_request_auth,
543+
_content_type,
544+
_headers,
545+
_host_index,
546+
) -> RequestSerialized:
547+
548+
_host = None
549+
550+
_collection_formats: Dict[str, str] = {
551+
}
552+
553+
_path_params: Dict[str, str] = {}
554+
_query_params: List[Tuple[str, str]] = []
555+
_header_params: Dict[str, Optional[str]] = _headers or {}
556+
_form_params: List[Tuple[str, str]] = []
557+
_files: Dict[
558+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
559+
] = {}
560+
_body_params: Optional[bytes] = None
561+
562+
# process the path parameters
563+
if public_id is not None:
564+
_path_params['public_id'] = public_id
565+
# process the query parameters
566+
# process the header parameters
567+
# process the form parameters
568+
# process the body parameter
569+
570+
571+
# set the HTTP header `Accept`
572+
if 'Accept' not in _header_params:
573+
_header_params['Accept'] = self.api_client.select_header_accept(
574+
[
575+
'application/json'
576+
]
577+
)
578+
579+
580+
# authentication setting
581+
_auth_settings: List[str] = [
582+
'BearerAuth'
583+
]
584+
585+
return self.api_client.param_serialize(
586+
method='DELETE',
587+
resource_path='/v1/workspaces/{public_id}',
588+
path_params=_path_params,
589+
query_params=_query_params,
590+
header_params=_header_params,
591+
body=_body_params,
592+
post_params=_form_params,
593+
files=_files,
594+
auth_settings=_auth_settings,
595+
collection_formats=_collection_formats,
596+
_host=_host,
597+
_request_auth=_request_auth
598+
)
599+
600+
601+
602+
333603
@validate_call
334604
def list_workspaces(
335605
self,

0 commit comments

Comments
 (0)