Skip to content

variable

Module to interact with Package Variables.

This module contains class to interact with Package Variables in Studio.

Typical usage example:

```python
variable = package.create_variable("DATA_MODEL_VARIABLE", "DATA_MODEL_ID", "DATA_MODEL")
variables = package.get_variables()

variable.delete()
```

Variable

Bases: VariableDefinitionWithValue

Variable object to interact with variable specific studio endpoints.

type_ class-attribute instance-attribute

type_ = Field(alias='type')

description class-attribute instance-attribute

description = Field(alias='description')

source class-attribute instance-attribute

source = Field(alias='source')

runtime class-attribute instance-attribute

runtime = Field(alias='runtime')

metadata class-attribute instance-attribute

metadata = Field(alias='metadata')

client class-attribute instance-attribute

client = Field(..., exclude=True)

key instance-attribute

key

Key of variable.

package_key instance-attribute

package_key

Key of package where variable is located.

value instance-attribute

value

Value of variable.

from_transport classmethod

from_transport(client, package_key, variable_transport)

Creates high-level variable object from given VariableDefinitionWithValue.

Parameters:

  • client (Client) –

    Client to use to make API calls for given variable.

  • package_key (str) –

    Key of package where variable is located.

  • variable_transport (VariableDefinitionWithValue) –

    VariableDefinitionWithValue object containing properties of variable.

Returns:

  • Variable

    A Variable object with properties from transport and given client.

update

update()

Pushes local changes of variable to EMS and updates properties with response from EMS.

sync

sync()

Syncs variable properties with EMS.

Raises:

delete

delete()

Deletes variable.