13
13
json ,
14
14
)
15
15
16
- from typing import Dict , List , Optional , Union # noqa: F401
16
+ from typing import Dict , List , Optional , Union # noqa: F401
17
17
18
- from aries_cloudcontroller .model .v20_cred_bound_offer_request import V20CredBoundOfferRequest
18
+ from aries_cloudcontroller .model .v20_cred_bound_offer_request import (
19
+ V20CredBoundOfferRequest ,
20
+ )
19
21
from aries_cloudcontroller .model .v20_cred_ex_free import V20CredExFree
20
22
from aries_cloudcontroller .model .v20_cred_ex_record import V20CredExRecord
21
23
from aries_cloudcontroller .model .v20_cred_ex_record_detail import V20CredExRecordDetail
22
- from aries_cloudcontroller .model .v20_cred_ex_record_list_result import V20CredExRecordListResult
23
- from aries_cloudcontroller .model .v20_cred_issue_problem_report_request import V20CredIssueProblemReportRequest
24
+ from aries_cloudcontroller .model .v20_cred_ex_record_list_result import (
25
+ V20CredExRecordListResult ,
26
+ )
27
+ from aries_cloudcontroller .model .v20_cred_issue_problem_report_request import (
28
+ V20CredIssueProblemReportRequest ,
29
+ )
24
30
from aries_cloudcontroller .model .v20_cred_issue_request import V20CredIssueRequest
25
- from aries_cloudcontroller .model .v20_cred_offer_conn_free_request import V20CredOfferConnFreeRequest
31
+ from aries_cloudcontroller .model .v20_cred_offer_conn_free_request import (
32
+ V20CredOfferConnFreeRequest ,
33
+ )
26
34
from aries_cloudcontroller .model .v20_cred_offer_request import V20CredOfferRequest
27
35
from aries_cloudcontroller .model .v20_cred_request_free import V20CredRequestFree
28
36
from aries_cloudcontroller .model .v20_cred_request_request import V20CredRequestRequest
29
37
from aries_cloudcontroller .model .v20_cred_store_request import V20CredStoreRequest
38
+ from aries_cloudcontroller .model .v20_issue_cred_schema_core import (
39
+ V20IssueCredSchemaCore ,
40
+ )
30
41
31
42
32
43
class IssueCredentialV20Api (Consumer ):
33
-
34
- async def create_credential (self , * , body : Optional [dict ] = None ) -> V20CredExRecord :
44
+ async def create_credential (
45
+ self , * , body : Optional [V20IssueCredSchemaCore ] = None
46
+ ) -> V20CredExRecord :
35
47
"""Create credential from attribute values"""
36
48
return await self .__create_credential (
37
49
body = body ,
@@ -49,7 +61,14 @@ async def get_record(self, *, cred_ex_id: str) -> V20CredExRecordDetail:
49
61
cred_ex_id = cred_ex_id ,
50
62
)
51
63
52
- async def get_records (self , * , connection_id : Optional [str ] = None , role : Optional [str ] = None , state : Optional [str ] = None , thread_id : Optional [str ] = None ) -> V20CredExRecordListResult :
64
+ async def get_records (
65
+ self ,
66
+ * ,
67
+ connection_id : Optional [str ] = None ,
68
+ role : Optional [str ] = None ,
69
+ state : Optional [str ] = None ,
70
+ thread_id : Optional [str ] = None
71
+ ) -> V20CredExRecordListResult :
53
72
"""Fetch all credential exchange records"""
54
73
return await self .__get_records (
55
74
connection_id = connection_id ,
@@ -58,65 +77,88 @@ async def get_records(self, *, connection_id: Optional[str] = None, role: Option
58
77
thread_id = thread_id ,
59
78
)
60
79
61
- async def issue_credential (self , * , cred_ex_id : str , body : Optional [V20CredIssueRequest ] = None ) -> V20CredExRecordDetail :
80
+ async def issue_credential (
81
+ self , * , cred_ex_id : str , body : Optional [V20CredIssueRequest ] = None
82
+ ) -> V20CredExRecordDetail :
62
83
"""Send holder a credential"""
63
84
return await self .__issue_credential (
64
85
cred_ex_id = cred_ex_id ,
65
86
body = body ,
66
87
)
67
88
68
- async def issue_credential20_create_offer_post (self , * , body : Optional [V20CredOfferConnFreeRequest ] = None ) -> V20CredExRecord :
89
+ async def issue_credential20_create_offer_post (
90
+ self , * , body : Optional [V20CredOfferConnFreeRequest ] = None
91
+ ) -> V20CredExRecord :
69
92
"""Create a credential offer, independent of any proposal or connection"""
70
93
return await self .__issue_credential20_create_offer_post (
71
94
body = body ,
72
95
)
73
96
74
- async def issue_credential_automated (self , * , body : Optional [V20CredExFree ] = None ) -> V20CredExRecord :
97
+ async def issue_credential_automated (
98
+ self , * , body : Optional [V20CredExFree ] = None
99
+ ) -> V20CredExRecord :
75
100
"""Send holder a credential, automating entire flow"""
76
101
return await self .__issue_credential_automated (
77
102
body = body ,
78
103
)
79
104
80
- async def report_problem (self , * , cred_ex_id : str , body : Optional [V20CredIssueProblemReportRequest ] = None ) -> Dict :
105
+ async def report_problem (
106
+ self ,
107
+ * ,
108
+ cred_ex_id : str ,
109
+ body : Optional [V20CredIssueProblemReportRequest ] = None
110
+ ) -> Dict :
81
111
"""Send a problem report for credential exchange"""
82
112
return await self .__report_problem (
83
113
cred_ex_id = cred_ex_id ,
84
114
body = body ,
85
115
)
86
116
87
- async def send_offer (self , * , cred_ex_id : str , body : Optional [V20CredBoundOfferRequest ] = None ) -> V20CredExRecord :
117
+ async def send_offer (
118
+ self , * , cred_ex_id : str , body : Optional [V20CredBoundOfferRequest ] = None
119
+ ) -> V20CredExRecord :
88
120
"""Send holder a credential offer in reference to a proposal with preview"""
89
121
return await self .__send_offer (
90
122
cred_ex_id = cred_ex_id ,
91
123
body = body ,
92
124
)
93
125
94
- async def send_offer_free (self , * , body : Optional [V20CredOfferRequest ] = None ) -> V20CredExRecord :
126
+ async def send_offer_free (
127
+ self , * , body : Optional [V20CredOfferRequest ] = None
128
+ ) -> V20CredExRecord :
95
129
"""Send holder a credential offer, independent of any proposal"""
96
130
return await self .__send_offer_free (
97
131
body = body ,
98
132
)
99
133
100
- async def send_proposal (self , * , body : Optional [V20CredExFree ] = None ) -> V20CredExRecord :
134
+ async def send_proposal (
135
+ self , * , body : Optional [V20CredExFree ] = None
136
+ ) -> V20CredExRecord :
101
137
"""Send issuer a credential proposal"""
102
138
return await self .__send_proposal (
103
139
body = body ,
104
140
)
105
141
106
- async def send_request (self , * , cred_ex_id : str , body : Optional [V20CredRequestRequest ] = None ) -> V20CredExRecord :
142
+ async def send_request (
143
+ self , * , cred_ex_id : str , body : Optional [V20CredRequestRequest ] = None
144
+ ) -> V20CredExRecord :
107
145
"""Send issuer a credential request"""
108
146
return await self .__send_request (
109
147
cred_ex_id = cred_ex_id ,
110
148
body = body ,
111
149
)
112
150
113
- async def send_request_free (self , * , body : Optional [V20CredRequestFree ] = None ) -> V20CredExRecord :
151
+ async def send_request_free (
152
+ self , * , body : Optional [V20CredRequestFree ] = None
153
+ ) -> V20CredExRecord :
114
154
"""Send issuer a credential request not bound to an existing thread. Indy credentials cannot start at a request"""
115
155
return await self .__send_request_free (
116
156
body = body ,
117
157
)
118
158
119
- async def store_credential (self , * , cred_ex_id : str , body : Optional [V20CredStoreRequest ] = None ) -> V20CredExRecordDetail :
159
+ async def store_credential (
160
+ self , * , cred_ex_id : str , body : Optional [V20CredStoreRequest ] = None
161
+ ) -> V20CredExRecordDetail :
120
162
"""Store a received credential"""
121
163
return await self .__store_credential (
122
164
cred_ex_id = cred_ex_id ,
@@ -126,7 +168,9 @@ async def store_credential(self, *, cred_ex_id: str, body: Optional[V20CredStore
126
168
@returns .json
127
169
@json
128
170
@post ("/issue-credential-2.0/create" )
129
- def __create_credential (self , * , body : Body = {}) -> V20CredExRecord :
171
+ def __create_credential (
172
+ self , * , body : Body (type = V20IssueCredSchemaCore ) = {}
173
+ ) -> V20CredExRecord :
130
174
"""Internal uplink method for create_credential"""
131
175
132
176
@returns .json
@@ -141,65 +185,92 @@ def __get_record(self, *, cred_ex_id: str) -> V20CredExRecordDetail:
141
185
142
186
@returns .json
143
187
@get ("/issue-credential-2.0/records" )
144
- def __get_records (self , * , connection_id : Query = None , role : Query = None , state : Query = None , thread_id : Query = None ) -> V20CredExRecordListResult :
188
+ def __get_records (
189
+ self ,
190
+ * ,
191
+ connection_id : Query = None ,
192
+ role : Query = None ,
193
+ state : Query = None ,
194
+ thread_id : Query = None
195
+ ) -> V20CredExRecordListResult :
145
196
"""Internal uplink method for get_records"""
146
197
147
198
@returns .json
148
199
@json
149
200
@post ("/issue-credential-2.0/records/{cred_ex_id}/issue" )
150
- def __issue_credential (self , * , cred_ex_id : str , body : Body (type = V20CredIssueRequest ) = {}) -> V20CredExRecordDetail :
201
+ def __issue_credential (
202
+ self , * , cred_ex_id : str , body : Body (type = V20CredIssueRequest ) = {}
203
+ ) -> V20CredExRecordDetail :
151
204
"""Internal uplink method for issue_credential"""
152
205
153
206
@returns .json
154
207
@json
155
208
@post ("/issue-credential-2.0/create-offer" )
156
- def __issue_credential20_create_offer_post (self , * , body : Body (type = V20CredOfferConnFreeRequest ) = {}) -> V20CredExRecord :
209
+ def __issue_credential20_create_offer_post (
210
+ self , * , body : Body (type = V20CredOfferConnFreeRequest ) = {}
211
+ ) -> V20CredExRecord :
157
212
"""Internal uplink method for issue_credential20_create_offer_post"""
158
213
159
214
@returns .json
160
215
@json
161
216
@post ("/issue-credential-2.0/send" )
162
- def __issue_credential_automated (self , * , body : Body (type = V20CredExFree ) = {}) -> V20CredExRecord :
217
+ def __issue_credential_automated (
218
+ self , * , body : Body (type = V20CredExFree ) = {}
219
+ ) -> V20CredExRecord :
163
220
"""Internal uplink method for issue_credential_automated"""
164
221
165
222
@returns .json
166
223
@json
167
224
@post ("/issue-credential-2.0/records/{cred_ex_id}/problem-report" )
168
- def __report_problem (self , * , cred_ex_id : str , body : Body (type = V20CredIssueProblemReportRequest ) = {}) -> Dict :
225
+ def __report_problem (
226
+ self , * , cred_ex_id : str , body : Body (type = V20CredIssueProblemReportRequest ) = {}
227
+ ) -> Dict :
169
228
"""Internal uplink method for report_problem"""
170
229
171
230
@returns .json
172
231
@json
173
232
@post ("/issue-credential-2.0/records/{cred_ex_id}/send-offer" )
174
- def __send_offer (self , * , cred_ex_id : str , body : Body (type = V20CredBoundOfferRequest ) = {}) -> V20CredExRecord :
233
+ def __send_offer (
234
+ self , * , cred_ex_id : str , body : Body (type = V20CredBoundOfferRequest ) = {}
235
+ ) -> V20CredExRecord :
175
236
"""Internal uplink method for send_offer"""
176
237
177
238
@returns .json
178
239
@json
179
240
@post ("/issue-credential-2.0/send-offer" )
180
- def __send_offer_free (self , * , body : Body (type = V20CredOfferRequest ) = {}) -> V20CredExRecord :
241
+ def __send_offer_free (
242
+ self , * , body : Body (type = V20CredOfferRequest ) = {}
243
+ ) -> V20CredExRecord :
181
244
"""Internal uplink method for send_offer_free"""
182
245
183
246
@returns .json
184
247
@json
185
248
@post ("/issue-credential-2.0/send-proposal" )
186
- def __send_proposal (self , * , body : Body (type = V20CredExFree ) = {}) -> V20CredExRecord :
249
+ def __send_proposal (
250
+ self , * , body : Body (type = V20CredExFree ) = {}
251
+ ) -> V20CredExRecord :
187
252
"""Internal uplink method for send_proposal"""
188
253
189
254
@returns .json
190
255
@json
191
256
@post ("/issue-credential-2.0/records/{cred_ex_id}/send-request" )
192
- def __send_request (self , * , cred_ex_id : str , body : Body (type = V20CredRequestRequest ) = {}) -> V20CredExRecord :
257
+ def __send_request (
258
+ self , * , cred_ex_id : str , body : Body (type = V20CredRequestRequest ) = {}
259
+ ) -> V20CredExRecord :
193
260
"""Internal uplink method for send_request"""
194
261
195
262
@returns .json
196
263
@json
197
264
@post ("/issue-credential-2.0/send-request" )
198
- def __send_request_free (self , * , body : Body (type = V20CredRequestFree ) = {}) -> V20CredExRecord :
265
+ def __send_request_free (
266
+ self , * , body : Body (type = V20CredRequestFree ) = {}
267
+ ) -> V20CredExRecord :
199
268
"""Internal uplink method for send_request_free"""
200
269
201
270
@returns .json
202
271
@json
203
272
@post ("/issue-credential-2.0/records/{cred_ex_id}/store" )
204
- def __store_credential (self , * , cred_ex_id : str , body : Body (type = V20CredStoreRequest ) = {}) -> V20CredExRecordDetail :
273
+ def __store_credential (
274
+ self , * , cred_ex_id : str , body : Body (type = V20CredStoreRequest ) = {}
275
+ ) -> V20CredExRecordDetail :
205
276
"""Internal uplink method for store_credential"""
0 commit comments