Coverage for src/hush_hush/_generated/models/audit_actor_option.py: 54%
37 statements
« prev ^ index » next coverage.py v7.16.0, created at 2026-10-16 16:01 +0000
« prev ^ index » next coverage.py v7.16.0, created at 2026-10-16 16:01 +0000
1# Code generated by openapi-python-client from hush-hush/api/openapi.yaml; DO NOT EDIT.
3from __future__ import annotations
5from collections.abc import Mapping
6from typing import Any, TypeVar
8from attrs import define as _attrs_define
9from attrs import field as _attrs_field
11T = TypeVar("T", bound="AuditActorOption")
14@_attrs_define
15class AuditActorOption:
16 """
17 Example:
18 {'value': 'a1b2c3d4e5f6a7b8', 'label': 'token:a1b2c3d4e5f6a7b8'}
20 Attributes:
21 value (str): What to send back as the `actor` query parameter to select this actor.
22 label (str): What to show the user - "admin", "token:<id>" for a write token,
23 "consumer-token:<id>" for a consumer token, or "none" for an
24 unauthenticated read.
25 """
27 value: str
28 label: str
29 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
31 def to_dict(self) -> dict[str, Any]:
32 value = self.value
34 label = self.label
36 field_dict: dict[str, Any] = {}
37 field_dict.update(self.additional_properties)
38 field_dict.update(
39 {
40 "value": value,
41 "label": label,
42 }
43 )
45 return field_dict
47 @classmethod
48 def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
49 d = dict(src_dict)
50 value = d.pop("value")
52 label = d.pop("label")
54 audit_actor_option = cls(
55 value=value,
56 label=label,
57 )
59 audit_actor_option.additional_properties = d
60 return audit_actor_option
62 @property
63 def additional_keys(self) -> list[str]:
64 return list(self.additional_properties.keys())
66 def __getitem__(self, key: str) -> Any:
67 return self.additional_properties[key]
69 def __setitem__(self, key: str, value: Any) -> None:
70 self.additional_properties[key] = value
72 def __delitem__(self, key: str) -> None:
73 del self.additional_properties[key]
75 def __contains__(self, key: str) -> bool:
76 return key in self.additional_properties