14
14
json ,
15
15
)
16
16
17
- from typing import Dict , List # noqa: F401
17
+ from typing import Dict , List , Optional # noqa: F401
18
18
19
19
from aries_cloudcontroller .model .conn_record import ConnRecord
20
20
from aries_cloudcontroller .model .connection_list import ConnectionList
37
37
38
38
39
39
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
+
40
172
@returns .json
41
173
@post ("/connections/{conn_id}/accept-invitation" )
42
- def accept_invitation (
174
+ def __accept_invitation (
43
175
self ,
44
176
* ,
45
177
conn_id : str ,
46
178
mediation_id : Query = None ,
47
179
my_endpoint : Query = None ,
48
180
my_label : Query = None
49
181
) -> ConnRecord :
50
- """Accept a stored connection invitation """
182
+ """Internal uplink method for accept_invitation """
51
183
52
184
@returns .json
53
185
@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"""
56
190
57
191
@returns .json
58
192
@json
59
193
@post ("/connections/create-invitation" )
60
- def create_invitation (
194
+ def __create_invitation (
61
195
self ,
62
196
* ,
63
197
alias : Query = None ,
@@ -66,39 +200,39 @@ def create_invitation(
66
200
public : Query = None ,
67
201
body : Body (type = CreateInvitationRequest ) = {}
68
202
) -> InvitationResult :
69
- """Create a new connection invitation """
203
+ """Internal uplink method for create_invitation """
70
204
71
205
@returns .json
72
206
@json
73
207
@post ("/connections/create-static" )
74
- def create_static_connection (
208
+ def __create_static_connection (
75
209
self , * , body : Body (type = ConnectionStaticRequest ) = {}
76
210
) -> ConnectionStaticResult :
77
- """Create a new static connection """
211
+ """Internal uplink method for create_static_connection """
78
212
79
213
@returns .json
80
214
@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 """
83
217
84
218
@returns .json
85
219
@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 """
88
222
89
223
@returns .json
90
224
@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 """
93
227
94
228
@returns .json
95
229
@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 """
98
232
99
233
@returns .json
100
234
@get ("/connections" )
101
- def get_connections (
235
+ def __get_connections (
102
236
self ,
103
237
* ,
104
238
alias : Query = None ,
@@ -109,30 +243,30 @@ def get_connections(
109
243
their_did : Query = None ,
110
244
their_role : Query = None
111
245
) -> ConnectionList :
112
- """Query agent-to-agent connections """
246
+ """Internal uplink method for get_connections """
113
247
114
248
@returns .json
115
249
@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 """
118
252
119
253
@returns .json
120
254
@json
121
255
@post ("/connections/receive-invitation" )
122
- def receive_invitation (
256
+ def __receive_invitation (
123
257
self ,
124
258
* ,
125
259
alias : Query = None ,
126
260
auto_accept : Query = None ,
127
261
mediation_id : Query = None ,
128
262
body : Body (type = ReceiveInvitationRequest ) = {}
129
263
) -> ConnRecord :
130
- """Receive a new connection invitation """
264
+ """Internal uplink method for receive_invitation """
131
265
132
266
@returns .json
133
267
@json
134
268
@post ("/connections/{conn_id}/metadata" )
135
- def set_metadata (
269
+ def __set_metadata (
136
270
self , * , conn_id : str , body : Body (type = ConnectionMetadataSetRequest ) = {}
137
271
) -> ConnectionMetadata :
138
- """Set connection metadata """
272
+ """Internal uplink method for set_metadata """
0 commit comments