Custom Field

class AzuracastPy.models.administration.CustomField(name: str, short_name: str, auto_assign: str, id: int, links: Links, _admin)

Represents a custom field on a radio.

__init__(name: str, short_name: str, auto_assign: str, id: int, links: Links, _admin)

Initializes a CustomField object.

Note

This class should not be initialized directly. Instead, obtain an instance via: create(), __call__() or custom_fields().

delete()

Deletes the custom field from the radio.

Sets all attributes of the current CustomField object to None.

Usage:

custom_field.delete()
edit(name: str | None = None, short_name: str | None = None, auto_assign_value: AutoAssignValues | None = None)

Edits the custom field’s properties.

Updates all edited attributes of the current CustomField object.

Parameters:
  • name – (Optional) The new name of the custom field. Default: None.

  • short_name – (Optional) The new short name of the custom field. Default: None.

  • auto_assign_value – (Optional) The new auto assign value of the custom field. Default: None.

Usage:

from AzuracastPy.enums import AutoAssignValues

custom_field.edit(
    name="New name"
    auto_assign_value=AutoAssignValues.ALBUM_ARTIST
)