# World state store API

The world state store service API allows you to retrieve a list of world objects. You can use this list to create custom visualizers to render spatial data related to a machine on the machine’s **VISUALIZE** tab.

The world state store service supports the following methods:

| Method Name | Description |
| --- | --- |
| [`ListUUIDs`](https://docs.viam.com/reference/apis/services/world-state-store/#listuuids) | List all world state transform UUIDs. |
| [`GetTransform`](https://docs.viam.com/reference/apis/services/world-state-store/#gettransform) | Get a world state transform by UUID. |
| [`StreamTransformChanges`](https://docs.viam.com/reference/apis/services/world-state-store/#streamtransformchanges) | Stream changes to world state transforms. |
| [`DoCommand`](https://docs.viam.com/reference/apis/services/world-state-store/#docommand) | Execute model-specific commands that are not otherwise defined by the service API. |
| [`GetResourceName`](https://docs.viam.com/reference/apis/services/world-state-store/#getresourcename) | Get the ResourceName for this Resource with the given name. |
| [`Close`](https://docs.viam.com/reference/apis/services/world-state-store/#close) | Safely shut down the resource and prevent further use. |

## API

### ListUUIDs

List all world state transform UUIDs.

- [Python](https://docs.viam.com/reference/apis/services/world-state-store/#tabset-referenceapisservicesworld-state-store-1-0)
- [TypeScript](https://docs.viam.com/reference/apis/services/world-state-store/#tabset-referenceapisservicesworld-state-store-1-1)

**Parameters:**

- `extra` (Mapping[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]) (optional): Extra options to pass to the underlying RPC call.
- `timeout` ( [float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.

**Returns:**

- (List[ [bytes](https://docs.python.org/3/library/stdtypes.html#bytes-objects)])

**Example:**

```python

```

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/worldstatestore/index.html#viam.services.worldstatestore.WorldStateStore.list_uuids).

**Parameters:**

- `extra` (None) (optional): Additional arguments to the method.
- `callOptions` (CallOptions) (optional)

**Returns:**

- (Promise<string[]>)

**Example:**

```ts

```

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/WorldStateStoreClient.html#listuuids).

### GetTransform

Get a world state transform by UUID.

- [Python](https://docs.viam.com/reference/apis/services/world-state-store/#tabset-referenceapisservicesworld-state-store-2-0)
- [TypeScript](https://docs.viam.com/reference/apis/services/world-state-store/#tabset-referenceapisservicesworld-state-store-2-1)

**Parameters:**

- `uuid` ( [bytes](https://docs.python.org/3/library/stdtypes.html#bytes-objects)) (required): The UUID of the transform to retrieve.
- `extra` (Mapping[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]) (optional): Extra options to pass to the underlying RPC call.
- `timeout` ( [float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.

**Returns:**

- ( [viam.proto.common.Transform](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.Transform))

**Example:**

```python

```

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/worldstatestore/index.html#viam.services.worldstatestore.WorldStateStore.get_transform).

**Parameters:**

- `uuid` (string) (required): The UUID of the transform to retrieve.
- `extra` (None) (optional): Additional arguments to the method.
- `callOptions` (CallOptions) (optional)

**Returns:**

- (Promise< [TransformWithUUID](https://ts.viam.dev/interfaces/TransformWithUUID.html) >)

**Example:**

```ts

```

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/WorldStateStoreClient.html#gettransform).

### StreamTransformChanges

Stream changes to world state transforms.

- [Python](https://docs.viam.com/reference/apis/services/world-state-store/#tabset-referenceapisservicesworld-state-store-3-0)
- [TypeScript](https://docs.viam.com/reference/apis/services/world-state-store/#tabset-referenceapisservicesworld-state-store-3-1)

**Parameters:**

**Returns:**

- ( [AsyncGenerator[viam.proto.service.worldstatestore.StreamTransformChangesResponse, None]](https://python.viam.dev/autoapi/viam/proto/service/worldstatestore/index.html#viam.proto.service.worldstatestore.StreamTransformChangesResponse))

**Example:**

```python

```

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/worldstatestore/index.html#viam.services.worldstatestore.WorldStateStore.stream_transform_changes).

**Parameters:**

- `extra` (None) (optional): Additional arguments to the method.
- `callOptions` (CallOptions) (optional)

**Returns:**

- (AsyncGenerator< [TransformChangeEvent](https://ts.viam.dev/types/TransformChangeEvent.html), void>)

**Example:**

```ts

```

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/WorldStateStoreClient.html#streamtransformchanges).

### DoCommand

Execute model-specific commands that are not otherwise defined by the service API. Most models do not implement `DoCommand`. Any available model-specific commands should be covered in the model’s documentation. If you are implementing your own vision service and want to add features that have no corresponding built-in API method, you can implement them with [`DoCommand`](https://docs.viam.com/reference/sdks/docommand/).

- [Python](https://docs.viam.com/reference/apis/services/world-state-store/#tabset-referenceapisservicesworld-state-store-4-0)
- [TypeScript](https://docs.viam.com/reference/apis/services/world-state-store/#tabset-referenceapisservicesworld-state-store-4-1)

**Parameters:**

- `command` (Mapping[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), ValueTypes]) (required): The command to execute.
- `timeout` ( [float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.

**Returns:**

- (Mapping[ [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes])

**Example:**

```python

```

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/worldstatestore/index.html#viam.services.worldstatestore.WorldStateStore.do_command).

**Parameters:**

- `command` ( [Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, which will be converted automatically.
- `callOptions` (CallOptions) (optional)

**Returns:**

- (Promise< [JsonValue](https://ts.viam.dev/types/JsonValue.html) >)

**Example:**

```ts

```

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/WorldStateStoreClient.html#docommand).

### GetResourceName

Get the ResourceName for this Resource with the given name.

- [Python](https://docs.viam.com/reference/apis/services/world-state-store/#tabset-referenceapisservicesworld-state-store-5-0)
- [TypeScript](https://docs.viam.com/reference/apis/services/world-state-store/#tabset-referenceapisservicesworld-state-store-5-1)

**Parameters:**

- `name` ( [str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The name of the Resource.

**Returns:**

- ( [viam.proto.common.ResourceName](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.ResourceName)): : The ResourceName of this Resource.

**Example:**

```python

```

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/worldstatestore/index.html#viam.services.worldstatestore.WorldStateStore.get_resource_name).

**Parameters:**

- None.

**Returns:**

- (string): The name of the resource.

**Example:**

```ts

```

For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/WorldStateStoreClient.html#name).

### Close

Safely shut down the resource and prevent further use.

- [Python](https://docs.viam.com/reference/apis/services/world-state-store/#tabset-referenceapisservicesworld-state-store-6-0)

**Parameters:**

- None.

**Returns:**

- None.

**Example:**

```python

```

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/worldstatestore/index.html#viam.services.worldstatestore.WorldStateStore.close).
