Coverage for src/hush_hush/_generated/models/actor.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="Actor")
14@_attrs_define
15class Actor:
16 """Who performed an audited write. `type` is `session` (the admin
17 account, `id` is its actor id), `token` (a write token, `id` is its
18 token id) or `consumer_token` (a consumer token, `id` is its id) -
19 the same values `GET /audit-log` reports.
21 Attributes:
22 type_ (str):
23 id (str):
24 """
26 type_: str
27 id: str
28 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
30 def to_dict(self) -> dict[str, Any]:
31 type_ = self.type_
33 id = self.id
35 field_dict: dict[str, Any] = {}
36 field_dict.update(self.additional_properties)
37 field_dict.update(
38 {
39 "type": type_,
40 "id": id,
41 }
42 )
44 return field_dict
46 @classmethod
47 def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
48 d = dict(src_dict)
49 type_ = d.pop("type")
51 id = d.pop("id")
53 actor = cls(
54 type_=type_,
55 id=id,
56 )
58 actor.additional_properties = d
59 return actor
61 @property
62 def additional_keys(self) -> list[str]:
63 return list(self.additional_properties.keys())
65 def __getitem__(self, key: str) -> Any:
66 return self.additional_properties[key]
68 def __setitem__(self, key: str, value: Any) -> None:
69 self.additional_properties[key] = value
71 def __delitem__(self, key: str) -> None:
72 del self.additional_properties[key]
74 def __contains__(self, key: str) -> bool:
75 return key in self.additional_properties