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

1# Code generated by openapi-python-client from hush-hush/api/openapi.yaml; DO NOT EDIT. 

2 

3from __future__ import annotations 

4 

5from collections.abc import Mapping 

6from typing import Any, TypeVar 

7 

8from attrs import define as _attrs_define 

9from attrs import field as _attrs_field 

10 

11T = TypeVar("T", bound="RegistrationOptions") 

12 

13 

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. 

20 

21 """ 

22 

23 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) 

24 

25 def to_dict(self) -> dict[str, Any]: 

26 

27 field_dict: dict[str, Any] = {} 

28 field_dict.update(self.additional_properties) 

29 

30 return field_dict 

31 

32 @classmethod 

33 def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 

34 d = dict(src_dict) 

35 registration_options = cls() 

36 

37 registration_options.additional_properties = d 

38 return registration_options 

39 

40 @property 

41 def additional_keys(self) -> list[str]: 

42 return list(self.additional_properties.keys()) 

43 

44 def __getitem__(self, key: str) -> Any: 

45 return self.additional_properties[key] 

46 

47 def __setitem__(self, key: str, value: Any) -> None: 

48 self.additional_properties[key] = value 

49 

50 def __delitem__(self, key: str) -> None: 

51 del self.additional_properties[key] 

52 

53 def __contains__(self, key: str) -> bool: 

54 return key in self.additional_properties