Skip to content

Address

Address class to store address of object

amsdal_utils.models.data_models.address.Address

Bases: BaseModel

Represents a resource address with flexible identification.

Attributes: resource (str): The resource/connection name. class_name (str): The class name. class_version (Versions | str): The class specific version or LATEST/ALL. object_id (ObjectIDType): The object id. Can be either a single value or list of values in case of compound PK object_version (Versions | str): The object specific version or LATEST/ALL.

from_string classmethod

from_string(address)

Creates an Address instance from a string representation.

Args: cls (type[AddressType]): The class type. address (str): The string representation of the address.

Returns: AddressType: The Address instance created from the string.

Raises: ValueError: If the resource name is not specified in the address.

to_string

to_string()

Convert Address instance to string representation.

Returns: String representation of the address

validate_version classmethod

validate_version(version)

Validate and convert version to Versions enum if possible.

Args: version: Version to validate

Returns: Validated version

is_complete property

is_complete

Check if the address is fully specified.

Returns: Whether all address components are specified

is_full property

is_full

Deprecated, use is_complete instead.

to_query

to_query(prefix='')

Converts the Address instance to a query. Args: prefix (str, optional): The prefix for the query fields. Defaults to ''. Returns: Q: The query object.