Skip to content

Commit 0daf5a0

Browse files
Automatically update python client (ref: Cosmo-Tech/cosmotech-api@8e0b8aa)
Co-authored-by: jreynard-code <jreynard-code@users.noreply.github.com>
1 parent a880ddc commit 0daf5a0

4 files changed

Lines changed: 452 additions & 16 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ Class | Method | HTTP request | Description
115115
*DatasetApi* | [**update_dataset**](docs/DatasetApi.md#update_dataset) | **PATCH** /organizations/{organization_id}/workspaces/{workspace_id}/datasets/{dataset_id} | Update a Dataset
116116
*DatasetApi* | [**update_dataset_access_control**](docs/DatasetApi.md#update_dataset_access_control) | **PATCH** /organizations/{organization_id}/workspaces/{workspace_id}/datasets/{dataset_id}/security/access/{identity_id} | Update the specified access to User for a Dataset
117117
*DatasetApi* | [**update_dataset_default_security**](docs/DatasetApi.md#update_dataset_default_security) | **PATCH** /organizations/{organization_id}/workspaces/{workspace_id}/datasets/{dataset_id}/security/default | Set the Dataset default security
118+
*DatasetApi* | [**update_dataset_part**](docs/DatasetApi.md#update_dataset_part) | **PATCH** /organizations/{organization_id}/workspaces/{workspace_id}/datasets/{dataset_id}/parts/{dataset_part_id} | Update existing dataset parts information of a Dataset
118119
*MetaApi* | [**about**](docs/MetaApi.md#about) | **GET** /about | Get various information about the API
119120
*OrganizationApi* | [**create_organization**](docs/OrganizationApi.md#create_organization) | **POST** /organizations | Create a new organization
120121
*OrganizationApi* | [**create_organization_access_control**](docs/OrganizationApi.md#create_organization_access_control) | **POST** /organizations/{organization_id}/security/access | Add a control access to the Organization

cosmotech_api/api/dataset_api.py

Lines changed: 342 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6543,3 +6543,345 @@ def _update_dataset_default_security_serialize(
65436543
)
65446544

65456545

6546+
6547+
6548+
@validate_call
6549+
def update_dataset_part(
6550+
self,
6551+
organization_id: Annotated[StrictStr, Field(description="the Organization identifier")],
6552+
workspace_id: Annotated[StrictStr, Field(description="the Workspace identifier")],
6553+
dataset_id: Annotated[StrictStr, Field(description="the Dataset identifier")],
6554+
dataset_part_id: Annotated[StrictStr, Field(description="the Dataset part identifier")],
6555+
dataset_part_update_request: Annotated[DatasetPartUpdateRequest, Field(description="Dataset part information to update")],
6556+
_request_timeout: Union[
6557+
None,
6558+
Annotated[StrictFloat, Field(gt=0)],
6559+
Tuple[
6560+
Annotated[StrictFloat, Field(gt=0)],
6561+
Annotated[StrictFloat, Field(gt=0)]
6562+
]
6563+
] = None,
6564+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
6565+
_content_type: Optional[StrictStr] = None,
6566+
_headers: Optional[Dict[StrictStr, Any]] = None,
6567+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
6568+
) -> DatasetPart:
6569+
"""Update existing dataset parts information of a Dataset
6570+
6571+
6572+
:param organization_id: the Organization identifier (required)
6573+
:type organization_id: str
6574+
:param workspace_id: the Workspace identifier (required)
6575+
:type workspace_id: str
6576+
:param dataset_id: the Dataset identifier (required)
6577+
:type dataset_id: str
6578+
:param dataset_part_id: the Dataset part identifier (required)
6579+
:type dataset_part_id: str
6580+
:param dataset_part_update_request: Dataset part information to update (required)
6581+
:type dataset_part_update_request: DatasetPartUpdateRequest
6582+
:param _request_timeout: timeout setting for this request. If one
6583+
number provided, it will be total request
6584+
timeout. It can also be a pair (tuple) of
6585+
(connection, read) timeouts.
6586+
:type _request_timeout: int, tuple(int, int), optional
6587+
:param _request_auth: set to override the auth_settings for an a single
6588+
request; this effectively ignores the
6589+
authentication in the spec for a single request.
6590+
:type _request_auth: dict, optional
6591+
:param _content_type: force content-type for the request.
6592+
:type _content_type: str, Optional
6593+
:param _headers: set to override the headers for a single
6594+
request; this effectively ignores the headers
6595+
in the spec for a single request.
6596+
:type _headers: dict, optional
6597+
:param _host_index: set to override the host_index for a single
6598+
request; this effectively ignores the host_index
6599+
in the spec for a single request.
6600+
:type _host_index: int, optional
6601+
:return: Returns the result object.
6602+
""" # noqa: E501
6603+
6604+
_param = self._update_dataset_part_serialize(
6605+
organization_id=organization_id,
6606+
workspace_id=workspace_id,
6607+
dataset_id=dataset_id,
6608+
dataset_part_id=dataset_part_id,
6609+
dataset_part_update_request=dataset_part_update_request,
6610+
_request_auth=_request_auth,
6611+
_content_type=_content_type,
6612+
_headers=_headers,
6613+
_host_index=_host_index
6614+
)
6615+
6616+
_response_types_map: Dict[str, Optional[str]] = {
6617+
'200': "DatasetPart",
6618+
'403': None,
6619+
'404': None,
6620+
'422': None,
6621+
}
6622+
response_data = self.api_client.call_api(
6623+
*_param,
6624+
_request_timeout=_request_timeout
6625+
)
6626+
response_data.read()
6627+
return self.api_client.response_deserialize(
6628+
response_data=response_data,
6629+
response_types_map=_response_types_map,
6630+
).data
6631+
6632+
6633+
@validate_call
6634+
def update_dataset_part_with_http_info(
6635+
self,
6636+
organization_id: Annotated[StrictStr, Field(description="the Organization identifier")],
6637+
workspace_id: Annotated[StrictStr, Field(description="the Workspace identifier")],
6638+
dataset_id: Annotated[StrictStr, Field(description="the Dataset identifier")],
6639+
dataset_part_id: Annotated[StrictStr, Field(description="the Dataset part identifier")],
6640+
dataset_part_update_request: Annotated[DatasetPartUpdateRequest, Field(description="Dataset part information to update")],
6641+
_request_timeout: Union[
6642+
None,
6643+
Annotated[StrictFloat, Field(gt=0)],
6644+
Tuple[
6645+
Annotated[StrictFloat, Field(gt=0)],
6646+
Annotated[StrictFloat, Field(gt=0)]
6647+
]
6648+
] = None,
6649+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
6650+
_content_type: Optional[StrictStr] = None,
6651+
_headers: Optional[Dict[StrictStr, Any]] = None,
6652+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
6653+
) -> ApiResponse[DatasetPart]:
6654+
"""Update existing dataset parts information of a Dataset
6655+
6656+
6657+
:param organization_id: the Organization identifier (required)
6658+
:type organization_id: str
6659+
:param workspace_id: the Workspace identifier (required)
6660+
:type workspace_id: str
6661+
:param dataset_id: the Dataset identifier (required)
6662+
:type dataset_id: str
6663+
:param dataset_part_id: the Dataset part identifier (required)
6664+
:type dataset_part_id: str
6665+
:param dataset_part_update_request: Dataset part information to update (required)
6666+
:type dataset_part_update_request: DatasetPartUpdateRequest
6667+
:param _request_timeout: timeout setting for this request. If one
6668+
number provided, it will be total request
6669+
timeout. It can also be a pair (tuple) of
6670+
(connection, read) timeouts.
6671+
:type _request_timeout: int, tuple(int, int), optional
6672+
:param _request_auth: set to override the auth_settings for an a single
6673+
request; this effectively ignores the
6674+
authentication in the spec for a single request.
6675+
:type _request_auth: dict, optional
6676+
:param _content_type: force content-type for the request.
6677+
:type _content_type: str, Optional
6678+
:param _headers: set to override the headers for a single
6679+
request; this effectively ignores the headers
6680+
in the spec for a single request.
6681+
:type _headers: dict, optional
6682+
:param _host_index: set to override the host_index for a single
6683+
request; this effectively ignores the host_index
6684+
in the spec for a single request.
6685+
:type _host_index: int, optional
6686+
:return: Returns the result object.
6687+
""" # noqa: E501
6688+
6689+
_param = self._update_dataset_part_serialize(
6690+
organization_id=organization_id,
6691+
workspace_id=workspace_id,
6692+
dataset_id=dataset_id,
6693+
dataset_part_id=dataset_part_id,
6694+
dataset_part_update_request=dataset_part_update_request,
6695+
_request_auth=_request_auth,
6696+
_content_type=_content_type,
6697+
_headers=_headers,
6698+
_host_index=_host_index
6699+
)
6700+
6701+
_response_types_map: Dict[str, Optional[str]] = {
6702+
'200': "DatasetPart",
6703+
'403': None,
6704+
'404': None,
6705+
'422': None,
6706+
}
6707+
response_data = self.api_client.call_api(
6708+
*_param,
6709+
_request_timeout=_request_timeout
6710+
)
6711+
response_data.read()
6712+
return self.api_client.response_deserialize(
6713+
response_data=response_data,
6714+
response_types_map=_response_types_map,
6715+
)
6716+
6717+
6718+
@validate_call
6719+
def update_dataset_part_without_preload_content(
6720+
self,
6721+
organization_id: Annotated[StrictStr, Field(description="the Organization identifier")],
6722+
workspace_id: Annotated[StrictStr, Field(description="the Workspace identifier")],
6723+
dataset_id: Annotated[StrictStr, Field(description="the Dataset identifier")],
6724+
dataset_part_id: Annotated[StrictStr, Field(description="the Dataset part identifier")],
6725+
dataset_part_update_request: Annotated[DatasetPartUpdateRequest, Field(description="Dataset part information to update")],
6726+
_request_timeout: Union[
6727+
None,
6728+
Annotated[StrictFloat, Field(gt=0)],
6729+
Tuple[
6730+
Annotated[StrictFloat, Field(gt=0)],
6731+
Annotated[StrictFloat, Field(gt=0)]
6732+
]
6733+
] = None,
6734+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
6735+
_content_type: Optional[StrictStr] = None,
6736+
_headers: Optional[Dict[StrictStr, Any]] = None,
6737+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
6738+
) -> RESTResponseType:
6739+
"""Update existing dataset parts information of a Dataset
6740+
6741+
6742+
:param organization_id: the Organization identifier (required)
6743+
:type organization_id: str
6744+
:param workspace_id: the Workspace identifier (required)
6745+
:type workspace_id: str
6746+
:param dataset_id: the Dataset identifier (required)
6747+
:type dataset_id: str
6748+
:param dataset_part_id: the Dataset part identifier (required)
6749+
:type dataset_part_id: str
6750+
:param dataset_part_update_request: Dataset part information to update (required)
6751+
:type dataset_part_update_request: DatasetPartUpdateRequest
6752+
:param _request_timeout: timeout setting for this request. If one
6753+
number provided, it will be total request
6754+
timeout. It can also be a pair (tuple) of
6755+
(connection, read) timeouts.
6756+
:type _request_timeout: int, tuple(int, int), optional
6757+
:param _request_auth: set to override the auth_settings for an a single
6758+
request; this effectively ignores the
6759+
authentication in the spec for a single request.
6760+
:type _request_auth: dict, optional
6761+
:param _content_type: force content-type for the request.
6762+
:type _content_type: str, Optional
6763+
:param _headers: set to override the headers for a single
6764+
request; this effectively ignores the headers
6765+
in the spec for a single request.
6766+
:type _headers: dict, optional
6767+
:param _host_index: set to override the host_index for a single
6768+
request; this effectively ignores the host_index
6769+
in the spec for a single request.
6770+
:type _host_index: int, optional
6771+
:return: Returns the result object.
6772+
""" # noqa: E501
6773+
6774+
_param = self._update_dataset_part_serialize(
6775+
organization_id=organization_id,
6776+
workspace_id=workspace_id,
6777+
dataset_id=dataset_id,
6778+
dataset_part_id=dataset_part_id,
6779+
dataset_part_update_request=dataset_part_update_request,
6780+
_request_auth=_request_auth,
6781+
_content_type=_content_type,
6782+
_headers=_headers,
6783+
_host_index=_host_index
6784+
)
6785+
6786+
_response_types_map: Dict[str, Optional[str]] = {
6787+
'200': "DatasetPart",
6788+
'403': None,
6789+
'404': None,
6790+
'422': None,
6791+
}
6792+
response_data = self.api_client.call_api(
6793+
*_param,
6794+
_request_timeout=_request_timeout
6795+
)
6796+
return response_data.response
6797+
6798+
6799+
def _update_dataset_part_serialize(
6800+
self,
6801+
organization_id,
6802+
workspace_id,
6803+
dataset_id,
6804+
dataset_part_id,
6805+
dataset_part_update_request,
6806+
_request_auth,
6807+
_content_type,
6808+
_headers,
6809+
_host_index,
6810+
) -> RequestSerialized:
6811+
6812+
_host = None
6813+
6814+
_collection_formats: Dict[str, str] = {
6815+
}
6816+
6817+
_path_params: Dict[str, str] = {}
6818+
_query_params: List[Tuple[str, str]] = []
6819+
_header_params: Dict[str, Optional[str]] = _headers or {}
6820+
_form_params: List[Tuple[str, str]] = []
6821+
_files: Dict[
6822+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
6823+
] = {}
6824+
_body_params: Optional[bytes] = None
6825+
6826+
# process the path parameters
6827+
if organization_id is not None:
6828+
_path_params['organization_id'] = organization_id
6829+
if workspace_id is not None:
6830+
_path_params['workspace_id'] = workspace_id
6831+
if dataset_id is not None:
6832+
_path_params['dataset_id'] = dataset_id
6833+
if dataset_part_id is not None:
6834+
_path_params['dataset_part_id'] = dataset_part_id
6835+
# process the query parameters
6836+
# process the header parameters
6837+
# process the form parameters
6838+
# process the body parameter
6839+
if dataset_part_update_request is not None:
6840+
_body_params = dataset_part_update_request
6841+
6842+
6843+
# set the HTTP header `Accept`
6844+
if 'Accept' not in _header_params:
6845+
_header_params['Accept'] = self.api_client.select_header_accept(
6846+
[
6847+
'application/json',
6848+
'application/yaml'
6849+
]
6850+
)
6851+
6852+
# set the HTTP header `Content-Type`
6853+
if _content_type:
6854+
_header_params['Content-Type'] = _content_type
6855+
else:
6856+
_default_content_type = (
6857+
self.api_client.select_header_content_type(
6858+
[
6859+
'application/json',
6860+
'application/yaml'
6861+
]
6862+
)
6863+
)
6864+
if _default_content_type is not None:
6865+
_header_params['Content-Type'] = _default_content_type
6866+
6867+
# authentication setting
6868+
_auth_settings: List[str] = [
6869+
'oAuth2AuthCode'
6870+
]
6871+
6872+
return self.api_client.param_serialize(
6873+
method='PATCH',
6874+
resource_path='/organizations/{organization_id}/workspaces/{workspace_id}/datasets/{dataset_id}/parts/{dataset_part_id}',
6875+
path_params=_path_params,
6876+
query_params=_query_params,
6877+
header_params=_header_params,
6878+
body=_body_params,
6879+
post_params=_form_params,
6880+
files=_files,
6881+
auth_settings=_auth_settings,
6882+
collection_formats=_collection_formats,
6883+
_host=_host,
6884+
_request_auth=_request_auth
6885+
)
6886+
6887+

0 commit comments

Comments
 (0)