Apply spaces

async AsyncCogniteClient.data_modeling.spaces.apply(
spaces: SpaceApply | Sequence[SpaceApply],
) Space | SpaceList

Create or patch one or more spaces.

Parameters:

spaces (SpaceApply | Sequence[SpaceApply]) – Space | Sequence[Space]): Space or spaces of spacesda to create or update.

Returns:

Created space(s)

Return type:

Space | SpaceList

Examples

Create new spaces:

>>> from cognite.client import CogniteClient
>>> from cognite.client.data_classes.data_modeling import SpaceApply
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> spaces = [
...     SpaceApply(space="mySpace", description="My first space", name="My Space"),
...     SpaceApply(
...         space="myOtherSpace", description="My second space", name="My Other Space"
...     ),
... ]
>>> res = client.data_modeling.spaces.apply(spaces)