affinidi_tdk_wallets_client 1.19.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of affinidi_tdk_wallets_client might be problematic. Click here for more details.

Files changed (42) hide show
  1. affinidi_tdk_wallets_client/__init__.py +63 -0
  2. affinidi_tdk_wallets_client/api/__init__.py +7 -0
  3. affinidi_tdk_wallets_client/api/default_api.py +202 -0
  4. affinidi_tdk_wallets_client/api/revocation_api.py +351 -0
  5. affinidi_tdk_wallets_client/api/wallet_api.py +1094 -0
  6. affinidi_tdk_wallets_client/api_client.py +760 -0
  7. affinidi_tdk_wallets_client/api_response.py +25 -0
  8. affinidi_tdk_wallets_client/configuration.py +464 -0
  9. affinidi_tdk_wallets_client/exceptions.py +167 -0
  10. affinidi_tdk_wallets_client/models/__init__.py +44 -0
  11. affinidi_tdk_wallets_client/models/create_wallet_input.py +142 -0
  12. affinidi_tdk_wallets_client/models/create_wallet_response.py +76 -0
  13. affinidi_tdk_wallets_client/models/did_key_input_params.py +86 -0
  14. affinidi_tdk_wallets_client/models/did_web_input_params.py +92 -0
  15. affinidi_tdk_wallets_client/models/entity_not_found_error.py +109 -0
  16. affinidi_tdk_wallets_client/models/get_revocation_credential_status_ok.py +72 -0
  17. affinidi_tdk_wallets_client/models/get_revocation_list_credential_result_dto.py +72 -0
  18. affinidi_tdk_wallets_client/models/invalid_did_parameter_error.py +109 -0
  19. affinidi_tdk_wallets_client/models/invalid_parameter_error.py +109 -0
  20. affinidi_tdk_wallets_client/models/key_not_found_error.py +109 -0
  21. affinidi_tdk_wallets_client/models/not_found_error.py +109 -0
  22. affinidi_tdk_wallets_client/models/operation_forbidden_error.py +109 -0
  23. affinidi_tdk_wallets_client/models/revoke_credential_input.py +79 -0
  24. affinidi_tdk_wallets_client/models/service_error_response.py +86 -0
  25. affinidi_tdk_wallets_client/models/service_error_response_details_inner.py +78 -0
  26. affinidi_tdk_wallets_client/models/sign_credential400_response.py +142 -0
  27. affinidi_tdk_wallets_client/models/sign_credential_input_dto.py +92 -0
  28. affinidi_tdk_wallets_client/models/sign_credential_input_dto_unsigned_credential_params.py +89 -0
  29. affinidi_tdk_wallets_client/models/sign_credential_result_dto.py +76 -0
  30. affinidi_tdk_wallets_client/models/sign_credential_result_dto_signed_credential.py +148 -0
  31. affinidi_tdk_wallets_client/models/sign_jwt_token.py +74 -0
  32. affinidi_tdk_wallets_client/models/sign_jwt_token_ok.py +72 -0
  33. affinidi_tdk_wallets_client/models/signing_failed_error.py +109 -0
  34. affinidi_tdk_wallets_client/models/update_wallet_input.py +74 -0
  35. affinidi_tdk_wallets_client/models/wallet_dto.py +96 -0
  36. affinidi_tdk_wallets_client/models/wallet_dto_keys_inner.py +74 -0
  37. affinidi_tdk_wallets_client/models/wallets_list_dto.py +80 -0
  38. affinidi_tdk_wallets_client/py.typed +0 -0
  39. affinidi_tdk_wallets_client/rest.py +328 -0
  40. affinidi_tdk_wallets_client-1.19.0.dist-info/METADATA +188 -0
  41. affinidi_tdk_wallets_client-1.19.0.dist-info/RECORD +42 -0
  42. affinidi_tdk_wallets_client-1.19.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,86 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ CloudWalletEssentials
5
+
6
+ Cloud Wallet For Enterprise Structure
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: info@affinidi.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+
22
+ from typing import List, Optional
23
+ from pydantic import BaseModel, Field, StrictStr, conlist
24
+ from affinidi_tdk_wallets_client.models.service_error_response_details_inner import ServiceErrorResponseDetailsInner
25
+
26
+ class ServiceErrorResponse(BaseModel):
27
+ """
28
+ ServiceErrorResponse
29
+ """
30
+ debug_id: StrictStr = Field(..., alias="debugId", description="unique id for correlating this specific error to logs")
31
+ name: StrictStr = Field(..., description="name of the error")
32
+ code: StrictStr = Field(..., description="backwards compatible Affinidi error code")
33
+ details: Optional[conlist(ServiceErrorResponseDetailsInner)] = None
34
+ __properties = ["debugId", "name", "code", "details"]
35
+
36
+ class Config:
37
+ """Pydantic configuration"""
38
+ allow_population_by_field_name = True
39
+ validate_assignment = True
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.dict(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> ServiceErrorResponse:
51
+ """Create an instance of ServiceErrorResponse from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self):
55
+ """Returns the dictionary representation of the model using alias"""
56
+ _dict = self.dict(by_alias=True,
57
+ exclude={
58
+ },
59
+ exclude_none=True)
60
+ # override the default output from pydantic by calling `to_dict()` of each item in details (list)
61
+ _items = []
62
+ if self.details:
63
+ for _item in self.details:
64
+ if _item:
65
+ _items.append(_item.to_dict())
66
+ _dict['details'] = _items
67
+ return _dict
68
+
69
+ @classmethod
70
+ def from_dict(cls, obj: dict) -> ServiceErrorResponse:
71
+ """Create an instance of ServiceErrorResponse from a dict"""
72
+ if obj is None:
73
+ return None
74
+
75
+ if not isinstance(obj, dict):
76
+ return ServiceErrorResponse.parse_obj(obj)
77
+
78
+ _obj = ServiceErrorResponse.parse_obj({
79
+ "debug_id": obj.get("debugId"),
80
+ "name": obj.get("name"),
81
+ "code": obj.get("code"),
82
+ "details": [ServiceErrorResponseDetailsInner.from_dict(_item) for _item in obj.get("details")] if obj.get("details") is not None else None
83
+ })
84
+ return _obj
85
+
86
+
@@ -0,0 +1,78 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ CloudWalletEssentials
5
+
6
+ Cloud Wallet For Enterprise Structure
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: info@affinidi.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+
22
+ from typing import Optional
23
+ from pydantic import BaseModel, Field, StrictStr
24
+
25
+ class ServiceErrorResponseDetailsInner(BaseModel):
26
+ """
27
+ ServiceErrorResponseDetailsInner
28
+ """
29
+ issue: StrictStr = Field(...)
30
+ field: Optional[StrictStr] = None
31
+ value: Optional[StrictStr] = None
32
+ location: Optional[StrictStr] = None
33
+ __properties = ["issue", "field", "value", "location"]
34
+
35
+ class Config:
36
+ """Pydantic configuration"""
37
+ allow_population_by_field_name = True
38
+ validate_assignment = True
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.dict(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> ServiceErrorResponseDetailsInner:
50
+ """Create an instance of ServiceErrorResponseDetailsInner from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self):
54
+ """Returns the dictionary representation of the model using alias"""
55
+ _dict = self.dict(by_alias=True,
56
+ exclude={
57
+ },
58
+ exclude_none=True)
59
+ return _dict
60
+
61
+ @classmethod
62
+ def from_dict(cls, obj: dict) -> ServiceErrorResponseDetailsInner:
63
+ """Create an instance of ServiceErrorResponseDetailsInner from a dict"""
64
+ if obj is None:
65
+ return None
66
+
67
+ if not isinstance(obj, dict):
68
+ return ServiceErrorResponseDetailsInner.parse_obj(obj)
69
+
70
+ _obj = ServiceErrorResponseDetailsInner.parse_obj({
71
+ "issue": obj.get("issue"),
72
+ "field": obj.get("field"),
73
+ "value": obj.get("value"),
74
+ "location": obj.get("location")
75
+ })
76
+ return _obj
77
+
78
+
@@ -0,0 +1,142 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ CloudWalletEssentials
5
+
6
+ Cloud Wallet For Enterprise Structure
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: info@affinidi.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ from inspect import getfullargspec
18
+ import json
19
+ import pprint
20
+ import re # noqa: F401
21
+
22
+ from typing import Any, List, Optional
23
+ from pydantic import BaseModel, Field, StrictStr, ValidationError, validator
24
+ from affinidi_tdk_wallets_client.models.invalid_parameter_error import InvalidParameterError
25
+ from affinidi_tdk_wallets_client.models.signing_failed_error import SigningFailedError
26
+ from typing import Union, Any, List, TYPE_CHECKING
27
+ from pydantic import StrictStr, Field
28
+
29
+ SIGNCREDENTIAL400RESPONSE_ONE_OF_SCHEMAS = ["InvalidParameterError", "SigningFailedError"]
30
+
31
+ class SignCredential400Response(BaseModel):
32
+ """
33
+ SignCredential400Response
34
+ """
35
+ # data type: InvalidParameterError
36
+ oneof_schema_1_validator: Optional[InvalidParameterError] = None
37
+ # data type: SigningFailedError
38
+ oneof_schema_2_validator: Optional[SigningFailedError] = None
39
+ if TYPE_CHECKING:
40
+ actual_instance: Union[InvalidParameterError, SigningFailedError]
41
+ else:
42
+ actual_instance: Any
43
+ one_of_schemas: List[str] = Field(SIGNCREDENTIAL400RESPONSE_ONE_OF_SCHEMAS, const=True)
44
+
45
+ class Config:
46
+ validate_assignment = True
47
+
48
+ def __init__(self, *args, **kwargs) -> None:
49
+ if args:
50
+ if len(args) > 1:
51
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
52
+ if kwargs:
53
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
54
+ super().__init__(actual_instance=args[0])
55
+ else:
56
+ super().__init__(**kwargs)
57
+
58
+ @validator('actual_instance')
59
+ def actual_instance_must_validate_oneof(cls, v):
60
+ instance = SignCredential400Response.construct()
61
+ error_messages = []
62
+ match = 0
63
+ # validate data type: InvalidParameterError
64
+ if not isinstance(v, InvalidParameterError):
65
+ error_messages.append(f"Error! Input type `{type(v)}` is not `InvalidParameterError`")
66
+ else:
67
+ match += 1
68
+ # validate data type: SigningFailedError
69
+ if not isinstance(v, SigningFailedError):
70
+ error_messages.append(f"Error! Input type `{type(v)}` is not `SigningFailedError`")
71
+ else:
72
+ match += 1
73
+ if match > 1:
74
+ # more than 1 match
75
+ raise ValueError("Multiple matches found when setting `actual_instance` in SignCredential400Response with oneOf schemas: InvalidParameterError, SigningFailedError. Details: " + ", ".join(error_messages))
76
+ elif match == 0:
77
+ # no match
78
+ raise ValueError("No match found when setting `actual_instance` in SignCredential400Response with oneOf schemas: InvalidParameterError, SigningFailedError. Details: " + ", ".join(error_messages))
79
+ else:
80
+ return v
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: dict) -> SignCredential400Response:
84
+ return cls.from_json(json.dumps(obj))
85
+
86
+ @classmethod
87
+ def from_json(cls, json_str: str) -> SignCredential400Response:
88
+ """Returns the object represented by the json string"""
89
+ instance = SignCredential400Response.construct()
90
+ error_messages = []
91
+ match = 0
92
+
93
+ # deserialize data into InvalidParameterError
94
+ try:
95
+ instance.actual_instance = InvalidParameterError.from_json(json_str)
96
+ match += 1
97
+ except (ValidationError, ValueError) as e:
98
+ error_messages.append(str(e))
99
+ # deserialize data into SigningFailedError
100
+ try:
101
+ instance.actual_instance = SigningFailedError.from_json(json_str)
102
+ match += 1
103
+ except (ValidationError, ValueError) as e:
104
+ error_messages.append(str(e))
105
+
106
+ if match > 1:
107
+ # more than 1 match
108
+ raise ValueError("Multiple matches found when deserializing the JSON string into SignCredential400Response with oneOf schemas: InvalidParameterError, SigningFailedError. Details: " + ", ".join(error_messages))
109
+ elif match == 0:
110
+ # no match
111
+ raise ValueError("No match found when deserializing the JSON string into SignCredential400Response with oneOf schemas: InvalidParameterError, SigningFailedError. Details: " + ", ".join(error_messages))
112
+ else:
113
+ return instance
114
+
115
+ def to_json(self) -> str:
116
+ """Returns the JSON representation of the actual instance"""
117
+ if self.actual_instance is None:
118
+ return "null"
119
+
120
+ to_json = getattr(self.actual_instance, "to_json", None)
121
+ if callable(to_json):
122
+ return self.actual_instance.to_json()
123
+ else:
124
+ return json.dumps(self.actual_instance)
125
+
126
+ def to_dict(self) -> dict:
127
+ """Returns the dict representation of the actual instance"""
128
+ if self.actual_instance is None:
129
+ return None
130
+
131
+ to_dict = getattr(self.actual_instance, "to_dict", None)
132
+ if callable(to_dict):
133
+ return self.actual_instance.to_dict()
134
+ else:
135
+ # primitive type
136
+ return self.actual_instance
137
+
138
+ def to_str(self) -> str:
139
+ """Returns the string representation of the actual instance"""
140
+ return pprint.pformat(self.dict())
141
+
142
+
@@ -0,0 +1,92 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ CloudWalletEssentials
5
+
6
+ Cloud Wallet For Enterprise Structure
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: info@affinidi.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+
22
+ from typing import Any, Dict, Optional
23
+ from pydantic import BaseModel, Field, StrictBool, StrictStr, validator
24
+ from affinidi_tdk_wallets_client.models.sign_credential_input_dto_unsigned_credential_params import SignCredentialInputDtoUnsignedCredentialParams
25
+
26
+ class SignCredentialInputDto(BaseModel):
27
+ """
28
+ DTO contains params to sign credential # noqa: E501
29
+ """
30
+ unsigned_credential: Optional[Dict[str, Any]] = Field(None, alias="unsignedCredential", description="Unsigned Credential. If provided \"unsignedCredentialParams\" is not accepted")
31
+ revocable: Optional[StrictBool] = None
32
+ credential_format: Optional[StrictStr] = Field(None, alias="credentialFormat")
33
+ unsigned_credential_params: Optional[SignCredentialInputDtoUnsignedCredentialParams] = Field(None, alias="unsignedCredentialParams")
34
+ __properties = ["unsignedCredential", "revocable", "credentialFormat", "unsignedCredentialParams"]
35
+
36
+ @validator('credential_format')
37
+ def credential_format_validate_enum(cls, value):
38
+ """Validates the enum"""
39
+ if value is None:
40
+ return value
41
+
42
+ if value not in ('ldp_vc', 'jwt_vc_json-ld'):
43
+ raise ValueError("must be one of enum values ('ldp_vc', 'jwt_vc_json-ld')")
44
+ return value
45
+
46
+ class Config:
47
+ """Pydantic configuration"""
48
+ allow_population_by_field_name = True
49
+ validate_assignment = True
50
+
51
+ def to_str(self) -> str:
52
+ """Returns the string representation of the model using alias"""
53
+ return pprint.pformat(self.dict(by_alias=True))
54
+
55
+ def to_json(self) -> str:
56
+ """Returns the JSON representation of the model using alias"""
57
+ return json.dumps(self.to_dict())
58
+
59
+ @classmethod
60
+ def from_json(cls, json_str: str) -> SignCredentialInputDto:
61
+ """Create an instance of SignCredentialInputDto from a JSON string"""
62
+ return cls.from_dict(json.loads(json_str))
63
+
64
+ def to_dict(self):
65
+ """Returns the dictionary representation of the model using alias"""
66
+ _dict = self.dict(by_alias=True,
67
+ exclude={
68
+ },
69
+ exclude_none=True)
70
+ # override the default output from pydantic by calling `to_dict()` of unsigned_credential_params
71
+ if self.unsigned_credential_params:
72
+ _dict['unsignedCredentialParams'] = self.unsigned_credential_params.to_dict()
73
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: dict) -> SignCredentialInputDto:
77
+ """Create an instance of SignCredentialInputDto from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return SignCredentialInputDto.parse_obj(obj)
83
+
84
+ _obj = SignCredentialInputDto.parse_obj({
85
+ "unsigned_credential": obj.get("unsignedCredential"),
86
+ "revocable": obj.get("revocable"),
87
+ "credential_format": obj.get("credentialFormat"),
88
+ "unsigned_credential_params": SignCredentialInputDtoUnsignedCredentialParams.from_dict(obj.get("unsignedCredentialParams")) if obj.get("unsignedCredentialParams") is not None else None
89
+ })
90
+ return _obj
91
+
92
+
@@ -0,0 +1,89 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ CloudWalletEssentials
5
+
6
+ Cloud Wallet For Enterprise Structure
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: info@affinidi.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+
22
+ from typing import Any, Dict
23
+ from pydantic import BaseModel, Field, StrictStr, constr, validator
24
+
25
+ class SignCredentialInputDtoUnsignedCredentialParams(BaseModel):
26
+ """
27
+ unsignedCredentialParams. Used to build an unsigned credential before the signing. This param is not accepted when \"unsignedCredential\" is given # noqa: E501
28
+ """
29
+ json_ld_context_url: StrictStr = Field(..., alias="jsonLdContextUrl")
30
+ json_schema_url: StrictStr = Field(..., alias="jsonSchemaUrl")
31
+ type_name: StrictStr = Field(..., alias="typeName")
32
+ credential_subject: Dict[str, Any] = Field(..., alias="credentialSubject")
33
+ holder_did: constr(strict=True) = Field(..., alias="holderDid")
34
+ expires_at: StrictStr = Field(..., alias="expiresAt")
35
+ __properties = ["jsonLdContextUrl", "jsonSchemaUrl", "typeName", "credentialSubject", "holderDid", "expiresAt"]
36
+
37
+ @validator('holder_did')
38
+ def holder_did_validate_regular_expression(cls, value):
39
+ """Validates the regular expression"""
40
+ if not re.match(r"^did:.*$", value):
41
+ raise ValueError(r"must validate the regular expression /^did:.*$/")
42
+ return value
43
+
44
+ class Config:
45
+ """Pydantic configuration"""
46
+ allow_population_by_field_name = True
47
+ validate_assignment = True
48
+
49
+ def to_str(self) -> str:
50
+ """Returns the string representation of the model using alias"""
51
+ return pprint.pformat(self.dict(by_alias=True))
52
+
53
+ def to_json(self) -> str:
54
+ """Returns the JSON representation of the model using alias"""
55
+ return json.dumps(self.to_dict())
56
+
57
+ @classmethod
58
+ def from_json(cls, json_str: str) -> SignCredentialInputDtoUnsignedCredentialParams:
59
+ """Create an instance of SignCredentialInputDtoUnsignedCredentialParams from a JSON string"""
60
+ return cls.from_dict(json.loads(json_str))
61
+
62
+ def to_dict(self):
63
+ """Returns the dictionary representation of the model using alias"""
64
+ _dict = self.dict(by_alias=True,
65
+ exclude={
66
+ },
67
+ exclude_none=True)
68
+ return _dict
69
+
70
+ @classmethod
71
+ def from_dict(cls, obj: dict) -> SignCredentialInputDtoUnsignedCredentialParams:
72
+ """Create an instance of SignCredentialInputDtoUnsignedCredentialParams from a dict"""
73
+ if obj is None:
74
+ return None
75
+
76
+ if not isinstance(obj, dict):
77
+ return SignCredentialInputDtoUnsignedCredentialParams.parse_obj(obj)
78
+
79
+ _obj = SignCredentialInputDtoUnsignedCredentialParams.parse_obj({
80
+ "json_ld_context_url": obj.get("jsonLdContextUrl"),
81
+ "json_schema_url": obj.get("jsonSchemaUrl"),
82
+ "type_name": obj.get("typeName"),
83
+ "credential_subject": obj.get("credentialSubject"),
84
+ "holder_did": obj.get("holderDid"),
85
+ "expires_at": obj.get("expiresAt")
86
+ })
87
+ return _obj
88
+
89
+
@@ -0,0 +1,76 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ CloudWalletEssentials
5
+
6
+ Cloud Wallet For Enterprise Structure
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: info@affinidi.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+
22
+
23
+ from pydantic import BaseModel, Field
24
+ from affinidi_tdk_wallets_client.models.sign_credential_result_dto_signed_credential import SignCredentialResultDtoSignedCredential
25
+
26
+ class SignCredentialResultDto(BaseModel):
27
+ """
28
+ DTO contains signed credential # noqa: E501
29
+ """
30
+ signed_credential: SignCredentialResultDtoSignedCredential = Field(..., alias="signedCredential")
31
+ __properties = ["signedCredential"]
32
+
33
+ class Config:
34
+ """Pydantic configuration"""
35
+ allow_population_by_field_name = True
36
+ validate_assignment = True
37
+
38
+ def to_str(self) -> str:
39
+ """Returns the string representation of the model using alias"""
40
+ return pprint.pformat(self.dict(by_alias=True))
41
+
42
+ def to_json(self) -> str:
43
+ """Returns the JSON representation of the model using alias"""
44
+ return json.dumps(self.to_dict())
45
+
46
+ @classmethod
47
+ def from_json(cls, json_str: str) -> SignCredentialResultDto:
48
+ """Create an instance of SignCredentialResultDto from a JSON string"""
49
+ return cls.from_dict(json.loads(json_str))
50
+
51
+ def to_dict(self):
52
+ """Returns the dictionary representation of the model using alias"""
53
+ _dict = self.dict(by_alias=True,
54
+ exclude={
55
+ },
56
+ exclude_none=True)
57
+ # override the default output from pydantic by calling `to_dict()` of signed_credential
58
+ if self.signed_credential:
59
+ _dict['signedCredential'] = self.signed_credential.to_dict()
60
+ return _dict
61
+
62
+ @classmethod
63
+ def from_dict(cls, obj: dict) -> SignCredentialResultDto:
64
+ """Create an instance of SignCredentialResultDto from a dict"""
65
+ if obj is None:
66
+ return None
67
+
68
+ if not isinstance(obj, dict):
69
+ return SignCredentialResultDto.parse_obj(obj)
70
+
71
+ _obj = SignCredentialResultDto.parse_obj({
72
+ "signed_credential": SignCredentialResultDtoSignedCredential.from_dict(obj.get("signedCredential")) if obj.get("signedCredential") is not None else None
73
+ })
74
+ return _obj
75
+
76
+