Address
Address class to store address of object
amsdal_utils.models.data_models.address.Address ¶
Bases: QueryableMixin
, BaseModel
Represents an address in the system.
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 (str): The object id. object_version (Versions | str): The object specific version or LATEST/ALL.
is_full
property
¶
is_full
Checks if the address is fully specified.
Returns: bool: True if the address is fully specified, False otherwise.
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.
set_version
classmethod
¶
set_version(version_id)
Validates and sets the version for class_version and object_version fields.
Args: cls (type): The class type. version_id (str | Versions): The version identifier, which can be a string or a Versions enum.
Returns: str | Versions: The validated version identifier.
Raises: ValueError: If the version_id is a string that cannot be converted to a Versions enum.
to_string ¶
to_string()
Converts the Address instance to its string representation.
Returns: str: The string representation of the Address instance.
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.