Skip to content

Commit d7b502d

Browse files
committed
update to acapy 0.7.1
Signed-off-by: Timo Glastra <timo@animo.id>
1 parent e05849b commit d7b502d

19 files changed

+438
-263
lines changed

aries_cloudcontroller/api/credential_definition.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@
3030

3131

3232
class CredentialDefinitionApi(Consumer):
33+
async def credential_definitions_cred_def_id_write_record_post(
34+
self, *, cred_def_id: str
35+
) -> CredentialDefinitionGetResult:
36+
"""Writes a credential definition non-secret record to the wallet"""
37+
return await self.__credential_definitions_cred_def_id_write_record_post(
38+
cred_def_id=cred_def_id,
39+
)
40+
3341
async def get_created_cred_defs(
3442
self,
3543
*,
@@ -70,6 +78,13 @@ async def publish_cred_def(
7078
body=body,
7179
)
7280

81+
@returns.json
82+
@post("/credential-definitions/{cred_def_id}/write_record")
83+
def __credential_definitions_cred_def_id_write_record_post(
84+
self, *, cred_def_id: str
85+
) -> CredentialDefinitionGetResult:
86+
"""Internal uplink method for credential_definitions_cred_def_id_write_record_post"""
87+
7388
@returns.json
7489
@get("/credential-definitions/created")
7590
def __get_created_cred_defs(

aries_cloudcontroller/api/issue_credential_v1_0.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
from aries_cloudcontroller.model.v10_credential_bound_offer_request import (
1919
V10CredentialBoundOfferRequest,
2020
)
21+
from aries_cloudcontroller.model.v10_credential_conn_free_offer_request import (
22+
V10CredentialConnFreeOfferRequest,
23+
)
2124
from aries_cloudcontroller.model.v10_credential_create import V10CredentialCreate
2225
from aries_cloudcontroller.model.v10_credential_exchange import V10CredentialExchange
2326
from aries_cloudcontroller.model.v10_credential_exchange_list_result import (
@@ -52,6 +55,14 @@ async def create_credential(
5255
body=body,
5356
)
5457

58+
async def create_offer(
59+
self, *, body: Optional[V10CredentialConnFreeOfferRequest] = None
60+
) -> V10CredentialExchange:
61+
"""Create a credential offer, independent of any proposal or connection"""
62+
return await self.__create_offer(
63+
body=body,
64+
)
65+
5566
async def delete_record(self, *, cred_ex_id: str) -> Dict:
5667
"""Remove an existing credential exchange record"""
5768
return await self.__delete_record(
@@ -157,6 +168,14 @@ def __create_credential(
157168
) -> V10CredentialExchange:
158169
"""Internal uplink method for create_credential"""
159170

171+
@returns.json
172+
@json
173+
@post("/issue-credential/create-offer")
174+
def __create_offer(
175+
self, *, body: Body(type=V10CredentialConnFreeOfferRequest) = {}
176+
) -> V10CredentialExchange:
177+
"""Internal uplink method for create_offer"""
178+
160179
@returns.json
161180
@delete("/issue-credential/records/{cred_ex_id}")
162181
def __delete_record(self, *, cred_ex_id: str) -> Dict:

aries_cloudcontroller/api/issue_credential_v2_0.py

Lines changed: 41 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,26 @@
1313
json,
1414
)
1515

16-
from typing import Dict, List, Optional, Union # noqa: F401
16+
from typing import Dict, List, Optional, Union # noqa: F401
1717

18-
from aries_cloudcontroller.model.v20_cred_bound_offer_request import (
19-
V20CredBoundOfferRequest,
20-
)
18+
from aries_cloudcontroller.model.v20_cred_bound_offer_request import V20CredBoundOfferRequest
19+
from aries_cloudcontroller.model.v20_cred_ex_free import V20CredExFree
2120
from aries_cloudcontroller.model.v20_cred_ex_record import V20CredExRecord
2221
from aries_cloudcontroller.model.v20_cred_ex_record_detail import V20CredExRecordDetail
23-
from aries_cloudcontroller.model.v20_cred_ex_record_list_result import (
24-
V20CredExRecordListResult,
25-
)
26-
from aries_cloudcontroller.model.v20_cred_issue_problem_report_request import (
27-
V20CredIssueProblemReportRequest,
28-
)
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
2924
from aries_cloudcontroller.model.v20_cred_issue_request import V20CredIssueRequest
25+
from aries_cloudcontroller.model.v20_cred_offer_conn_free_request import V20CredOfferConnFreeRequest
3026
from aries_cloudcontroller.model.v20_cred_offer_request import V20CredOfferRequest
3127
from aries_cloudcontroller.model.v20_cred_request_free import V20CredRequestFree
3228
from aries_cloudcontroller.model.v20_cred_request_request import V20CredRequestRequest
3329
from aries_cloudcontroller.model.v20_cred_send_request import V20CredSendRequest
3430
from aries_cloudcontroller.model.v20_cred_store_request import V20CredStoreRequest
35-
from aries_cloudcontroller.model.v20_issue_cred_schema_core import (
36-
V20IssueCredSchemaCore,
37-
)
3831

3932

4033
class IssueCredentialV20Api(Consumer):
41-
async def create_credential(
42-
self, *, body: Optional[V20IssueCredSchemaCore] = None
43-
) -> V20CredExRecord:
34+
35+
async def create_credential(self, *, body: Optional[] = None) -> V20CredExRecord:
4436
"""Create credential from attribute values"""
4537
return await self.__create_credential(
4638
body=body,
@@ -58,14 +50,7 @@ async def get_record(self, *, cred_ex_id: str) -> V20CredExRecordDetail:
5850
cred_ex_id=cred_ex_id,
5951
)
6052

61-
async def get_records(
62-
self,
63-
*,
64-
connection_id: Optional[str] = None,
65-
role: Optional[str] = None,
66-
state: Optional[str] = None,
67-
thread_id: Optional[str] = None
68-
) -> V20CredExRecordListResult:
53+
async def get_records(self, *, connection_id: Optional[str] = None, role: Optional[str] = None, state: Optional[str] = None, thread_id: Optional[str] = None) -> V20CredExRecordListResult:
6954
"""Fetch all credential exchange records"""
7055
return await self.__get_records(
7156
connection_id=connection_id,
@@ -74,80 +59,65 @@ async def get_records(
7459
thread_id=thread_id,
7560
)
7661

77-
async def issue_credential(
78-
self, *, cred_ex_id: str, body: Optional[V20CredIssueRequest] = None
79-
) -> V20CredExRecordDetail:
62+
async def issue_credential(self, *, cred_ex_id: str, body: Optional[V20CredIssueRequest] = None) -> V20CredExRecordDetail:
8063
"""Send holder a credential"""
8164
return await self.__issue_credential(
8265
cred_ex_id=cred_ex_id,
8366
body=body,
8467
)
8568

86-
async def issue_credential_automated(
87-
self, *, body: Optional[V20CredSendRequest] = None
88-
) -> V20CredExRecord:
69+
async def issue_credential20_create_offer_post(self, *, body: Optional[V20CredOfferConnFreeRequest] = None) -> V20CredExRecord:
70+
"""Create a credential offer, independent of any proposal or connection"""
71+
return await self.__issue_credential20_create_offer_post(
72+
body=body,
73+
)
74+
75+
async def issue_credential_automated(self, *, body: Optional[V20CredExFree] = None) -> V20CredExRecord:
8976
"""Send holder a credential, automating entire flow"""
9077
return await self.__issue_credential_automated(
9178
body=body,
9279
)
9380

94-
async def report_problem(
95-
self,
96-
*,
97-
cred_ex_id: str,
98-
body: Optional[V20CredIssueProblemReportRequest] = None
99-
) -> Dict:
81+
async def report_problem(self, *, cred_ex_id: str, body: Optional[V20CredIssueProblemReportRequest] = None) -> Dict:
10082
"""Send a problem report for credential exchange"""
10183
return await self.__report_problem(
10284
cred_ex_id=cred_ex_id,
10385
body=body,
10486
)
10587

106-
async def send_offer(
107-
self, *, cred_ex_id: str, body: Optional[V20CredBoundOfferRequest] = None
108-
) -> V20CredExRecord:
88+
async def send_offer(self, *, cred_ex_id: str, body: Optional[V20CredBoundOfferRequest] = None) -> V20CredExRecord:
10989
"""Send holder a credential offer in reference to a proposal with preview"""
11090
return await self.__send_offer(
11191
cred_ex_id=cred_ex_id,
11292
body=body,
11393
)
11494

115-
async def send_offer_free(
116-
self, *, body: Optional[V20CredOfferRequest] = None
117-
) -> V20CredExRecord:
95+
async def send_offer_free(self, *, body: Optional[V20CredOfferRequest] = None) -> V20CredExRecord:
11896
"""Send holder a credential offer, independent of any proposal"""
11997
return await self.__send_offer_free(
12098
body=body,
12199
)
122100

123-
async def send_proposal(
124-
self, *, body: Optional[V20CredSendRequest] = None
125-
) -> V20CredExRecord:
101+
async def send_proposal(self, *, body: Optional[V20CredExFree] = None) -> V20CredExRecord:
126102
"""Send issuer a credential proposal"""
127103
return await self.__send_proposal(
128104
body=body,
129105
)
130106

131-
async def send_request(
132-
self, *, cred_ex_id: str, body: Optional[V20CredRequestRequest] = None
133-
) -> V20CredExRecord:
107+
async def send_request(self, *, cred_ex_id: str, body: Optional[V20CredRequestRequest] = None) -> V20CredExRecord:
134108
"""Send issuer a credential request"""
135109
return await self.__send_request(
136110
cred_ex_id=cred_ex_id,
137111
body=body,
138112
)
139113

140-
async def send_request_free(
141-
self, *, body: Optional[V20CredRequestFree] = None
142-
) -> V20CredExRecord:
114+
async def send_request_free(self, *, body: Optional[V20CredRequestFree] = None) -> V20CredExRecord:
143115
"""Send issuer a credential request not bound to an existing thread. Indy credentials cannot start at a request"""
144116
return await self.__send_request_free(
145117
body=body,
146118
)
147119

148-
async def store_credential(
149-
self, *, cred_ex_id: str, body: Optional[V20CredStoreRequest] = None
150-
) -> V20CredExRecordDetail:
120+
async def store_credential(self, *, cred_ex_id: str, body: Optional[V20CredStoreRequest] = None) -> V20CredExRecordDetail:
151121
"""Store a received credential"""
152122
return await self.__store_credential(
153123
cred_ex_id=cred_ex_id,
@@ -157,9 +127,7 @@ async def store_credential(
157127
@returns.json
158128
@json
159129
@post("/issue-credential-2.0/create")
160-
def __create_credential(
161-
self, *, body: Body(type=V20IssueCredSchemaCore) = {}
162-
) -> V20CredExRecord:
130+
def __create_credential(self, *, body: Body(type=) = {}) -> V20CredExRecord:
163131
"""Internal uplink method for create_credential"""
164132

165133
@returns.json
@@ -174,84 +142,65 @@ def __get_record(self, *, cred_ex_id: str) -> V20CredExRecordDetail:
174142

175143
@returns.json
176144
@get("/issue-credential-2.0/records")
177-
def __get_records(
178-
self,
179-
*,
180-
connection_id: Query = None,
181-
role: Query = None,
182-
state: Query = None,
183-
thread_id: Query = None
184-
) -> V20CredExRecordListResult:
145+
def __get_records(self, *, connection_id: Query = None, role: Query = None, state: Query = None, thread_id: Query = None) -> V20CredExRecordListResult:
185146
"""Internal uplink method for get_records"""
186147

187148
@returns.json
188149
@json
189150
@post("/issue-credential-2.0/records/{cred_ex_id}/issue")
190-
def __issue_credential(
191-
self, *, cred_ex_id: str, body: Body(type=V20CredIssueRequest) = {}
192-
) -> V20CredExRecordDetail:
151+
def __issue_credential(self, *, cred_ex_id: str, body: Body(type=V20CredIssueRequest) = {}) -> V20CredExRecordDetail:
193152
"""Internal uplink method for issue_credential"""
194153

154+
@returns.json
155+
@json
156+
@post("/issue-credential-2.0/create-offer")
157+
def __issue_credential20_create_offer_post(self, *, body: Body(type=V20CredOfferConnFreeRequest) = {}) -> V20CredExRecord:
158+
"""Internal uplink method for issue_credential20_create_offer_post"""
159+
195160
@returns.json
196161
@json
197162
@post("/issue-credential-2.0/send")
198-
def __issue_credential_automated(
199-
self, *, body: Body(type=V20CredSendRequest) = {}
200-
) -> V20CredExRecord:
163+
def __issue_credential_automated(self, *, body: Body(type=V20CredExFree) = {}) -> V20CredExRecord:
201164
"""Internal uplink method for issue_credential_automated"""
202165

203166
@returns.json
204167
@json
205168
@post("/issue-credential-2.0/records/{cred_ex_id}/problem-report")
206-
def __report_problem(
207-
self, *, cred_ex_id: str, body: Body(type=V20CredIssueProblemReportRequest) = {}
208-
) -> Dict:
169+
def __report_problem(self, *, cred_ex_id: str, body: Body(type=V20CredIssueProblemReportRequest) = {}) -> Dict:
209170
"""Internal uplink method for report_problem"""
210171

211172
@returns.json
212173
@json
213174
@post("/issue-credential-2.0/records/{cred_ex_id}/send-offer")
214-
def __send_offer(
215-
self, *, cred_ex_id: str, body: Body(type=V20CredBoundOfferRequest) = {}
216-
) -> V20CredExRecord:
175+
def __send_offer(self, *, cred_ex_id: str, body: Body(type=V20CredBoundOfferRequest) = {}) -> V20CredExRecord:
217176
"""Internal uplink method for send_offer"""
218177

219178
@returns.json
220179
@json
221180
@post("/issue-credential-2.0/send-offer")
222-
def __send_offer_free(
223-
self, *, body: Body(type=V20CredOfferRequest) = {}
224-
) -> V20CredExRecord:
181+
def __send_offer_free(self, *, body: Body(type=V20CredOfferRequest) = {}) -> V20CredExRecord:
225182
"""Internal uplink method for send_offer_free"""
226183

227184
@returns.json
228185
@json
229186
@post("/issue-credential-2.0/send-proposal")
230-
def __send_proposal(
231-
self, *, body: Body(type=V20CredSendRequest) = {}
232-
) -> V20CredExRecord:
187+
def __send_proposal(self, *, body: Body(type=V20CredExFree) = {}) -> V20CredExRecord:
233188
"""Internal uplink method for send_proposal"""
234189

235190
@returns.json
236191
@json
237192
@post("/issue-credential-2.0/records/{cred_ex_id}/send-request")
238-
def __send_request(
239-
self, *, cred_ex_id: str, body: Body(type=V20CredRequestRequest) = {}
240-
) -> V20CredExRecord:
193+
def __send_request(self, *, cred_ex_id: str, body: Body(type=V20CredRequestRequest) = {}) -> V20CredExRecord:
241194
"""Internal uplink method for send_request"""
242195

243196
@returns.json
244197
@json
245198
@post("/issue-credential-2.0/send-request")
246-
def __send_request_free(
247-
self, *, body: Body(type=V20CredRequestFree) = {}
248-
) -> V20CredExRecord:
199+
def __send_request_free(self, *, body: Body(type=V20CredRequestFree) = {}) -> V20CredExRecord:
249200
"""Internal uplink method for send_request_free"""
250201

251202
@returns.json
252203
@json
253204
@post("/issue-credential-2.0/records/{cred_ex_id}/store")
254-
def __store_credential(
255-
self, *, cred_ex_id: str, body: Body(type=V20CredStoreRequest) = {}
256-
) -> V20CredExRecordDetail:
205+
def __store_credential(self, *, cred_ex_id: str, body: Body(type=V20CredStoreRequest) = {}) -> V20CredExRecordDetail:
257206
"""Internal uplink method for store_credential"""

aries_cloudcontroller/api/schema.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ async def publish_schema(
5858
body=body,
5959
)
6060

61+
async def write_record(self, *, schema_id: str) -> SchemaGetResult:
62+
"""Writes a schema non-secret record to the wallet"""
63+
return await self.__write_record(
64+
schema_id=schema_id,
65+
)
66+
6167
@returns.json
6268
@get("/schemas/created")
6369
def __get_created_schemas(
@@ -86,3 +92,8 @@ def __publish_schema(
8692
body: Body(type=SchemaSendRequest) = {}
8793
) -> SchemaSendResult:
8894
"""Internal uplink method for publish_schema"""
95+
96+
@returns.json
97+
@post("/schemas/{schema_id}/write_record")
98+
def __write_record(self, *, schema_id: str) -> SchemaGetResult:
99+
"""Internal uplink method for write_record"""

0 commit comments

Comments
 (0)