Coverage for src/hush_hush/_generated/models/used_by.py: 56%
34 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, cast
8from attrs import define as _attrs_define
9from attrs import field as _attrs_field
11T = TypeVar("T", bound="UsedBy")
14@_attrs_define
15class UsedBy:
16 """
17 Attributes:
18 used_by (list[str]): The consumers (repos or hosts) recorded as depending on this
19 object. Set at creation, and replaceable later via
20 UpdateObjectRequest's own used_by field - a plain value update
21 that omits it leaves the list as it was.
22 A consumer named more than once is recorded once.
23 """
25 used_by: list[str]
26 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
28 def to_dict(self) -> dict[str, Any]:
29 used_by = self.used_by
31 field_dict: dict[str, Any] = {}
32 field_dict.update(self.additional_properties)
33 field_dict.update(
34 {
35 "used_by": used_by,
36 }
37 )
39 return field_dict
41 @classmethod
42 def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
43 d = dict(src_dict)
44 used_by = cast(list[str], d.pop("used_by"))
46 used_by = cls(
47 used_by=used_by,
48 )
50 used_by.additional_properties = d
51 return used_by
53 @property
54 def additional_keys(self) -> list[str]:
55 return list(self.additional_properties.keys())
57 def __getitem__(self, key: str) -> Any:
58 return self.additional_properties[key]
60 def __setitem__(self, key: str, value: Any) -> None:
61 self.additional_properties[key] = value
63 def __delitem__(self, key: str) -> None:
64 del self.additional_properties[key]
66 def __contains__(self, key: str) -> bool:
67 return key in self.additional_properties