1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
# -*- coding: utf-8 -*-
# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT!
# source: codenames/v1/ssh_keys.proto
from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping
from typing import Protocol
from connectrpc.client import ConnectClient, ConnectClientSync
from connectrpc.code import Code
from connectrpc.compression import Compression
from connectrpc.errors import ConnectError
from connectrpc.interceptor import Interceptor, InterceptorSync
from connectrpc.method import IdempotencyLevel, MethodInfo
from connectrpc.request import Headers, RequestContext
from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync
import codenames.v1.ssh_keys_pb2 as codenames_dot_v1_dot_ssh__keys__pb2
class SSHKeyService(Protocol):
async def submit_s_s_h_key(self, request: codenames_dot_v1_dot_ssh__keys__pb2.SubmitSSHKeyRequest, ctx: RequestContext) -> codenames_dot_v1_dot_ssh__keys__pb2.SubmitSSHKeyResponse:
raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
async def list_teams_for_key_submission(self, request: codenames_dot_v1_dot_ssh__keys__pb2.ListTeamsForKeySubmissionRequest, ctx: RequestContext) -> codenames_dot_v1_dot_ssh__keys__pb2.ListTeamsForKeySubmissionResponse:
raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
class SSHKeyServiceASGIApplication(ConnectASGIApplication[SSHKeyService]):
def __init__(self, service: SSHKeyService | AsyncGenerator[SSHKeyService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None) -> None:
super().__init__(
service=service,
endpoints=lambda svc: {
"/codenames.v1.SSHKeyService/SubmitSSHKey": Endpoint.unary(
method=MethodInfo(
name="SubmitSSHKey",
service_name="codenames.v1.SSHKeyService",
input=codenames_dot_v1_dot_ssh__keys__pb2.SubmitSSHKeyRequest,
output=codenames_dot_v1_dot_ssh__keys__pb2.SubmitSSHKeyResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
),
function=svc.submit_s_s_h_key,
),
"/codenames.v1.SSHKeyService/ListTeamsForKeySubmission": Endpoint.unary(
method=MethodInfo(
name="ListTeamsForKeySubmission",
service_name="codenames.v1.SSHKeyService",
input=codenames_dot_v1_dot_ssh__keys__pb2.ListTeamsForKeySubmissionRequest,
output=codenames_dot_v1_dot_ssh__keys__pb2.ListTeamsForKeySubmissionResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
),
function=svc.list_teams_for_key_submission,
),
},
interceptors=interceptors,
read_max_bytes=read_max_bytes,
compressions=compressions,
)
@property
def path(self) -> str:
"""Returns the URL path to mount the application to when serving multiple applications."""
return "/codenames.v1.SSHKeyService"
class SSHKeyServiceClient(ConnectClient):
async def submit_s_s_h_key(
self,
request: codenames_dot_v1_dot_ssh__keys__pb2.SubmitSSHKeyRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> codenames_dot_v1_dot_ssh__keys__pb2.SubmitSSHKeyResponse:
return await self.execute_unary(
request=request,
method=MethodInfo(
name="SubmitSSHKey",
service_name="codenames.v1.SSHKeyService",
input=codenames_dot_v1_dot_ssh__keys__pb2.SubmitSSHKeyRequest,
output=codenames_dot_v1_dot_ssh__keys__pb2.SubmitSSHKeyResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
),
headers=headers,
timeout_ms=timeout_ms,
)
async def list_teams_for_key_submission(
self,
request: codenames_dot_v1_dot_ssh__keys__pb2.ListTeamsForKeySubmissionRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> codenames_dot_v1_dot_ssh__keys__pb2.ListTeamsForKeySubmissionResponse:
return await self.execute_unary(
request=request,
method=MethodInfo(
name="ListTeamsForKeySubmission",
service_name="codenames.v1.SSHKeyService",
input=codenames_dot_v1_dot_ssh__keys__pb2.ListTeamsForKeySubmissionRequest,
output=codenames_dot_v1_dot_ssh__keys__pb2.ListTeamsForKeySubmissionResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
),
headers=headers,
timeout_ms=timeout_ms,
)
class SSHKeyServiceSync(Protocol):
def submit_s_s_h_key(self, request: codenames_dot_v1_dot_ssh__keys__pb2.SubmitSSHKeyRequest, ctx: RequestContext) -> codenames_dot_v1_dot_ssh__keys__pb2.SubmitSSHKeyResponse:
raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
def list_teams_for_key_submission(self, request: codenames_dot_v1_dot_ssh__keys__pb2.ListTeamsForKeySubmissionRequest, ctx: RequestContext) -> codenames_dot_v1_dot_ssh__keys__pb2.ListTeamsForKeySubmissionResponse:
raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
class SSHKeyServiceWSGIApplication(ConnectWSGIApplication):
def __init__(self, service: SSHKeyServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None) -> None:
super().__init__(
endpoints={
"/codenames.v1.SSHKeyService/SubmitSSHKey": EndpointSync.unary(
method=MethodInfo(
name="SubmitSSHKey",
service_name="codenames.v1.SSHKeyService",
input=codenames_dot_v1_dot_ssh__keys__pb2.SubmitSSHKeyRequest,
output=codenames_dot_v1_dot_ssh__keys__pb2.SubmitSSHKeyResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
),
function=service.submit_s_s_h_key,
),
"/codenames.v1.SSHKeyService/ListTeamsForKeySubmission": EndpointSync.unary(
method=MethodInfo(
name="ListTeamsForKeySubmission",
service_name="codenames.v1.SSHKeyService",
input=codenames_dot_v1_dot_ssh__keys__pb2.ListTeamsForKeySubmissionRequest,
output=codenames_dot_v1_dot_ssh__keys__pb2.ListTeamsForKeySubmissionResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
),
function=service.list_teams_for_key_submission,
),
},
interceptors=interceptors,
read_max_bytes=read_max_bytes,
compressions=compressions,
)
@property
def path(self) -> str:
"""Returns the URL path to mount the application to when serving multiple applications."""
return "/codenames.v1.SSHKeyService"
class SSHKeyServiceClientSync(ConnectClientSync):
def submit_s_s_h_key(
self,
request: codenames_dot_v1_dot_ssh__keys__pb2.SubmitSSHKeyRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> codenames_dot_v1_dot_ssh__keys__pb2.SubmitSSHKeyResponse:
return self.execute_unary(
request=request,
method=MethodInfo(
name="SubmitSSHKey",
service_name="codenames.v1.SSHKeyService",
input=codenames_dot_v1_dot_ssh__keys__pb2.SubmitSSHKeyRequest,
output=codenames_dot_v1_dot_ssh__keys__pb2.SubmitSSHKeyResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
),
headers=headers,
timeout_ms=timeout_ms,
)
def list_teams_for_key_submission(
self,
request: codenames_dot_v1_dot_ssh__keys__pb2.ListTeamsForKeySubmissionRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> codenames_dot_v1_dot_ssh__keys__pb2.ListTeamsForKeySubmissionResponse:
return self.execute_unary(
request=request,
method=MethodInfo(
name="ListTeamsForKeySubmission",
service_name="codenames.v1.SSHKeyService",
input=codenames_dot_v1_dot_ssh__keys__pb2.ListTeamsForKeySubmissionRequest,
output=codenames_dot_v1_dot_ssh__keys__pb2.ListTeamsForKeySubmissionResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
),
headers=headers,
timeout_ms=timeout_ms,
)
|