Skip to content

Commit 149ccb3

Browse files
committed
update version to 0.3.0a6
Signed-off-by: Timo Glastra <timo@animo.id>
1 parent 759b3a7 commit 149ccb3

26 files changed

+1726
-339
lines changed

aries_cloudcontroller/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
from aries_cloudcontroller.acapy_client import (
2-
AcaPyClient
3-
)
1+
from aries_cloudcontroller.acapy_client import AcaPyClient
42

53
from aries_cloudcontroller.api import (
64
ActionMenuApi,
@@ -548,4 +546,4 @@
548546
"ServerApi",
549547
"TrustpingApi",
550548
"WalletApi",
551-
]
549+
]

aries_cloudcontroller/api/action_menu.py

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,73 @@
1414
json,
1515
)
1616

17-
from typing import Dict, List # noqa: F401
17+
from typing import Dict, List, Optional # noqa: F401
1818

1919
from aries_cloudcontroller.model.action_menu_fetch_result import ActionMenuFetchResult
2020
from aries_cloudcontroller.model.perform_request import PerformRequest
2121
from aries_cloudcontroller.model.send_menu import SendMenu
2222

2323

2424
class ActionMenuApi(Consumer):
25+
async def close_active_menu(self, *, conn_id: str) -> Dict:
26+
"""Close the active menu associated with a connection"""
27+
return await self.__close_active_menu(
28+
conn_id=conn_id,
29+
)
30+
31+
async def fetch_active_menu(self, *, conn_id: str) -> ActionMenuFetchResult:
32+
"""Fetch the active menu"""
33+
return await self.__fetch_active_menu(
34+
conn_id=conn_id,
35+
)
36+
37+
async def perform_action(
38+
self, *, conn_id: str, body: Optional[PerformRequest] = None
39+
) -> Dict:
40+
"""Perform an action associated with the active menu"""
41+
return await self.__perform_action(
42+
conn_id=conn_id,
43+
body=body,
44+
)
45+
46+
async def request_active_menu(self, *, conn_id: str) -> Dict:
47+
"""Request the active menu"""
48+
return await self.__request_active_menu(
49+
conn_id=conn_id,
50+
)
51+
52+
async def send_menu(self, *, conn_id: str, body: Optional[SendMenu] = None) -> Dict:
53+
"""Send an action menu to a connection"""
54+
return await self.__send_menu(
55+
conn_id=conn_id,
56+
body=body,
57+
)
58+
2559
@returns.json
2660
@post("/action-menu/{conn_id}/close")
27-
def close_active_menu(self, *, conn_id: str) -> Dict:
28-
"""Close the active menu associated with a connection"""
61+
def __close_active_menu(self, *, conn_id: str) -> Dict:
62+
"""Internal uplink method for close_active_menu"""
2963

3064
@returns.json
3165
@post("/action-menu/{conn_id}/fetch")
32-
def fetch_active_menu(self, *, conn_id: str) -> ActionMenuFetchResult:
33-
"""Fetch the active menu"""
66+
def __fetch_active_menu(self, *, conn_id: str) -> ActionMenuFetchResult:
67+
"""Internal uplink method for fetch_active_menu"""
3468

3569
@returns.json
3670
@json
3771
@post("/action-menu/{conn_id}/perform")
38-
def perform_action(
72+
def __perform_action(
3973
self, *, conn_id: str, body: Body(type=PerformRequest) = {}
4074
) -> Dict:
41-
"""Perform an action associated with the active menu"""
75+
"""Internal uplink method for perform_action"""
4276

4377
@returns.json
4478
@post("/action-menu/{conn_id}/request")
45-
def request_active_menu(self, *, conn_id: str) -> Dict:
46-
"""Request the active menu"""
79+
def __request_active_menu(self, *, conn_id: str) -> Dict:
80+
"""Internal uplink method for request_active_menu"""
4781

4882
@returns.json
4983
@json
5084
@post("/action-menu/{conn_id}/send-menu")
51-
def send_menu(self, *, conn_id: str, body: Body(type=SendMenu) = {}) -> Dict:
52-
"""Send an action menu to a connection"""
85+
def __send_menu(self, *, conn_id: str, body: Body(type=SendMenu) = {}) -> Dict:
86+
"""Internal uplink method for send_menu"""

aries_cloudcontroller/api/basicmessage.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,25 @@
1414
json,
1515
)
1616

17-
from typing import Dict, List # noqa: F401
17+
from typing import Dict, List, Optional # noqa: F401
1818

1919
from aries_cloudcontroller.model.send_message import SendMessage
2020

2121

2222
class BasicmessageApi(Consumer):
23+
async def send_message(
24+
self, *, conn_id: str, body: Optional[SendMessage] = None
25+
) -> Dict:
26+
"""Send a basic message to a connection"""
27+
return await self.__send_message(
28+
conn_id=conn_id,
29+
body=body,
30+
)
31+
2332
@returns.json
2433
@json
2534
@post("/connections/{conn_id}/send-message")
26-
def send_message(self, *, conn_id: str, body: Body(type=SendMessage) = {}) -> Dict:
27-
"""Send a basic message to a connection"""
35+
def __send_message(
36+
self, *, conn_id: str, body: Body(type=SendMessage) = {}
37+
) -> Dict:
38+
"""Internal uplink method for send_message"""

aries_cloudcontroller/api/connection.py

Lines changed: 159 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
json,
1515
)
1616

17-
from typing import Dict, List # noqa: F401
17+
from typing import Dict, List, Optional # noqa: F401
1818

1919
from aries_cloudcontroller.model.conn_record import ConnRecord
2020
from aries_cloudcontroller.model.connection_list import ConnectionList
@@ -37,27 +37,161 @@
3737

3838

3939
class ConnectionApi(Consumer):
40+
async def accept_invitation(
41+
self,
42+
*,
43+
conn_id: str,
44+
mediation_id: Optional[str] = None,
45+
my_endpoint: Optional[str] = None,
46+
my_label: Optional[str] = None
47+
) -> ConnRecord:
48+
"""Accept a stored connection invitation"""
49+
return await self.__accept_invitation(
50+
conn_id=conn_id,
51+
mediation_id=mediation_id,
52+
my_endpoint=my_endpoint,
53+
my_label=my_label,
54+
)
55+
56+
async def accept_request(
57+
self, *, conn_id: str, my_endpoint: Optional[str] = None
58+
) -> ConnRecord:
59+
"""Accept a stored connection request"""
60+
return await self.__accept_request(
61+
conn_id=conn_id,
62+
my_endpoint=my_endpoint,
63+
)
64+
65+
async def create_invitation(
66+
self,
67+
*,
68+
alias: Optional[str] = None,
69+
auto_accept: Optional[bool] = None,
70+
multi_use: Optional[bool] = None,
71+
public: Optional[bool] = None,
72+
body: Optional[CreateInvitationRequest] = None
73+
) -> InvitationResult:
74+
"""Create a new connection invitation"""
75+
return await self.__create_invitation(
76+
alias=alias,
77+
auto_accept=auto_accept,
78+
multi_use=multi_use,
79+
public=public,
80+
body=body,
81+
)
82+
83+
async def create_static_connection(
84+
self, *, body: Optional[ConnectionStaticRequest] = None
85+
) -> ConnectionStaticResult:
86+
"""Create a new static connection"""
87+
return await self.__create_static_connection(
88+
body=body,
89+
)
90+
91+
async def delete_connection(self, *, conn_id: str) -> Dict:
92+
"""Remove an existing connection record"""
93+
return await self.__delete_connection(
94+
conn_id=conn_id,
95+
)
96+
97+
async def establish_inbound(self, *, conn_id: str, ref_id: str) -> Dict:
98+
"""Assign another connection as the inbound connection"""
99+
return await self.__establish_inbound(
100+
conn_id=conn_id,
101+
ref_id=ref_id,
102+
)
103+
104+
async def get_connection(self, *, conn_id: str) -> ConnRecord:
105+
"""Fetch a single connection record"""
106+
return await self.__get_connection(
107+
conn_id=conn_id,
108+
)
109+
110+
async def get_connection_endpoint(self, *, conn_id: str) -> EndpointsResult:
111+
"""Fetch connection remote endpoint"""
112+
return await self.__get_connection_endpoint(
113+
conn_id=conn_id,
114+
)
115+
116+
async def get_connections(
117+
self,
118+
*,
119+
alias: Optional[str] = None,
120+
connection_protocol: Optional[str] = None,
121+
invitation_key: Optional[str] = None,
122+
my_did: Optional[str] = None,
123+
state: Optional[str] = None,
124+
their_did: Optional[str] = None,
125+
their_role: Optional[str] = None
126+
) -> ConnectionList:
127+
"""Query agent-to-agent connections"""
128+
return await self.__get_connections(
129+
alias=alias,
130+
connection_protocol=connection_protocol,
131+
invitation_key=invitation_key,
132+
my_did=my_did,
133+
state=state,
134+
their_did=their_did,
135+
their_role=their_role,
136+
)
137+
138+
async def get_metadata(
139+
self, *, conn_id: str, key: Optional[str] = None
140+
) -> ConnectionMetadata:
141+
"""Fetch connection metadata"""
142+
return await self.__get_metadata(
143+
conn_id=conn_id,
144+
key=key,
145+
)
146+
147+
async def receive_invitation(
148+
self,
149+
*,
150+
alias: Optional[str] = None,
151+
auto_accept: Optional[bool] = None,
152+
mediation_id: Optional[str] = None,
153+
body: Optional[ReceiveInvitationRequest] = None
154+
) -> ConnRecord:
155+
"""Receive a new connection invitation"""
156+
return await self.__receive_invitation(
157+
alias=alias,
158+
auto_accept=auto_accept,
159+
mediation_id=mediation_id,
160+
body=body,
161+
)
162+
163+
async def set_metadata(
164+
self, *, conn_id: str, body: Optional[ConnectionMetadataSetRequest] = None
165+
) -> ConnectionMetadata:
166+
"""Set connection metadata"""
167+
return await self.__set_metadata(
168+
conn_id=conn_id,
169+
body=body,
170+
)
171+
40172
@returns.json
41173
@post("/connections/{conn_id}/accept-invitation")
42-
def accept_invitation(
174+
def __accept_invitation(
43175
self,
44176
*,
45177
conn_id: str,
46178
mediation_id: Query = None,
47179
my_endpoint: Query = None,
48180
my_label: Query = None
49181
) -> ConnRecord:
50-
"""Accept a stored connection invitation"""
182+
"""Internal uplink method for accept_invitation"""
51183

52184
@returns.json
53185
@post("/connections/{conn_id}/accept-request")
54-
def accept_request(self, *, conn_id: str, my_endpoint: Query = None) -> ConnRecord:
55-
"""Accept a stored connection request"""
186+
def __accept_request(
187+
self, *, conn_id: str, my_endpoint: Query = None
188+
) -> ConnRecord:
189+
"""Internal uplink method for accept_request"""
56190

57191
@returns.json
58192
@json
59193
@post("/connections/create-invitation")
60-
def create_invitation(
194+
def __create_invitation(
61195
self,
62196
*,
63197
alias: Query = None,
@@ -66,39 +200,39 @@ def create_invitation(
66200
public: Query = None,
67201
body: Body(type=CreateInvitationRequest) = {}
68202
) -> InvitationResult:
69-
"""Create a new connection invitation"""
203+
"""Internal uplink method for create_invitation"""
70204

71205
@returns.json
72206
@json
73207
@post("/connections/create-static")
74-
def create_static_connection(
208+
def __create_static_connection(
75209
self, *, body: Body(type=ConnectionStaticRequest) = {}
76210
) -> ConnectionStaticResult:
77-
"""Create a new static connection"""
211+
"""Internal uplink method for create_static_connection"""
78212

79213
@returns.json
80214
@delete("/connections/{conn_id}")
81-
def delete_connection(self, *, conn_id: str) -> Dict:
82-
"""Remove an existing connection record"""
215+
def __delete_connection(self, *, conn_id: str) -> Dict:
216+
"""Internal uplink method for delete_connection"""
83217

84218
@returns.json
85219
@post("/connections/{conn_id}/establish-inbound/{ref_id}")
86-
def establish_inbound(self, *, conn_id: str, ref_id: str) -> Dict:
87-
"""Assign another connection as the inbound connection"""
220+
def __establish_inbound(self, *, conn_id: str, ref_id: str) -> Dict:
221+
"""Internal uplink method for establish_inbound"""
88222

89223
@returns.json
90224
@get("/connections/{conn_id}")
91-
def get_connection(self, *, conn_id: str) -> ConnRecord:
92-
"""Fetch a single connection record"""
225+
def __get_connection(self, *, conn_id: str) -> ConnRecord:
226+
"""Internal uplink method for get_connection"""
93227

94228
@returns.json
95229
@get("/connections/{conn_id}/endpoints")
96-
def get_connection_endpoint(self, *, conn_id: str) -> EndpointsResult:
97-
"""Fetch connection remote endpoint"""
230+
def __get_connection_endpoint(self, *, conn_id: str) -> EndpointsResult:
231+
"""Internal uplink method for get_connection_endpoint"""
98232

99233
@returns.json
100234
@get("/connections")
101-
def get_connections(
235+
def __get_connections(
102236
self,
103237
*,
104238
alias: Query = None,
@@ -109,30 +243,30 @@ def get_connections(
109243
their_did: Query = None,
110244
their_role: Query = None
111245
) -> ConnectionList:
112-
"""Query agent-to-agent connections"""
246+
"""Internal uplink method for get_connections"""
113247

114248
@returns.json
115249
@get("/connections/{conn_id}/metadata")
116-
def get_metadata(self, *, conn_id: str, key: Query = None) -> ConnectionMetadata:
117-
"""Fetch connection metadata"""
250+
def __get_metadata(self, *, conn_id: str, key: Query = None) -> ConnectionMetadata:
251+
"""Internal uplink method for get_metadata"""
118252

119253
@returns.json
120254
@json
121255
@post("/connections/receive-invitation")
122-
def receive_invitation(
256+
def __receive_invitation(
123257
self,
124258
*,
125259
alias: Query = None,
126260
auto_accept: Query = None,
127261
mediation_id: Query = None,
128262
body: Body(type=ReceiveInvitationRequest) = {}
129263
) -> ConnRecord:
130-
"""Receive a new connection invitation"""
264+
"""Internal uplink method for receive_invitation"""
131265

132266
@returns.json
133267
@json
134268
@post("/connections/{conn_id}/metadata")
135-
def set_metadata(
269+
def __set_metadata(
136270
self, *, conn_id: str, body: Body(type=ConnectionMetadataSetRequest) = {}
137271
) -> ConnectionMetadata:
138-
"""Set connection metadata"""
272+
"""Internal uplink method for set_metadata"""

0 commit comments

Comments
 (0)