From ade69bb9b1b844304415ded07277b062abf380c9 Mon Sep 17 00:00:00 2001 From: "Joseph T. French" Date: Wed, 2 Dec 2026 00:44:26 -0600 Subject: [PATCH] feat(sdk): add the subgraph import operations Regenerated against the API: create_subgraph_import and run_subgraph_import under api/content_operations, with their request models CreateSubgraphImportOp and RunSubgraphImportOp. Additive only. --- .../create_subgraph_import.py | 276 +++++++++++++++++ .../content_operations/run_subgraph_import.py | 288 ++++++++++++++++++ robosystems_client/models/__init__.py | 4 + .../models/create_subgraph_import_op.py | 63 ++++ .../models/run_subgraph_import_op.py | 71 +++++ 5 files changed, 702 insertions(+) create mode 100644 robosystems_client/api/content_operations/create_subgraph_import.py create mode 100644 robosystems_client/api/content_operations/run_subgraph_import.py create mode 100644 robosystems_client/models/create_subgraph_import_op.py create mode 100644 robosystems_client/models/run_subgraph_import_op.py diff --git a/robosystems_client/api/content_operations/create_subgraph_import.py b/robosystems_client/api/content_operations/create_subgraph_import.py new file mode 100644 index 0000000..cfc578b --- /dev/null +++ b/robosystems_client/api/content_operations/create_subgraph_import.py @@ -0,0 +1,276 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_subgraph_import_op import CreateSubgraphImportOp +from ...models.error_response import ErrorResponse +from ...models.operation_envelope import OperationEnvelope +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + graph_id: str, + *, + body: CreateSubgraphImportOp, + idempotency_key: None | str | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + if not isinstance(idempotency_key, Unset): + headers["Idempotency-Key"] = idempotency_key + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/graphs/{graph_id}/operations/create-subgraph-import".format( + graph_id=quote(str(graph_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorResponse | OperationEnvelope | None: + if response.status_code == 200: + response_200 = OperationEnvelope.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ErrorResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ErrorResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ErrorResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ErrorResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 409: + response_409 = ErrorResponse.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ErrorResponse.from_dict(response.json()) + + return response_422 + + if response.status_code == 429: + response_429 = ErrorResponse.from_dict(response.json()) + + return response_429 + + if response.status_code == 500: + response_500 = ErrorResponse.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorResponse | OperationEnvelope]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + graph_id: str, + *, + client: AuthenticatedClient, + body: CreateSubgraphImportOp, + idempotency_key: None | str | Unset = UNSET, +) -> Response[ErrorResponse | OperationEnvelope]: + """Start a Subgraph Import + + Subgraphs only: refused with 403 on a main graph, which loads through `create-file-upload` and + `ingest-file`. Starts a bulk load of rows into the subgraph's own tables: one presigned Parquet + upload per table, under one `import_id`. PUT each file with the returned `content_type`, then call + `POST /operations/run-subgraph-import`. A node table's file carries `identifier` and its properties; + a relationship table's carries `from` and `to` (the two nodes' identifiers), then its properties. + Every table named must already exist in the subgraph. + + **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours + return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. + + Args: + graph_id (str): + idempotency_key (None | str | Unset): + body (CreateSubgraphImportOp): Body for create-subgraph-import (bulk rows into a + subgraph's tables). + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorResponse | OperationEnvelope] + """ + + kwargs = _get_kwargs( + graph_id=graph_id, + body=body, + idempotency_key=idempotency_key, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + graph_id: str, + *, + client: AuthenticatedClient, + body: CreateSubgraphImportOp, + idempotency_key: None | str | Unset = UNSET, +) -> ErrorResponse | OperationEnvelope | None: + """Start a Subgraph Import + + Subgraphs only: refused with 403 on a main graph, which loads through `create-file-upload` and + `ingest-file`. Starts a bulk load of rows into the subgraph's own tables: one presigned Parquet + upload per table, under one `import_id`. PUT each file with the returned `content_type`, then call + `POST /operations/run-subgraph-import`. A node table's file carries `identifier` and its properties; + a relationship table's carries `from` and `to` (the two nodes' identifiers), then its properties. + Every table named must already exist in the subgraph. + + **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours + return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. + + Args: + graph_id (str): + idempotency_key (None | str | Unset): + body (CreateSubgraphImportOp): Body for create-subgraph-import (bulk rows into a + subgraph's tables). + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorResponse | OperationEnvelope + """ + + return sync_detailed( + graph_id=graph_id, + client=client, + body=body, + idempotency_key=idempotency_key, + ).parsed + + +async def asyncio_detailed( + graph_id: str, + *, + client: AuthenticatedClient, + body: CreateSubgraphImportOp, + idempotency_key: None | str | Unset = UNSET, +) -> Response[ErrorResponse | OperationEnvelope]: + """Start a Subgraph Import + + Subgraphs only: refused with 403 on a main graph, which loads through `create-file-upload` and + `ingest-file`. Starts a bulk load of rows into the subgraph's own tables: one presigned Parquet + upload per table, under one `import_id`. PUT each file with the returned `content_type`, then call + `POST /operations/run-subgraph-import`. A node table's file carries `identifier` and its properties; + a relationship table's carries `from` and `to` (the two nodes' identifiers), then its properties. + Every table named must already exist in the subgraph. + + **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours + return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. + + Args: + graph_id (str): + idempotency_key (None | str | Unset): + body (CreateSubgraphImportOp): Body for create-subgraph-import (bulk rows into a + subgraph's tables). + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorResponse | OperationEnvelope] + """ + + kwargs = _get_kwargs( + graph_id=graph_id, + body=body, + idempotency_key=idempotency_key, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + graph_id: str, + *, + client: AuthenticatedClient, + body: CreateSubgraphImportOp, + idempotency_key: None | str | Unset = UNSET, +) -> ErrorResponse | OperationEnvelope | None: + """Start a Subgraph Import + + Subgraphs only: refused with 403 on a main graph, which loads through `create-file-upload` and + `ingest-file`. Starts a bulk load of rows into the subgraph's own tables: one presigned Parquet + upload per table, under one `import_id`. PUT each file with the returned `content_type`, then call + `POST /operations/run-subgraph-import`. A node table's file carries `identifier` and its properties; + a relationship table's carries `from` and `to` (the two nodes' identifiers), then its properties. + Every table named must already exist in the subgraph. + + **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours + return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. + + Args: + graph_id (str): + idempotency_key (None | str | Unset): + body (CreateSubgraphImportOp): Body for create-subgraph-import (bulk rows into a + subgraph's tables). + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorResponse | OperationEnvelope + """ + + return ( + await asyncio_detailed( + graph_id=graph_id, + client=client, + body=body, + idempotency_key=idempotency_key, + ) + ).parsed diff --git a/robosystems_client/api/content_operations/run_subgraph_import.py b/robosystems_client/api/content_operations/run_subgraph_import.py new file mode 100644 index 0000000..dde3be0 --- /dev/null +++ b/robosystems_client/api/content_operations/run_subgraph_import.py @@ -0,0 +1,288 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_response import ErrorResponse +from ...models.operation_envelope import OperationEnvelope +from ...models.run_subgraph_import_op import RunSubgraphImportOp +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + graph_id: str, + *, + body: RunSubgraphImportOp, + idempotency_key: None | str | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + if not isinstance(idempotency_key, Unset): + headers["Idempotency-Key"] = idempotency_key + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/graphs/{graph_id}/operations/run-subgraph-import".format( + graph_id=quote(str(graph_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorResponse | OperationEnvelope | None: + if response.status_code == 200: + response_200 = OperationEnvelope.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ErrorResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ErrorResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = ErrorResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ErrorResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 409: + response_409 = ErrorResponse.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = ErrorResponse.from_dict(response.json()) + + return response_422 + + if response.status_code == 429: + response_429 = ErrorResponse.from_dict(response.json()) + + return response_429 + + if response.status_code == 500: + response_500 = ErrorResponse.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorResponse | OperationEnvelope]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + graph_id: str, + *, + client: AuthenticatedClient, + body: RunSubgraphImportOp, + idempotency_key: None | str | Unset = UNSET, +) -> Response[ErrorResponse | OperationEnvelope]: + """Run a Subgraph Import + + Subgraphs only: refused with 403 on a main graph. Appends each file uploaded for a `create-subgraph- + import` to its table in the subgraph, node tables before relationship tables. Rows are added, never + replaced: a node whose `identifier` is already present is skipped, and so is a relationship between + two nodes that already have one in that table, so repeating a table is safe. Each table's result has + a `status` (`imported`, `not_uploaded`, `no_such_table` or `failed`) and `rows_ingested`, plus + `values_nulled` and a `warning` when values could not be read as their column's type and were stored + as empty. The call stops between tables after about 20 seconds; while `done` is false, call again + with `tables` set to `remaining`. Returns 409 while another import or materialization of the + subgraph is running. + + **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours + return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. + + Args: + graph_id (str): + idempotency_key (None | str | Unset): + body (RunSubgraphImportOp): Body for run-subgraph-import (copy the uploaded files into + their tables). + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorResponse | OperationEnvelope] + """ + + kwargs = _get_kwargs( + graph_id=graph_id, + body=body, + idempotency_key=idempotency_key, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + graph_id: str, + *, + client: AuthenticatedClient, + body: RunSubgraphImportOp, + idempotency_key: None | str | Unset = UNSET, +) -> ErrorResponse | OperationEnvelope | None: + """Run a Subgraph Import + + Subgraphs only: refused with 403 on a main graph. Appends each file uploaded for a `create-subgraph- + import` to its table in the subgraph, node tables before relationship tables. Rows are added, never + replaced: a node whose `identifier` is already present is skipped, and so is a relationship between + two nodes that already have one in that table, so repeating a table is safe. Each table's result has + a `status` (`imported`, `not_uploaded`, `no_such_table` or `failed`) and `rows_ingested`, plus + `values_nulled` and a `warning` when values could not be read as their column's type and were stored + as empty. The call stops between tables after about 20 seconds; while `done` is false, call again + with `tables` set to `remaining`. Returns 409 while another import or materialization of the + subgraph is running. + + **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours + return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. + + Args: + graph_id (str): + idempotency_key (None | str | Unset): + body (RunSubgraphImportOp): Body for run-subgraph-import (copy the uploaded files into + their tables). + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorResponse | OperationEnvelope + """ + + return sync_detailed( + graph_id=graph_id, + client=client, + body=body, + idempotency_key=idempotency_key, + ).parsed + + +async def asyncio_detailed( + graph_id: str, + *, + client: AuthenticatedClient, + body: RunSubgraphImportOp, + idempotency_key: None | str | Unset = UNSET, +) -> Response[ErrorResponse | OperationEnvelope]: + """Run a Subgraph Import + + Subgraphs only: refused with 403 on a main graph. Appends each file uploaded for a `create-subgraph- + import` to its table in the subgraph, node tables before relationship tables. Rows are added, never + replaced: a node whose `identifier` is already present is skipped, and so is a relationship between + two nodes that already have one in that table, so repeating a table is safe. Each table's result has + a `status` (`imported`, `not_uploaded`, `no_such_table` or `failed`) and `rows_ingested`, plus + `values_nulled` and a `warning` when values could not be read as their column's type and were stored + as empty. The call stops between tables after about 20 seconds; while `done` is false, call again + with `tables` set to `remaining`. Returns 409 while another import or materialization of the + subgraph is running. + + **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours + return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. + + Args: + graph_id (str): + idempotency_key (None | str | Unset): + body (RunSubgraphImportOp): Body for run-subgraph-import (copy the uploaded files into + their tables). + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorResponse | OperationEnvelope] + """ + + kwargs = _get_kwargs( + graph_id=graph_id, + body=body, + idempotency_key=idempotency_key, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + graph_id: str, + *, + client: AuthenticatedClient, + body: RunSubgraphImportOp, + idempotency_key: None | str | Unset = UNSET, +) -> ErrorResponse | OperationEnvelope | None: + """Run a Subgraph Import + + Subgraphs only: refused with 403 on a main graph. Appends each file uploaded for a `create-subgraph- + import` to its table in the subgraph, node tables before relationship tables. Rows are added, never + replaced: a node whose `identifier` is already present is skipped, and so is a relationship between + two nodes that already have one in that table, so repeating a table is safe. Each table's result has + a `status` (`imported`, `not_uploaded`, `no_such_table` or `failed`) and `rows_ingested`, plus + `values_nulled` and a `warning` when values could not be read as their column's type and were stored + as empty. The call stops between tables after about 20 seconds; while `done` is false, call again + with `tables` set to `remaining`. Returns 409 while another import or materialization of the + subgraph is running. + + **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours + return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. + + Args: + graph_id (str): + idempotency_key (None | str | Unset): + body (RunSubgraphImportOp): Body for run-subgraph-import (copy the uploaded files into + their tables). + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorResponse | OperationEnvelope + """ + + return ( + await asyncio_detailed( + graph_id=graph_id, + client=client, + body=body, + idempotency_key=idempotency_key, + ) + ).parsed diff --git a/robosystems_client/models/__init__.py b/robosystems_client/models/__init__.py index 4d88fa9..e46c222 100644 --- a/robosystems_client/models/__init__.py +++ b/robosystems_client/models/__init__.py @@ -157,6 +157,7 @@ from .create_schedule_request import CreateScheduleRequest from .create_security_request import CreateSecurityRequest from .create_security_request_terms import CreateSecurityRequestTerms +from .create_subgraph_import_op import CreateSubgraphImportOp from .create_subgraph_request import CreateSubgraphRequest from .create_subgraph_request_metadata_type_0 import CreateSubgraphRequestMetadataType0 from .create_taxonomy_block_request import CreateTaxonomyBlockRequest @@ -1059,6 +1060,7 @@ from .rule_lite import RuleLite from .rule_target_lite import RuleTargetLite from .rule_variable_lite import RuleVariableLite +from .run_subgraph_import_op import RunSubgraphImportOp from .schedule_created_response import ScheduleCreatedResponse from .schedule_created_response_rule_summary_type_0 import ( ScheduleCreatedResponseRuleSummaryType0, @@ -1425,6 +1427,7 @@ "CreateScheduleRequest", "CreateSecurityRequest", "CreateSecurityRequestTerms", + "CreateSubgraphImportOp", "CreateSubgraphRequest", "CreateSubgraphRequestMetadataType0", "CreateTaxonomyBlockRequest", @@ -1989,6 +1992,7 @@ "RuleLite", "RuleTargetLite", "RuleVariableLite", + "RunSubgraphImportOp", "ScheduleCreatedResponse", "ScheduleCreatedResponseRuleSummaryType0", "ScheduleLegRequest", diff --git a/robosystems_client/models/create_subgraph_import_op.py b/robosystems_client/models/create_subgraph_import_op.py new file mode 100644 index 0000000..daa14dc --- /dev/null +++ b/robosystems_client/models/create_subgraph_import_op.py @@ -0,0 +1,63 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CreateSubgraphImportOp") + + +@_attrs_define +class CreateSubgraphImportOp: + """Body for create-subgraph-import (bulk rows into a subgraph's tables). + + Attributes: + tables (list[str]): The tables to import into, each already in the subgraph. One Parquet file is uploaded per + table. + """ + + tables: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + tables = self.tables + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "tables": tables, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + tables = cast(list[str], d.pop("tables")) + + create_subgraph_import_op = cls( + tables=tables, + ) + + create_subgraph_import_op.additional_properties = d + return create_subgraph_import_op + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/run_subgraph_import_op.py b/robosystems_client/models/run_subgraph_import_op.py new file mode 100644 index 0000000..fba8e58 --- /dev/null +++ b/robosystems_client/models/run_subgraph_import_op.py @@ -0,0 +1,71 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="RunSubgraphImportOp") + + +@_attrs_define +class RunSubgraphImportOp: + """Body for run-subgraph-import (copy the uploaded files into their tables). + + Attributes: + import_id (str): The import_id create-subgraph-import returned + tables (list[str]): The tables to copy, as named in create-subgraph-import; while a result says `done` is false, + the `remaining` it lists. + """ + + import_id: str + tables: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + import_id = self.import_id + + tables = self.tables + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "import_id": import_id, + "tables": tables, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + import_id = d.pop("import_id") + + tables = cast(list[str], d.pop("tables")) + + run_subgraph_import_op = cls( + import_id=import_id, + tables=tables, + ) + + run_subgraph_import_op.additional_properties = d + return run_subgraph_import_op + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties