Coverage for src/hush_hush/_generated/models/registration_options.py: 60%
30 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="RegistrationOptions")
14@_attrs_define
15class RegistrationOptions:
16 """A WebAuthn `PublicKeyCredentialCreationOptions` object, passed
17 straight to the browser's `navigator.credentials.create()` -
18 opaque to this service's own clients, defined by the WebAuthn
19 specification rather than reproduced here field by field.
21 """
23 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25 def to_dict(self) -> dict[str, Any]:
27 field_dict: dict[str, Any] = {}
28 field_dict.update(self.additional_properties)
30 return field_dict
32 @classmethod
33 def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
34 d = dict(src_dict)
35 registration_options = cls()
37 registration_options.additional_properties = d
38 return registration_options
40 @property
41 def additional_keys(self) -> list[str]:
42 return list(self.additional_properties.keys())
44 def __getitem__(self, key: str) -> Any:
45 return self.additional_properties[key]
47 def __setitem__(self, key: str, value: Any) -> None:
48 self.additional_properties[key] = value
50 def __delitem__(self, key: str) -> None:
51 del self.additional_properties[key]
53 def __contains__(self, key: str) -> bool:
54 return key in self.additional_properties