Skip to content

Commit e6b6d2d

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

File tree

6 files changed

+6
-54
lines changed

6 files changed

+6
-54
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Class | Method | HTTP request | Description
141141
*OrganizationApi* | [**list_permissions**](docs/OrganizationApi.md#list_permissions) | **GET** /organizations/permissions | Get all permissions per components
142142
*OrganizationApi* | [**update_organization**](docs/OrganizationApi.md#update_organization) | **PATCH** /organizations/{organization_id} | Update an Organization
143143
*OrganizationApi* | [**update_organization_access_control**](docs/OrganizationApi.md#update_organization_access_control) | **PATCH** /organizations/{organization_id}/security/access/{identity_id} | Update the specified access to User for an Organization
144-
*OrganizationApi* | [**update_organization_default_security**](docs/OrganizationApi.md#update_organization_default_security) | **POST** /organizations/{organization_id}/security/default | Update the Organization default security
144+
*OrganizationApi* | [**update_organization_default_security**](docs/OrganizationApi.md#update_organization_default_security) | **PATCH** /organizations/{organization_id}/security/default | Update the Organization default security
145145
*RunApi* | [**delete_run**](docs/RunApi.md#delete_run) | **DELETE** /organizations/{organization_id}/workspaces/{workspace_id}/runners/{runner_id}/runs/{run_id} | Delete a run
146146
*RunApi* | [**get_run**](docs/RunApi.md#get_run) | **GET** /organizations/{organization_id}/workspaces/{workspace_id}/runners/{runner_id}/runs/{run_id} | Get the details of a run
147147
*RunApi* | [**get_run_logs**](docs/RunApi.md#get_run_logs) | **GET** /organizations/{organization_id}/workspaces/{workspace_id}/runners/{runner_id}/runs/{run_id}/logs | get the logs for the Run

cosmotech_api/api/organization_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3856,7 +3856,7 @@ def _update_organization_default_security_serialize(
38563856
]
38573857

38583858
return self.api_client.param_serialize(
3859-
method='POST',
3859+
method='PATCH',
38603860
resource_path='/organizations/{organization_id}/security/default',
38613861
path_params=_path_params,
38623862
query_params=_query_params,

cosmotech_api/models/solution_update_request.py

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
2222
from typing import Any, ClassVar, Dict, List, Optional
2323
from typing_extensions import Annotated
24-
from cosmotech_api.models.run_template_parameter import RunTemplateParameter
25-
from cosmotech_api.models.run_template_parameter_group import RunTemplateParameterGroup
2624
from typing import Optional, Set
2725
from typing_extensions import Self
2826

@@ -40,9 +38,7 @@ class SolutionUpdateRequest(BaseModel):
4038
sdk_version: Optional[StrictStr] = Field(default=None, description="The MAJOR.MINOR version used to build this solution", alias="sdkVersion")
4139
url: Optional[StrictStr] = Field(default=None, description="An optional URL link to solution page")
4240
tags: Optional[List[StrictStr]] = Field(default=None, description="The list of tags")
43-
parameters: Optional[List[RunTemplateParameter]] = Field(default=None, description="The list of Run Template Parameters")
44-
parameter_groups: Optional[List[RunTemplateParameterGroup]] = Field(default=None, description="The list of parameters groups for the Run Templates", alias="parameterGroups")
45-
__properties: ClassVar[List[str]] = ["key", "name", "description", "repository", "alwaysPull", "csmSimulator", "version", "sdkVersion", "url", "tags", "parameters", "parameterGroups"]
41+
__properties: ClassVar[List[str]] = ["key", "name", "description", "repository", "alwaysPull", "csmSimulator", "version", "sdkVersion", "url", "tags"]
4642

4743
model_config = ConfigDict(
4844
populate_by_name=True,
@@ -83,20 +79,6 @@ def to_dict(self) -> Dict[str, Any]:
8379
exclude=excluded_fields,
8480
exclude_none=True,
8581
)
86-
# override the default output from pydantic by calling `to_dict()` of each item in parameters (list)
87-
_items = []
88-
if self.parameters:
89-
for _item_parameters in self.parameters:
90-
if _item_parameters:
91-
_items.append(_item_parameters.to_dict())
92-
_dict['parameters'] = _items
93-
# override the default output from pydantic by calling `to_dict()` of each item in parameter_groups (list)
94-
_items = []
95-
if self.parameter_groups:
96-
for _item_parameter_groups in self.parameter_groups:
97-
if _item_parameter_groups:
98-
_items.append(_item_parameter_groups.to_dict())
99-
_dict['parameterGroups'] = _items
10082
return _dict
10183

10284
@classmethod
@@ -118,9 +100,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
118100
"version": obj.get("version"),
119101
"sdkVersion": obj.get("sdkVersion"),
120102
"url": obj.get("url"),
121-
"tags": obj.get("tags"),
122-
"parameters": [RunTemplateParameter.from_dict(_item) for _item in obj["parameters"]] if obj.get("parameters") is not None else None,
123-
"parameterGroups": [RunTemplateParameterGroup.from_dict(_item) for _item in obj["parameterGroups"]] if obj.get("parameterGroups") is not None else None
103+
"tags": obj.get("tags")
124104
})
125105
return _obj
126106

docs/OrganizationApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Method | HTTP request | Description
1717
[**list_permissions**](OrganizationApi.md#list_permissions) | **GET** /organizations/permissions | Get all permissions per components
1818
[**update_organization**](OrganizationApi.md#update_organization) | **PATCH** /organizations/{organization_id} | Update an Organization
1919
[**update_organization_access_control**](OrganizationApi.md#update_organization_access_control) | **PATCH** /organizations/{organization_id}/security/access/{identity_id} | Update the specified access to User for an Organization
20-
[**update_organization_default_security**](OrganizationApi.md#update_organization_default_security) | **POST** /organizations/{organization_id}/security/default | Update the Organization default security
20+
[**update_organization_default_security**](OrganizationApi.md#update_organization_default_security) | **PATCH** /organizations/{organization_id}/security/default | Update the Organization default security
2121

2222

2323
# **create_organization**

docs/SolutionUpdateRequest.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ Name | Type | Description | Notes
1616
**sdk_version** | **str** | The MAJOR.MINOR version used to build this solution | [optional]
1717
**url** | **str** | An optional URL link to solution page | [optional]
1818
**tags** | **List[str]** | The list of tags | [optional]
19-
**parameters** | [**List[RunTemplateParameter]**](RunTemplateParameter.md) | The list of Run Template Parameters | [optional]
20-
**parameter_groups** | [**List[RunTemplateParameterGroup]**](RunTemplateParameterGroup.md) | The list of parameters groups for the Run Templates | [optional]
2119

2220
## Example
2321

test/test_solution_update_request.py

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -45,33 +45,7 @@ def make_instance(self, include_optional) -> SolutionUpdateRequest:
4545
version = '1.0.0',
4646
sdk_version = '2.4',
4747
url = 'https://github.com/Cosmo-Tech/brewery-solution',
48-
tags = ["brewery","optimization"],
49-
parameters = [
50-
cosmotech_api.models.run_template_parameter.RunTemplateParameter(
51-
id = '0',
52-
labels = {
53-
'key' : ''
54-
},
55-
var_type = '',
56-
default_value = '',
57-
min_value = '',
58-
max_value = '',
59-
regex_validation = '',
60-
options = { }, )
61-
],
62-
parameter_groups = [
63-
cosmotech_api.models.run_template_parameter_group.RunTemplateParameterGroup(
64-
id = '0',
65-
labels = {
66-
'key' : ''
67-
},
68-
is_table = True,
69-
options = { },
70-
parent_id = '',
71-
parameters = [
72-
''
73-
], )
74-
]
48+
tags = ["brewery","optimization"]
7549
)
7650
else:
7751
return SolutionUpdateRequest(

0 commit comments

Comments
 (0)