mergetbapi 0.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- __init__.py +0 -0
- google/__init__.py +0 -0
- google/api/__init__.py +255 -0
- grpc/__init__.py +0 -0
- grpc/gateway/__init__.py +0 -0
- grpc/gateway/protoc_gen_openapiv2/__init__.py +0 -0
- grpc/gateway/protoc_gen_openapiv2/options/__init__.py +727 -0
- mergetbapi-0.0.1.dist-info/LICENSE.md +19 -0
- mergetbapi-0.0.1.dist-info/METADATA +24 -0
- mergetbapi-0.0.1.dist-info/RECORD +17 -0
- mergetbapi-0.0.1.dist-info/WHEEL +5 -0
- mergetbapi-0.0.1.dist-info/top_level.txt +7 -0
- portal/__init__.py +0 -0
- portal/v1/__init__.py +6702 -0
- reconcile/__init__.py +314 -0
- validator/__init__.py +104 -0
- xir/__init__.py +1032 -0
|
@@ -0,0 +1,727 @@
|
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
|
+
# sources: github.com/grpc-gateway/v2/protoc-gen-openapiv2/openapiv2.proto, protoc-gen-openapiv2/options/annotations.proto
|
|
3
|
+
# plugin: python-betterproto
|
|
4
|
+
# This file has been @generated
|
|
5
|
+
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from typing import (
|
|
8
|
+
Dict,
|
|
9
|
+
List,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
import betterproto
|
|
13
|
+
import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class Scheme(betterproto.Enum):
|
|
17
|
+
"""
|
|
18
|
+
Scheme describes the schemes supported by the OpenAPI Swagger and Operation
|
|
19
|
+
objects.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
UNKNOWN = 0
|
|
23
|
+
HTTP = 1
|
|
24
|
+
HTTPS = 2
|
|
25
|
+
WS = 3
|
|
26
|
+
WSS = 4
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class JsonSchemaJsonSchemaSimpleTypes(betterproto.Enum):
|
|
30
|
+
UNKNOWN = 0
|
|
31
|
+
ARRAY = 1
|
|
32
|
+
BOOLEAN = 2
|
|
33
|
+
INTEGER = 3
|
|
34
|
+
NULL = 4
|
|
35
|
+
NUMBER = 5
|
|
36
|
+
OBJECT = 6
|
|
37
|
+
STRING = 7
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class SecuritySchemeType(betterproto.Enum):
|
|
41
|
+
"""
|
|
42
|
+
The type of the security scheme. Valid values are "basic", "apiKey" or
|
|
43
|
+
"oauth2".
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
TYPE_INVALID = 0
|
|
47
|
+
TYPE_BASIC = 1
|
|
48
|
+
TYPE_API_KEY = 2
|
|
49
|
+
TYPE_OAUTH2 = 3
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class SecuritySchemeIn(betterproto.Enum):
|
|
53
|
+
"""The location of the API key. Valid values are "query" or "header"."""
|
|
54
|
+
|
|
55
|
+
IN_INVALID = 0
|
|
56
|
+
IN_QUERY = 1
|
|
57
|
+
IN_HEADER = 2
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class SecuritySchemeFlow(betterproto.Enum):
|
|
61
|
+
"""
|
|
62
|
+
The flow used by the OAuth2 security scheme. Valid values are "implicit",
|
|
63
|
+
"password", "application" or "accessCode".
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
FLOW_INVALID = 0
|
|
67
|
+
FLOW_IMPLICIT = 1
|
|
68
|
+
FLOW_PASSWORD = 2
|
|
69
|
+
FLOW_APPLICATION = 3
|
|
70
|
+
FLOW_ACCESS_CODE = 4
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@dataclass(eq=False, repr=False)
|
|
74
|
+
class Swagger(betterproto.Message):
|
|
75
|
+
"""
|
|
76
|
+
`Swagger` is a representation of OpenAPI v2 specification's Swagger object.
|
|
77
|
+
See: https://github.com/OAI/OpenAPI-
|
|
78
|
+
Specification/blob/3.0.0/versions/2.0.md#swaggerObject Example: option
|
|
79
|
+
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { info:
|
|
80
|
+
{ title: "Echo API"; version: "1.0"; description: ";
|
|
81
|
+
contact: { name: "gRPC-Gateway project"; url:
|
|
82
|
+
"https://github.com/grpc-ecosystem/grpc-gateway"; email:
|
|
83
|
+
"none@example.com"; }; license: { name: "BSD 3-Clause
|
|
84
|
+
License"; url: "https://github.com/grpc-ecosystem/grpc-
|
|
85
|
+
gateway/blob/master/LICENSE.txt"; }; }; schemes: HTTPS;
|
|
86
|
+
consumes: "application/json"; produces: "application/json"; };
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
swagger: str = betterproto.string_field(1)
|
|
90
|
+
"""
|
|
91
|
+
Specifies the OpenAPI Specification version being used. It can be used by
|
|
92
|
+
the OpenAPI UI and other clients to interpret the API listing. The value
|
|
93
|
+
MUST be "2.0".
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
info: "Info" = betterproto.message_field(2)
|
|
97
|
+
"""
|
|
98
|
+
Provides metadata about the API. The metadata can be used by the clients
|
|
99
|
+
if needed.
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
host: str = betterproto.string_field(3)
|
|
103
|
+
"""
|
|
104
|
+
The host (name or ip) serving the API. This MUST be the host only and does
|
|
105
|
+
not include the scheme nor sub-paths. It MAY include a port. If the host is
|
|
106
|
+
not included, the host serving the documentation is to be used (including
|
|
107
|
+
the port). The host does not support path templating.
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
base_path: str = betterproto.string_field(4)
|
|
111
|
+
"""
|
|
112
|
+
The base path on which the API is served, which is relative to the host. If
|
|
113
|
+
it is not included, the API is served directly under the host. The value
|
|
114
|
+
MUST start with a leading slash (/). The basePath does not support path
|
|
115
|
+
templating. Note that using `base_path` does not change the endpoint paths
|
|
116
|
+
that are generated in the resulting OpenAPI file. If you wish to use
|
|
117
|
+
`base_path` with relatively generated OpenAPI paths, the `base_path` prefix
|
|
118
|
+
must be manually removed from your `google.api.http` paths and your code
|
|
119
|
+
changed to serve the API from the `base_path`.
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
schemes: List["Scheme"] = betterproto.enum_field(5)
|
|
123
|
+
"""
|
|
124
|
+
The transfer protocol of the API. Values MUST be from the list: "http",
|
|
125
|
+
"https", "ws", "wss". If the schemes is not included, the default scheme to
|
|
126
|
+
be used is the one used to access the OpenAPI definition itself.
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
consumes: List[str] = betterproto.string_field(6)
|
|
130
|
+
"""
|
|
131
|
+
A list of MIME types the APIs can consume. This is global to all APIs but
|
|
132
|
+
can be overridden on specific API calls. Value MUST be as described under
|
|
133
|
+
Mime Types.
|
|
134
|
+
"""
|
|
135
|
+
|
|
136
|
+
produces: List[str] = betterproto.string_field(7)
|
|
137
|
+
"""
|
|
138
|
+
A list of MIME types the APIs can produce. This is global to all APIs but
|
|
139
|
+
can be overridden on specific API calls. Value MUST be as described under
|
|
140
|
+
Mime Types.
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
responses: Dict[str, "Response"] = betterproto.map_field(
|
|
144
|
+
10, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE
|
|
145
|
+
)
|
|
146
|
+
"""
|
|
147
|
+
An object to hold responses that can be used across operations. This
|
|
148
|
+
property does not define global responses for all operations.
|
|
149
|
+
"""
|
|
150
|
+
|
|
151
|
+
security_definitions: "SecurityDefinitions" = betterproto.message_field(11)
|
|
152
|
+
"""
|
|
153
|
+
Security scheme definitions that can be used across the specification.
|
|
154
|
+
"""
|
|
155
|
+
|
|
156
|
+
security: List["SecurityRequirement"] = betterproto.message_field(12)
|
|
157
|
+
"""
|
|
158
|
+
A declaration of which security schemes are applied for the API as a whole.
|
|
159
|
+
The list of values describes alternative security schemes that can be used
|
|
160
|
+
(that is, there is a logical OR between the security requirements).
|
|
161
|
+
Individual operations can override this definition.
|
|
162
|
+
"""
|
|
163
|
+
|
|
164
|
+
external_docs: "ExternalDocumentation" = betterproto.message_field(14)
|
|
165
|
+
"""Additional external documentation."""
|
|
166
|
+
|
|
167
|
+
extensions: Dict[
|
|
168
|
+
str, "betterproto_lib_google_protobuf.Value"
|
|
169
|
+
] = betterproto.map_field(15, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
@dataclass(eq=False, repr=False)
|
|
173
|
+
class Operation(betterproto.Message):
|
|
174
|
+
"""
|
|
175
|
+
`Operation` is a representation of OpenAPI v2 specification's Operation
|
|
176
|
+
object. See: https://github.com/OAI/OpenAPI-
|
|
177
|
+
Specification/blob/3.0.0/versions/2.0.md#operationObject Example: service
|
|
178
|
+
EchoService { rpc Echo(SimpleMessage) returns (SimpleMessage) {
|
|
179
|
+
option (google.api.http) = { get: "/v1/example/echo/{id}" };
|
|
180
|
+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
181
|
+
summary: "Get a message."; operation_id: "getMessage"; tags:
|
|
182
|
+
"echo"; responses: { key: "200" value: {
|
|
183
|
+
description: "OK"; } } }; } }
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
tags: List[str] = betterproto.string_field(1)
|
|
187
|
+
"""
|
|
188
|
+
A list of tags for API documentation control. Tags can be used for logical
|
|
189
|
+
grouping of operations by resources or any other qualifier.
|
|
190
|
+
"""
|
|
191
|
+
|
|
192
|
+
summary: str = betterproto.string_field(2)
|
|
193
|
+
"""
|
|
194
|
+
A short summary of what the operation does. For maximum readability in the
|
|
195
|
+
swagger-ui, this field SHOULD be less than 120 characters.
|
|
196
|
+
"""
|
|
197
|
+
|
|
198
|
+
description: str = betterproto.string_field(3)
|
|
199
|
+
"""
|
|
200
|
+
A verbose explanation of the operation behavior. GFM syntax can be used for
|
|
201
|
+
rich text representation.
|
|
202
|
+
"""
|
|
203
|
+
|
|
204
|
+
external_docs: "ExternalDocumentation" = betterproto.message_field(4)
|
|
205
|
+
"""Additional external documentation for this operation."""
|
|
206
|
+
|
|
207
|
+
operation_id: str = betterproto.string_field(5)
|
|
208
|
+
"""
|
|
209
|
+
Unique string used to identify the operation. The id MUST be unique among
|
|
210
|
+
all operations described in the API. Tools and libraries MAY use the
|
|
211
|
+
operationId to uniquely identify an operation, therefore, it is recommended
|
|
212
|
+
to follow common programming naming conventions.
|
|
213
|
+
"""
|
|
214
|
+
|
|
215
|
+
consumes: List[str] = betterproto.string_field(6)
|
|
216
|
+
"""
|
|
217
|
+
A list of MIME types the operation can consume. This overrides the consumes
|
|
218
|
+
definition at the OpenAPI Object. An empty value MAY be used to clear the
|
|
219
|
+
global definition. Value MUST be as described under Mime Types.
|
|
220
|
+
"""
|
|
221
|
+
|
|
222
|
+
produces: List[str] = betterproto.string_field(7)
|
|
223
|
+
"""
|
|
224
|
+
A list of MIME types the operation can produce. This overrides the produces
|
|
225
|
+
definition at the OpenAPI Object. An empty value MAY be used to clear the
|
|
226
|
+
global definition. Value MUST be as described under Mime Types.
|
|
227
|
+
"""
|
|
228
|
+
|
|
229
|
+
responses: Dict[str, "Response"] = betterproto.map_field(
|
|
230
|
+
9, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE
|
|
231
|
+
)
|
|
232
|
+
"""
|
|
233
|
+
The list of possible responses as they are returned from executing this
|
|
234
|
+
operation.
|
|
235
|
+
"""
|
|
236
|
+
|
|
237
|
+
schemes: List["Scheme"] = betterproto.enum_field(10)
|
|
238
|
+
"""
|
|
239
|
+
The transfer protocol for the operation. Values MUST be from the list:
|
|
240
|
+
"http", "https", "ws", "wss". The value overrides the OpenAPI Object
|
|
241
|
+
schemes definition.
|
|
242
|
+
"""
|
|
243
|
+
|
|
244
|
+
deprecated: bool = betterproto.bool_field(11)
|
|
245
|
+
"""
|
|
246
|
+
Declares this operation to be deprecated. Usage of the declared operation
|
|
247
|
+
should be refrained. Default value is false.
|
|
248
|
+
"""
|
|
249
|
+
|
|
250
|
+
security: List["SecurityRequirement"] = betterproto.message_field(12)
|
|
251
|
+
"""
|
|
252
|
+
A declaration of which security schemes are applied for this operation. The
|
|
253
|
+
list of values describes alternative security schemes that can be used
|
|
254
|
+
(that is, there is a logical OR between the security requirements). This
|
|
255
|
+
definition overrides any declared top-level security. To remove a top-level
|
|
256
|
+
security declaration, an empty array can be used.
|
|
257
|
+
"""
|
|
258
|
+
|
|
259
|
+
extensions: Dict[
|
|
260
|
+
str, "betterproto_lib_google_protobuf.Value"
|
|
261
|
+
] = betterproto.map_field(13, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE)
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
@dataclass(eq=False, repr=False)
|
|
265
|
+
class Header(betterproto.Message):
|
|
266
|
+
"""
|
|
267
|
+
`Header` is a representation of OpenAPI v2 specification's Header object.
|
|
268
|
+
See: https://github.com/OAI/OpenAPI-
|
|
269
|
+
Specification/blob/3.0.0/versions/2.0.md#headerObject
|
|
270
|
+
"""
|
|
271
|
+
|
|
272
|
+
description: str = betterproto.string_field(1)
|
|
273
|
+
"""`Description` is a short description of the header."""
|
|
274
|
+
|
|
275
|
+
type: str = betterproto.string_field(2)
|
|
276
|
+
"""
|
|
277
|
+
The type of the object. The value MUST be one of "string", "number",
|
|
278
|
+
"integer", or "boolean". The "array" type is not supported.
|
|
279
|
+
"""
|
|
280
|
+
|
|
281
|
+
format: str = betterproto.string_field(3)
|
|
282
|
+
"""`Format` The extending format for the previously mentioned type."""
|
|
283
|
+
|
|
284
|
+
default: str = betterproto.string_field(6)
|
|
285
|
+
"""
|
|
286
|
+
`Default` Declares the value of the header that the server will use if none
|
|
287
|
+
is provided. See: https://tools.ietf.org/html/draft-fge-json-schema-
|
|
288
|
+
validation-00#section-6.2. Unlike JSON Schema this value MUST conform to
|
|
289
|
+
the defined type for the header.
|
|
290
|
+
"""
|
|
291
|
+
|
|
292
|
+
pattern: str = betterproto.string_field(13)
|
|
293
|
+
"""
|
|
294
|
+
'Pattern' See https://tools.ietf.org/html/draft-fge-json-schema-
|
|
295
|
+
validation-00#section-5.2.3.
|
|
296
|
+
"""
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
@dataclass(eq=False, repr=False)
|
|
300
|
+
class Response(betterproto.Message):
|
|
301
|
+
"""
|
|
302
|
+
`Response` is a representation of OpenAPI v2 specification's Response
|
|
303
|
+
object. See: https://github.com/OAI/OpenAPI-
|
|
304
|
+
Specification/blob/3.0.0/versions/2.0.md#responseObject
|
|
305
|
+
"""
|
|
306
|
+
|
|
307
|
+
description: str = betterproto.string_field(1)
|
|
308
|
+
"""
|
|
309
|
+
`Description` is a short description of the response. GFM syntax can be
|
|
310
|
+
used for rich text representation.
|
|
311
|
+
"""
|
|
312
|
+
|
|
313
|
+
schema: "Schema" = betterproto.message_field(2)
|
|
314
|
+
"""
|
|
315
|
+
`Schema` optionally defines the structure of the response. If `Schema` is
|
|
316
|
+
not provided, it means there is no content to the response.
|
|
317
|
+
"""
|
|
318
|
+
|
|
319
|
+
headers: Dict[str, "Header"] = betterproto.map_field(
|
|
320
|
+
3, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE
|
|
321
|
+
)
|
|
322
|
+
"""
|
|
323
|
+
`Headers` A list of headers that are sent with the response. `Header` name
|
|
324
|
+
is expected to be a string in the canonical format of the MIME header key
|
|
325
|
+
See: https://golang.org/pkg/net/textproto/#CanonicalMIMEHeaderKey
|
|
326
|
+
"""
|
|
327
|
+
|
|
328
|
+
examples: Dict[str, str] = betterproto.map_field(
|
|
329
|
+
4, betterproto.TYPE_STRING, betterproto.TYPE_STRING
|
|
330
|
+
)
|
|
331
|
+
"""
|
|
332
|
+
`Examples` gives per-mimetype response examples. See:
|
|
333
|
+
https://github.com/OAI/OpenAPI-
|
|
334
|
+
Specification/blob/3.0.0/versions/2.0.md#example-object
|
|
335
|
+
"""
|
|
336
|
+
|
|
337
|
+
extensions: Dict[
|
|
338
|
+
str, "betterproto_lib_google_protobuf.Value"
|
|
339
|
+
] = betterproto.map_field(5, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE)
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
@dataclass(eq=False, repr=False)
|
|
343
|
+
class Info(betterproto.Message):
|
|
344
|
+
"""
|
|
345
|
+
`Info` is a representation of OpenAPI v2 specification's Info object. See:
|
|
346
|
+
https://github.com/OAI/OpenAPI-
|
|
347
|
+
Specification/blob/3.0.0/versions/2.0.md#infoObject Example: option
|
|
348
|
+
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { info:
|
|
349
|
+
{ title: "Echo API"; version: "1.0"; description: ";
|
|
350
|
+
contact: { name: "gRPC-Gateway project"; url:
|
|
351
|
+
"https://github.com/grpc-ecosystem/grpc-gateway"; email:
|
|
352
|
+
"none@example.com"; }; license: { name: "BSD 3-Clause
|
|
353
|
+
License"; url: "https://github.com/grpc-ecosystem/grpc-
|
|
354
|
+
gateway/blob/master/LICENSE.txt"; }; }; ... };
|
|
355
|
+
"""
|
|
356
|
+
|
|
357
|
+
title: str = betterproto.string_field(1)
|
|
358
|
+
"""The title of the application."""
|
|
359
|
+
|
|
360
|
+
description: str = betterproto.string_field(2)
|
|
361
|
+
"""
|
|
362
|
+
A short description of the application. GFM syntax can be used for rich
|
|
363
|
+
text representation.
|
|
364
|
+
"""
|
|
365
|
+
|
|
366
|
+
terms_of_service: str = betterproto.string_field(3)
|
|
367
|
+
"""The Terms of Service for the API."""
|
|
368
|
+
|
|
369
|
+
contact: "Contact" = betterproto.message_field(4)
|
|
370
|
+
"""The contact information for the exposed API."""
|
|
371
|
+
|
|
372
|
+
license: "License" = betterproto.message_field(5)
|
|
373
|
+
"""The license information for the exposed API."""
|
|
374
|
+
|
|
375
|
+
version: str = betterproto.string_field(6)
|
|
376
|
+
"""
|
|
377
|
+
Provides the version of the application API (not to be confused with the
|
|
378
|
+
specification version).
|
|
379
|
+
"""
|
|
380
|
+
|
|
381
|
+
extensions: Dict[
|
|
382
|
+
str, "betterproto_lib_google_protobuf.Value"
|
|
383
|
+
] = betterproto.map_field(7, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE)
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
@dataclass(eq=False, repr=False)
|
|
387
|
+
class Contact(betterproto.Message):
|
|
388
|
+
"""
|
|
389
|
+
`Contact` is a representation of OpenAPI v2 specification's Contact object.
|
|
390
|
+
See: https://github.com/OAI/OpenAPI-
|
|
391
|
+
Specification/blob/3.0.0/versions/2.0.md#contactObject Example: option
|
|
392
|
+
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { info:
|
|
393
|
+
{ ... contact: { name: "gRPC-Gateway project"; url:
|
|
394
|
+
"https://github.com/grpc-ecosystem/grpc-gateway"; email:
|
|
395
|
+
"none@example.com"; }; ... }; ... };
|
|
396
|
+
"""
|
|
397
|
+
|
|
398
|
+
name: str = betterproto.string_field(1)
|
|
399
|
+
"""The identifying name of the contact person/organization."""
|
|
400
|
+
|
|
401
|
+
url: str = betterproto.string_field(2)
|
|
402
|
+
"""
|
|
403
|
+
The URL pointing to the contact information. MUST be in the format of a
|
|
404
|
+
URL.
|
|
405
|
+
"""
|
|
406
|
+
|
|
407
|
+
email: str = betterproto.string_field(3)
|
|
408
|
+
"""
|
|
409
|
+
The email address of the contact person/organization. MUST be in the format
|
|
410
|
+
of an email address.
|
|
411
|
+
"""
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
@dataclass(eq=False, repr=False)
|
|
415
|
+
class License(betterproto.Message):
|
|
416
|
+
"""
|
|
417
|
+
`License` is a representation of OpenAPI v2 specification's License object.
|
|
418
|
+
See: https://github.com/OAI/OpenAPI-
|
|
419
|
+
Specification/blob/3.0.0/versions/2.0.md#licenseObject Example: option
|
|
420
|
+
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { info:
|
|
421
|
+
{ ... license: { name: "BSD 3-Clause License"; url:
|
|
422
|
+
"https://github.com/grpc-ecosystem/grpc-gateway/blob/master/LICENSE.txt";
|
|
423
|
+
}; ... }; ... };
|
|
424
|
+
"""
|
|
425
|
+
|
|
426
|
+
name: str = betterproto.string_field(1)
|
|
427
|
+
"""The license name used for the API."""
|
|
428
|
+
|
|
429
|
+
url: str = betterproto.string_field(2)
|
|
430
|
+
"""
|
|
431
|
+
A URL to the license used for the API. MUST be in the format of a URL.
|
|
432
|
+
"""
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
@dataclass(eq=False, repr=False)
|
|
436
|
+
class ExternalDocumentation(betterproto.Message):
|
|
437
|
+
"""
|
|
438
|
+
`ExternalDocumentation` is a representation of OpenAPI v2 specification's
|
|
439
|
+
ExternalDocumentation object. See: https://github.com/OAI/OpenAPI-
|
|
440
|
+
Specification/blob/3.0.0/versions/2.0.md#externalDocumentationObject
|
|
441
|
+
Example: option
|
|
442
|
+
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { ...
|
|
443
|
+
external_docs: { description: "More about gRPC-Gateway"; url:
|
|
444
|
+
"https://github.com/grpc-ecosystem/grpc-gateway"; } ... };
|
|
445
|
+
"""
|
|
446
|
+
|
|
447
|
+
description: str = betterproto.string_field(1)
|
|
448
|
+
"""
|
|
449
|
+
A short description of the target documentation. GFM syntax can be used for
|
|
450
|
+
rich text representation.
|
|
451
|
+
"""
|
|
452
|
+
|
|
453
|
+
url: str = betterproto.string_field(2)
|
|
454
|
+
"""
|
|
455
|
+
The URL for the target documentation. Value MUST be in the format of a URL.
|
|
456
|
+
"""
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
@dataclass(eq=False, repr=False)
|
|
460
|
+
class Schema(betterproto.Message):
|
|
461
|
+
"""
|
|
462
|
+
`Schema` is a representation of OpenAPI v2 specification's Schema object.
|
|
463
|
+
See: https://github.com/OAI/OpenAPI-
|
|
464
|
+
Specification/blob/3.0.0/versions/2.0.md#schemaObject
|
|
465
|
+
"""
|
|
466
|
+
|
|
467
|
+
json_schema: "JsonSchema" = betterproto.message_field(1)
|
|
468
|
+
discriminator: str = betterproto.string_field(2)
|
|
469
|
+
"""
|
|
470
|
+
Adds support for polymorphism. The discriminator is the schema property
|
|
471
|
+
name that is used to differentiate between other schema that inherit this
|
|
472
|
+
schema. The property name used MUST be defined at this schema and it MUST
|
|
473
|
+
be in the required property list. When used, the value MUST be the name of
|
|
474
|
+
this schema or any schema that inherits it.
|
|
475
|
+
"""
|
|
476
|
+
|
|
477
|
+
read_only: bool = betterproto.bool_field(3)
|
|
478
|
+
"""
|
|
479
|
+
Relevant only for Schema "properties" definitions. Declares the property as
|
|
480
|
+
"read only". This means that it MAY be sent as part of a response but MUST
|
|
481
|
+
NOT be sent as part of the request. Properties marked as readOnly being
|
|
482
|
+
true SHOULD NOT be in the required list of the defined schema. Default
|
|
483
|
+
value is false.
|
|
484
|
+
"""
|
|
485
|
+
|
|
486
|
+
external_docs: "ExternalDocumentation" = betterproto.message_field(5)
|
|
487
|
+
"""Additional external documentation for this schema."""
|
|
488
|
+
|
|
489
|
+
example: str = betterproto.string_field(6)
|
|
490
|
+
"""
|
|
491
|
+
A free-form property to include an example of an instance for this schema
|
|
492
|
+
in JSON. This is copied verbatim to the output.
|
|
493
|
+
"""
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
@dataclass(eq=False, repr=False)
|
|
497
|
+
class JsonSchema(betterproto.Message):
|
|
498
|
+
"""
|
|
499
|
+
`JSONSchema` represents properties from JSON Schema taken, and as used, in
|
|
500
|
+
the OpenAPI v2 spec. This includes changes made by OpenAPI v2. See:
|
|
501
|
+
https://github.com/OAI/OpenAPI-
|
|
502
|
+
Specification/blob/3.0.0/versions/2.0.md#schemaObject See also:
|
|
503
|
+
https://cswr.github.io/JsonSchema/spec/basic_types/,
|
|
504
|
+
https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json
|
|
505
|
+
Example: message SimpleMessage { option
|
|
506
|
+
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
|
|
507
|
+
json_schema: { title: "SimpleMessage" description: "A simple
|
|
508
|
+
message." required: ["id"] } }; // Id represents the
|
|
509
|
+
message identifier. string id = 1; [
|
|
510
|
+
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
511
|
+
{description: "The unique identifier of the simple message." }]; }
|
|
512
|
+
"""
|
|
513
|
+
|
|
514
|
+
ref: str = betterproto.string_field(3)
|
|
515
|
+
"""
|
|
516
|
+
Ref is used to define an external reference to include in the message. This
|
|
517
|
+
could be a fully qualified proto message reference, and that type must be
|
|
518
|
+
imported into the protofile. If no message is identified, the Ref will be
|
|
519
|
+
used verbatim in the output. For example: `ref:
|
|
520
|
+
".google.protobuf.Timestamp"`.
|
|
521
|
+
"""
|
|
522
|
+
|
|
523
|
+
title: str = betterproto.string_field(5)
|
|
524
|
+
"""The title of the schema."""
|
|
525
|
+
|
|
526
|
+
description: str = betterproto.string_field(6)
|
|
527
|
+
"""A short description of the schema."""
|
|
528
|
+
|
|
529
|
+
default: str = betterproto.string_field(7)
|
|
530
|
+
read_only: bool = betterproto.bool_field(8)
|
|
531
|
+
example: str = betterproto.string_field(9)
|
|
532
|
+
"""
|
|
533
|
+
A free-form property to include a JSON example of this field. This is
|
|
534
|
+
copied verbatim to the output swagger.json. Quotes must be escaped. This
|
|
535
|
+
property is the same for 2.0 and 3.0.0 https://github.com/OAI/OpenAPI-
|
|
536
|
+
Specification/blob/3.0.0/versions/3.0.0.md#schemaObject
|
|
537
|
+
https://github.com/OAI/OpenAPI-
|
|
538
|
+
Specification/blob/3.0.0/versions/2.0.md#schemaObject
|
|
539
|
+
"""
|
|
540
|
+
|
|
541
|
+
multiple_of: float = betterproto.double_field(10)
|
|
542
|
+
maximum: float = betterproto.double_field(11)
|
|
543
|
+
"""
|
|
544
|
+
Maximum represents an inclusive upper limit for a numeric instance. The
|
|
545
|
+
value of MUST be a number,
|
|
546
|
+
"""
|
|
547
|
+
|
|
548
|
+
exclusive_maximum: bool = betterproto.bool_field(12)
|
|
549
|
+
minimum: float = betterproto.double_field(13)
|
|
550
|
+
"""
|
|
551
|
+
minimum represents an inclusive lower limit for a numeric instance. The
|
|
552
|
+
value of MUST be a number,
|
|
553
|
+
"""
|
|
554
|
+
|
|
555
|
+
exclusive_minimum: bool = betterproto.bool_field(14)
|
|
556
|
+
max_length: int = betterproto.uint64_field(15)
|
|
557
|
+
min_length: int = betterproto.uint64_field(16)
|
|
558
|
+
pattern: str = betterproto.string_field(17)
|
|
559
|
+
max_items: int = betterproto.uint64_field(20)
|
|
560
|
+
min_items: int = betterproto.uint64_field(21)
|
|
561
|
+
unique_items: bool = betterproto.bool_field(22)
|
|
562
|
+
max_properties: int = betterproto.uint64_field(24)
|
|
563
|
+
min_properties: int = betterproto.uint64_field(25)
|
|
564
|
+
required: List[str] = betterproto.string_field(26)
|
|
565
|
+
array: List[str] = betterproto.string_field(34)
|
|
566
|
+
"""Items in 'array' must be unique."""
|
|
567
|
+
|
|
568
|
+
type: List["JsonSchemaJsonSchemaSimpleTypes"] = betterproto.enum_field(35)
|
|
569
|
+
format: str = betterproto.string_field(36)
|
|
570
|
+
"""`Format`"""
|
|
571
|
+
|
|
572
|
+
enum: List[str] = betterproto.string_field(46)
|
|
573
|
+
"""
|
|
574
|
+
Items in `enum` must be unique https://tools.ietf.org/html/draft-fge-json-
|
|
575
|
+
schema-validation-00#section-5.5.1
|
|
576
|
+
"""
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
@dataclass(eq=False, repr=False)
|
|
580
|
+
class Tag(betterproto.Message):
|
|
581
|
+
"""
|
|
582
|
+
`Tag` is a representation of OpenAPI v2 specification's Tag object. See:
|
|
583
|
+
https://github.com/OAI/OpenAPI-
|
|
584
|
+
Specification/blob/3.0.0/versions/2.0.md#tagObject
|
|
585
|
+
"""
|
|
586
|
+
|
|
587
|
+
description: str = betterproto.string_field(2)
|
|
588
|
+
"""
|
|
589
|
+
A short description for the tag. GFM syntax can be used for rich text
|
|
590
|
+
representation.
|
|
591
|
+
"""
|
|
592
|
+
|
|
593
|
+
external_docs: "ExternalDocumentation" = betterproto.message_field(3)
|
|
594
|
+
"""Additional external documentation for this tag."""
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
@dataclass(eq=False, repr=False)
|
|
598
|
+
class SecurityDefinitions(betterproto.Message):
|
|
599
|
+
"""
|
|
600
|
+
`SecurityDefinitions` is a representation of OpenAPI v2 specification's
|
|
601
|
+
Security Definitions object. See: https://github.com/OAI/OpenAPI-
|
|
602
|
+
Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject A
|
|
603
|
+
declaration of the security schemes available to be used in the
|
|
604
|
+
specification. This does not enforce the security schemes on the operations
|
|
605
|
+
and only serves to provide the relevant details for each scheme.
|
|
606
|
+
"""
|
|
607
|
+
|
|
608
|
+
security: Dict[str, "SecurityScheme"] = betterproto.map_field(
|
|
609
|
+
1, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE
|
|
610
|
+
)
|
|
611
|
+
"""
|
|
612
|
+
A single security scheme definition, mapping a "name" to the scheme it
|
|
613
|
+
defines.
|
|
614
|
+
"""
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
@dataclass(eq=False, repr=False)
|
|
618
|
+
class SecurityScheme(betterproto.Message):
|
|
619
|
+
"""
|
|
620
|
+
`SecurityScheme` is a representation of OpenAPI v2 specification's Security
|
|
621
|
+
Scheme object. See: https://github.com/OAI/OpenAPI-
|
|
622
|
+
Specification/blob/3.0.0/versions/2.0.md#securitySchemeObject Allows the
|
|
623
|
+
definition of a security scheme that can be used by the operations.
|
|
624
|
+
Supported schemes are basic authentication, an API key (either as a header
|
|
625
|
+
or as a query parameter) and OAuth2's common flows (implicit, password,
|
|
626
|
+
application and access code).
|
|
627
|
+
"""
|
|
628
|
+
|
|
629
|
+
type: "SecuritySchemeType" = betterproto.enum_field(1)
|
|
630
|
+
"""
|
|
631
|
+
The type of the security scheme. Valid values are "basic", "apiKey" or
|
|
632
|
+
"oauth2".
|
|
633
|
+
"""
|
|
634
|
+
|
|
635
|
+
description: str = betterproto.string_field(2)
|
|
636
|
+
"""A short description for security scheme."""
|
|
637
|
+
|
|
638
|
+
name: str = betterproto.string_field(3)
|
|
639
|
+
"""
|
|
640
|
+
The name of the header or query parameter to be used. Valid for apiKey.
|
|
641
|
+
"""
|
|
642
|
+
|
|
643
|
+
in_: "SecuritySchemeIn" = betterproto.enum_field(4)
|
|
644
|
+
"""
|
|
645
|
+
The location of the API key. Valid values are "query" or "header". Valid
|
|
646
|
+
for apiKey.
|
|
647
|
+
"""
|
|
648
|
+
|
|
649
|
+
flow: "SecuritySchemeFlow" = betterproto.enum_field(5)
|
|
650
|
+
"""
|
|
651
|
+
The flow used by the OAuth2 security scheme. Valid values are "implicit",
|
|
652
|
+
"password", "application" or "accessCode". Valid for oauth2.
|
|
653
|
+
"""
|
|
654
|
+
|
|
655
|
+
authorization_url: str = betterproto.string_field(6)
|
|
656
|
+
"""
|
|
657
|
+
The authorization URL to be used for this flow. This SHOULD be in the form
|
|
658
|
+
of a URL. Valid for oauth2/implicit and oauth2/accessCode.
|
|
659
|
+
"""
|
|
660
|
+
|
|
661
|
+
token_url: str = betterproto.string_field(7)
|
|
662
|
+
"""
|
|
663
|
+
The token URL to be used for this flow. This SHOULD be in the form of a
|
|
664
|
+
URL. Valid for oauth2/password, oauth2/application and oauth2/accessCode.
|
|
665
|
+
"""
|
|
666
|
+
|
|
667
|
+
scopes: "Scopes" = betterproto.message_field(8)
|
|
668
|
+
"""
|
|
669
|
+
The available scopes for the OAuth2 security scheme. Valid for oauth2.
|
|
670
|
+
"""
|
|
671
|
+
|
|
672
|
+
extensions: Dict[
|
|
673
|
+
str, "betterproto_lib_google_protobuf.Value"
|
|
674
|
+
] = betterproto.map_field(9, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE)
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
@dataclass(eq=False, repr=False)
|
|
678
|
+
class SecurityRequirement(betterproto.Message):
|
|
679
|
+
"""
|
|
680
|
+
`SecurityRequirement` is a representation of OpenAPI v2 specification's
|
|
681
|
+
Security Requirement object. See: https://github.com/OAI/OpenAPI-
|
|
682
|
+
Specification/blob/3.0.0/versions/2.0.md#securityRequirementObject Lists
|
|
683
|
+
the required security schemes to execute this operation. The object can
|
|
684
|
+
have multiple security schemes declared in it which are all required (that
|
|
685
|
+
is, there is a logical AND between the schemes). The name used for each
|
|
686
|
+
property MUST correspond to a security scheme declared in the Security
|
|
687
|
+
Definitions.
|
|
688
|
+
"""
|
|
689
|
+
|
|
690
|
+
security_requirement: Dict[
|
|
691
|
+
str, "SecurityRequirementSecurityRequirementValue"
|
|
692
|
+
] = betterproto.map_field(1, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE)
|
|
693
|
+
"""
|
|
694
|
+
Each name must correspond to a security scheme which is declared in the
|
|
695
|
+
Security Definitions. If the security scheme is of type "oauth2", then the
|
|
696
|
+
value is a list of scope names required for the execution. For other
|
|
697
|
+
security scheme types, the array MUST be empty.
|
|
698
|
+
"""
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
@dataclass(eq=False, repr=False)
|
|
702
|
+
class SecurityRequirementSecurityRequirementValue(betterproto.Message):
|
|
703
|
+
"""
|
|
704
|
+
If the security scheme is of type "oauth2", then the value is a list of
|
|
705
|
+
scope names required for the execution. For other security scheme types,
|
|
706
|
+
the array MUST be empty.
|
|
707
|
+
"""
|
|
708
|
+
|
|
709
|
+
scope: List[str] = betterproto.string_field(1)
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
@dataclass(eq=False, repr=False)
|
|
713
|
+
class Scopes(betterproto.Message):
|
|
714
|
+
"""
|
|
715
|
+
`Scopes` is a representation of OpenAPI v2 specification's Scopes object.
|
|
716
|
+
See: https://github.com/OAI/OpenAPI-
|
|
717
|
+
Specification/blob/3.0.0/versions/2.0.md#scopesObject Lists the available
|
|
718
|
+
scopes for an OAuth2 security scheme.
|
|
719
|
+
"""
|
|
720
|
+
|
|
721
|
+
scope: Dict[str, str] = betterproto.map_field(
|
|
722
|
+
1, betterproto.TYPE_STRING, betterproto.TYPE_STRING
|
|
723
|
+
)
|
|
724
|
+
"""
|
|
725
|
+
Maps between a name of a scope to a short description of it (as the value
|
|
726
|
+
of the property).
|
|
727
|
+
"""
|