Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Etykiety, pola i opcje przechodzą w swoim cyklu życia przez określone stany.
Etykiety mogą też mieć różne wersje. Ten diagram pokazuje cykl życia etykiety, w tym wersjonowanie:
Rysunek 3. Cykl życia etykiety
Utwórz etykietę (create()) – etykieta jest tworzona i przechowywana w bazie danych jako revision_id=1. Etykieta ma stan UNPUBLISHED_DRAFT.
W tym stanie:
Użytkownicy nie mogą wyświetlać etykiety
Użytkownicy nie mogą stosować etykiety do elementów na Dysku.
(Opcjonalnie) Zaktualizuj etykietę, pole lub wybór (delta()) – każda aktualizacja, nawet przed opublikowaniem, jest przechowywana w bazie danych, a wersja etykiety jest zwiększana.
Opublikuj etykietę (publish()) – etykieta ma stan PUBLISHED i użytkownicy mogą ją stosować. Opublikowanie etykiety zwiększa jej wersję.
(Opcjonalnie) Zaktualizuj etykietę, pole lub wybór (delta()) – etykieta, pole lub wybór zostaną zaktualizowane i zapisane w bazie danych jako etykieta w wersji roboczej. Etykieta ma stan PUBLISHED, przy czym hasUnpublishedChanges=true oznacza, że istnieją zmiany w wersji roboczej, ale nie są one dostępne dla użytkowników. Każda aktualizacja zwiększa numer wersji etykiety.
(opcjonalnie) Opublikuj etykietę (publish()) – jeśli jest dostępna, publikowana jest najnowsza wersja robocza. Etykieta ma stan PUBLISHED i użytkownicy mogą ją zastosować. Opublikowanie etykiety zwiększa jej wersję.
Wyłączenie etykiety (disable()) – etykieta ma stan DISABLED, ale użytkownicy mogą stosować ją za pomocą interfejsu API. Wyłączona etykieta nie jest jednak wyświetlana w interfejsie, chyba że skonfigurujesz jej wyświetlanie. Wycofanie etykiety powoduje zwiększenie jej wersji.
Włącz etykietę (enable()) – etykieta wraca do stanu PUBLISHED, a użytkownicy mogą ją stosować. Opublikowanie etykiety zwiększa jej wersję.
Usuń etykietę (delete()) – etykieta ma stan DELETED i nie można jej zastosować. Usunięte etykiety są ostatecznie usuwane.
Warto podkreślić, że każda aktualizacja etykiety zwiększa jej numer wersji. Jeśli etykieta została już opublikowana, ponowne opublikowanie jej po n aktualizacjach oznacza, że jej opublikowany numer wersji to wersja + n + 1 kolejnych aktualizacji.
[null,null,["Ostatnia aktualizacja: 2025-08-29 UTC."],[],[],null,["# Label lifecycle\n\nLabels, fields, and choices go through specific states throughout their lives.\nAdditionally, labels might have different revisions. The following diagram shows\nthe label lifecycle, including revisioning:\n**Figure 3.** Lifecycle of a label\n\n1. **Create a label (`create()`)** ---The label is created and stored in a database as `revision_id=1`. The label has the state of `UNPUBLISHED_DRAFT`. In this state:\n - Users can't view the label\n - Users can't apply the label to Drive items.\n2. **(optional) Update a label, field, or choice (`delta()`)**--- Every update, even before it's published, is stored in a database, and the label's revision is incremented.\n3. **Publish a label (`publish()`)** ---The label has the state of `PUBLISHED` and users can apply the label. Publishing the label increments its revision.\n4. **(optional) Update a label, field, or choice (`delta()`)** --- The label, field, or choice is updated and stored in a database as a draft label. The label has the state of `PUBLISHED` with `hasUnpublishedChanges=true` meaning there are draft changes, but they aren't available to users. Each update increments the label's revision.\n5. **(optional) Publish a label (`publish()`)** ---If available, the most-current draft is published. The label has the state of `PUBLISHED` and users can apply the label. Publishing the label increments its version.\n6. **Disable a label (`disable()`)** ---The label has the state of `DISABLED` though users can apply the label through the API. However, a disabled label isn't shown in a UI unless configured to be shown. Deprecating the label increments its revision.\n7. **Enable a label (`enable()`)** ---The label is returned to a `PUBLISHED` state and users can apply the label. Publishing the label increments its revision.\n8. **Delete a label (`delete()`)** ---The label has a state of `DELETED` and can't be applied. Deleted labels are eventually purged.\n\nIt's important to emphasize that every update to a label increments the label's\nrevision. And, if the label has already been published, publishing it again\nafter *n* updates means that its published revision number is revision + *n* + 1\nnumber of successive updates."]]