Skip to content

variable

Module to interact with Package Variables.

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

Typical usage example:

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.

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.

description class-attribute instance-attribute

description = Field(None, alias='description')

metadata class-attribute instance-attribute

metadata = Field(None, alias='metadata')

runtime class-attribute instance-attribute

runtime = Field(None, alias='runtime')

source class-attribute instance-attribute

source = Field(None, alias='source')

type_ class-attribute instance-attribute

type_ = Field(None, alias='type')

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:

copy_to

copy_to(
    destination_package,
    destination_team_domain,
    overwrite=False,
    delete_source=False,
    **kwargs
)

Not supported currently.

delete

delete()

Deletes variable.