Skip to content

Commit d0dff29

Browse files
committed
[QI2-727] added optional name field to algorithms
1 parent fb3fe1a commit d0dff29

File tree

7 files changed

+61
-7
lines changed

7 files changed

+61
-7
lines changed

compute_api_client/api/algorithms_api.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,8 @@ async def read_algorithms_algorithms_get(
866866
shared: Optional[ShareType] = None,
867867
link__isnull: Optional[StrictBool] = None,
868868
link: Optional[StrictStr] = None,
869+
name__isnull: Optional[StrictBool] = None,
870+
name: Optional[StrictStr] = None,
869871
_request_timeout: Union[
870872
None,
871873
Annotated[StrictFloat, Field(gt=0)],
@@ -897,6 +899,10 @@ async def read_algorithms_algorithms_get(
897899
:type link__isnull: bool
898900
:param link:
899901
:type link: str
902+
:param name__isnull:
903+
:type name__isnull: bool
904+
:param name:
905+
:type name: str
900906
:param _request_timeout: timeout setting for this request. If one
901907
number provided, it will be total request
902908
timeout. It can also be a pair (tuple) of
@@ -927,6 +933,8 @@ async def read_algorithms_algorithms_get(
927933
shared=shared,
928934
link__isnull=link__isnull,
929935
link=link,
936+
name__isnull=name__isnull,
937+
name=name,
930938
_request_auth=_request_auth,
931939
_content_type=_content_type,
932940
_headers=_headers,
@@ -959,6 +967,8 @@ async def read_algorithms_algorithms_get_with_http_info(
959967
shared: Optional[ShareType] = None,
960968
link__isnull: Optional[StrictBool] = None,
961969
link: Optional[StrictStr] = None,
970+
name__isnull: Optional[StrictBool] = None,
971+
name: Optional[StrictStr] = None,
962972
_request_timeout: Union[
963973
None,
964974
Annotated[StrictFloat, Field(gt=0)],
@@ -990,6 +1000,10 @@ async def read_algorithms_algorithms_get_with_http_info(
9901000
:type link__isnull: bool
9911001
:param link:
9921002
:type link: str
1003+
:param name__isnull:
1004+
:type name__isnull: bool
1005+
:param name:
1006+
:type name: str
9931007
:param _request_timeout: timeout setting for this request. If one
9941008
number provided, it will be total request
9951009
timeout. It can also be a pair (tuple) of
@@ -1020,6 +1034,8 @@ async def read_algorithms_algorithms_get_with_http_info(
10201034
shared=shared,
10211035
link__isnull=link__isnull,
10221036
link=link,
1037+
name__isnull=name__isnull,
1038+
name=name,
10231039
_request_auth=_request_auth,
10241040
_content_type=_content_type,
10251041
_headers=_headers,
@@ -1052,6 +1068,8 @@ async def read_algorithms_algorithms_get_without_preload_content(
10521068
shared: Optional[ShareType] = None,
10531069
link__isnull: Optional[StrictBool] = None,
10541070
link: Optional[StrictStr] = None,
1071+
name__isnull: Optional[StrictBool] = None,
1072+
name: Optional[StrictStr] = None,
10551073
_request_timeout: Union[
10561074
None,
10571075
Annotated[StrictFloat, Field(gt=0)],
@@ -1083,6 +1101,10 @@ async def read_algorithms_algorithms_get_without_preload_content(
10831101
:type link__isnull: bool
10841102
:param link:
10851103
:type link: str
1104+
:param name__isnull:
1105+
:type name__isnull: bool
1106+
:param name:
1107+
:type name: str
10861108
:param _request_timeout: timeout setting for this request. If one
10871109
number provided, it will be total request
10881110
timeout. It can also be a pair (tuple) of
@@ -1113,6 +1135,8 @@ async def read_algorithms_algorithms_get_without_preload_content(
11131135
shared=shared,
11141136
link__isnull=link__isnull,
11151137
link=link,
1138+
name__isnull=name__isnull,
1139+
name=name,
11161140
_request_auth=_request_auth,
11171141
_content_type=_content_type,
11181142
_headers=_headers,
@@ -1140,6 +1164,8 @@ def _read_algorithms_algorithms_get_serialize(
11401164
shared,
11411165
link__isnull,
11421166
link,
1167+
name__isnull,
1168+
name,
11431169
_request_auth,
11441170
_content_type,
11451171
_headers,
@@ -1189,6 +1215,14 @@ def _read_algorithms_algorithms_get_serialize(
11891215

11901216
_query_params.append(('link', link))
11911217

1218+
if name__isnull is not None:
1219+
1220+
_query_params.append(('name__isnull', name__isnull))
1221+
1222+
if name is not None:
1223+
1224+
_query_params.append(('name', name))
1225+
11921226
# process the header parameters
11931227
# process the form parameters
11941228
# process the body parameter

compute_api_client/docs/Algorithm.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
99
**type** | [**AlgorithmType**](AlgorithmType.md) | |
1010
**shared** | [**ShareType**](ShareType.md) | |
1111
**link** | **str** | |
12+
**name** | **str** | |
1213

1314
## Example
1415

compute_api_client/docs/AlgorithmIn.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Name | Type | Description | Notes
88
**type** | [**AlgorithmType**](AlgorithmType.md) | |
99
**shared** | [**ShareType**](ShareType.md) | |
1010
**link** | **str** | | [optional]
11+
**name** | **str** | | [optional]
1112

1213
## Example
1314

compute_api_client/docs/AlgorithmsApi.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ Name | Type | Description | Notes
256256
[[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)
257257

258258
# **read_algorithms_algorithms_get**
259-
> List[Algorithm] read_algorithms_algorithms_get(latest=latest, id=id, project_id=project_id, type=type, shared=shared, link__isnull=link__isnull, link=link)
259+
> List[Algorithm] read_algorithms_algorithms_get(latest=latest, id=id, project_id=project_id, type=type, shared=shared, link__isnull=link__isnull, link=link, name__isnull=name__isnull, name=name)
260260
261261
List algorithms
262262

@@ -303,10 +303,12 @@ async with compute_api_client.ApiClient(configuration) as api_client:
303303
shared = compute_api_client.ShareType() # ShareType | (optional)
304304
link__isnull = True # bool | (optional)
305305
link = 'link_example' # str | (optional)
306+
name__isnull = True # bool | (optional)
307+
name = 'name_example' # str | (optional)
306308

307309
try:
308310
# List algorithms
309-
api_response = await api_instance.read_algorithms_algorithms_get(latest=latest, id=id, project_id=project_id, type=type, shared=shared, link__isnull=link__isnull, link=link)
311+
api_response = await api_instance.read_algorithms_algorithms_get(latest=latest, id=id, project_id=project_id, type=type, shared=shared, link__isnull=link__isnull, link=link, name__isnull=name__isnull, name=name)
310312
print("The response of AlgorithmsApi->read_algorithms_algorithms_get:\n")
311313
pprint(api_response)
312314
except Exception as e:
@@ -326,6 +328,8 @@ Name | Type | Description | Notes
326328
**shared** | [**ShareType**](.md)| | [optional]
327329
**link__isnull** | **bool**| | [optional]
328330
**link** | **str**| | [optional]
331+
**name__isnull** | **bool**| | [optional]
332+
**name** | **str**| | [optional]
329333

330334
### Return type
331335

compute_api_client/models/algorithm.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class Algorithm(BaseModel):
3838
type: AlgorithmType
3939
shared: ShareType
4040
link: Optional[Annotated[str, Field(strict=True, max_length=255)]]
41-
__properties: ClassVar[List[str]] = ["id", "project_id", "type", "shared", "link"]
41+
name: Optional[Annotated[str, Field(strict=True, max_length=255)]]
42+
__properties: ClassVar[List[str]] = ["id", "project_id", "type", "shared", "link", "name"]
4243

4344
model_config = {
4445
"populate_by_name": True,
@@ -81,6 +82,11 @@ def to_dict(self) -> Dict[str, Any]:
8182
if self.link is None and "link" in self.model_fields_set:
8283
_dict['link'] = None
8384

85+
# set to None if name (nullable) is None
86+
# and model_fields_set contains the field
87+
if self.name is None and "name" in self.model_fields_set:
88+
_dict['name'] = None
89+
8490
return _dict
8591

8692
@classmethod
@@ -97,7 +103,8 @@ def from_dict(cls, obj: Dict) -> Self:
97103
"project_id": obj.get("project_id"),
98104
"type": obj.get("type"),
99105
"shared": obj.get("shared"),
100-
"link": obj.get("link")
106+
"link": obj.get("link"),
107+
"name": obj.get("name")
101108
})
102109
return _obj
103110

compute_api_client/models/algorithm_in.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ class AlgorithmIn(BaseModel):
3737
type: AlgorithmType
3838
shared: ShareType
3939
link: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None
40-
__properties: ClassVar[List[str]] = ["project_id", "type", "shared", "link"]
40+
name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None
41+
__properties: ClassVar[List[str]] = ["project_id", "type", "shared", "link", "name"]
4142

4243
model_config = {
4344
"populate_by_name": True,
@@ -80,6 +81,11 @@ def to_dict(self) -> Dict[str, Any]:
8081
if self.link is None and "link" in self.model_fields_set:
8182
_dict['link'] = None
8283

84+
# set to None if name (nullable) is None
85+
# and model_fields_set contains the field
86+
if self.name is None and "name" in self.model_fields_set:
87+
_dict['name'] = None
88+
8389
return _dict
8490

8591
@classmethod
@@ -95,7 +101,8 @@ def from_dict(cls, obj: Dict) -> Self:
95101
"project_id": obj.get("project_id"),
96102
"type": obj.get("type"),
97103
"shared": obj.get("shared"),
98-
"link": obj.get("link")
104+
"link": obj.get("link"),
105+
"name": obj.get("name")
99106
})
100107
return _obj
101108

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "qi-compute-api-client"
3-
version = "0.18.0"
3+
version = "0.19.0"
44
description = "An API client for the Compute Job Manager of Quantum Inspire."
55
license = "Apache-2.0"
66
authors = ["Quantum Inspire <support@quantum-inspire.eu>"]

0 commit comments

Comments
 (0)