cx_api/generated/
grpc.gateway.protoc_gen_openapiv3.options.rs

1// This file is @generated by prost-build.
2/// `Swagger` is a representation of OpenAPI v2 specification's Swagger object.
3///
4/// See: <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#swaggerObject>
5///
6/// Example:
7///
8///   option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
9///     info: {
10///       title: "Echo API";
11///       version: "1.0";
12///       description: "";
13///       contact: {
14///         name: "gRPC-Gateway project";
15///         url: "<https://github.com/grpc-ecosystem/grpc-gateway";>
16///         email: "none@example.com";
17///       };
18///       license: {
19///         name: "BSD 3-Clause License";
20///         url: "<https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE";>
21///       };
22///     };
23///     schemes: HTTPS;
24///     consumes: "application/json";
25///     produces: "application/json";
26///   };
27///
28#[derive(serde::Serialize, serde::Deserialize)]
29#[serde(rename_all = "snake_case")]
30#[derive(Clone, PartialEq, ::prost::Message)]
31pub struct Swagger {
32    /// Specifies the OpenAPI Specification version being used. It can be
33    /// used by the OpenAPI UI and other clients to interpret the API listing. The
34    /// value MUST be "2.0".
35    #[prost(string, tag = "1")]
36    pub swagger: ::prost::alloc::string::String,
37    /// Provides metadata about the API. The metadata can be used by the
38    /// clients if needed.
39    #[prost(message, optional, tag = "2")]
40    pub info: ::core::option::Option<Info>,
41    /// The host (name or ip) serving the API. This MUST be the host only and does
42    /// not include the scheme nor sub-paths. It MAY include a port. If the host is
43    /// not included, the host serving the documentation is to be used (including
44    /// the port). The host does not support path templating.
45    #[prost(string, tag = "3")]
46    pub host: ::prost::alloc::string::String,
47    /// The base path on which the API is served, which is relative to the host. If
48    /// it is not included, the API is served directly under the host. The value
49    /// MUST start with a leading slash (/). The basePath does not support path
50    /// templating.
51    /// Note that using `base_path` does not change the endpoint paths that are
52    /// generated in the resulting OpenAPI file. If you wish to use `base_path`
53    /// with relatively generated OpenAPI paths, the `base_path` prefix must be
54    /// manually removed from your `google.api.http` paths and your code changed to
55    /// serve the API from the `base_path`.
56    #[prost(string, tag = "4")]
57    pub base_path: ::prost::alloc::string::String,
58    /// The transfer protocol of the API. Values MUST be from the list: "http",
59    /// "https", "ws", "wss". If the schemes is not included, the default scheme to
60    /// be used is the one used to access the OpenAPI definition itself.
61    #[prost(enumeration = "Scheme", repeated, tag = "5")]
62    pub schemes: ::prost::alloc::vec::Vec<i32>,
63    /// A list of MIME types the APIs can consume. This is global to all APIs but
64    /// can be overridden on specific API calls. Value MUST be as described under
65    /// Mime Types.
66    #[prost(string, repeated, tag = "6")]
67    pub consumes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
68    /// A list of MIME types the APIs can produce. This is global to all APIs but
69    /// can be overridden on specific API calls. Value MUST be as described under
70    /// Mime Types.
71    #[prost(string, repeated, tag = "7")]
72    pub produces: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
73    /// An object to hold responses that can be used across operations. This
74    /// property does not define global responses for all operations.
75    #[prost(map = "string, message", tag = "10")]
76    pub responses: ::std::collections::HashMap<::prost::alloc::string::String, Response>,
77    /// Security scheme definitions that can be used across the specification.
78    #[prost(message, optional, tag = "11")]
79    pub security_definitions: ::core::option::Option<SecurityDefinitions>,
80    /// A declaration of which security schemes are applied for the API as a whole.
81    /// The list of values describes alternative security schemes that can be used
82    /// (that is, there is a logical OR between the security requirements).
83    /// Individual operations can override this definition.
84    #[prost(message, repeated, tag = "12")]
85    pub security: ::prost::alloc::vec::Vec<SecurityRequirement>,
86    /// A list of tags for API documentation control. Tags can be used for logical
87    /// grouping of operations by resources or any other qualifier.
88    #[prost(message, repeated, tag = "13")]
89    pub tags: ::prost::alloc::vec::Vec<Tag>,
90    /// Additional external documentation.
91    #[prost(message, optional, tag = "14")]
92    pub external_docs: ::core::option::Option<ExternalDocumentation>,
93    /// Custom properties that start with "x-" such as "x-foo" used to describe
94    /// extra functionality that is not covered by the standard OpenAPI Specification.
95    /// See: <https://swagger.io/docs/specification/2-0/swagger-extensions/>
96    #[prost(map = "string, message", tag = "15")]
97    pub extensions: ::std::collections::HashMap<
98        ::prost::alloc::string::String,
99        ::prost_wkt_types::Value,
100    >,
101}
102/// `Operation` is a representation of OpenAPI v2 specification's Operation object.
103///
104/// See: <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#operationObject>
105///
106/// Example:
107///
108///   service EchoService {
109///     rpc Echo(SimpleMessage) returns (SimpleMessage) {
110///       option (google.api.http) = {
111///         get: "/v1/example/echo/{id}"
112///       };
113///
114///       option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
115///         summary: "Get a message.";
116///         operation_id: "getMessage";
117///         tags: "echo";
118///         responses: {
119///           key: "200"
120///             value: {
121///             description: "OK";
122///           }
123///         }
124///       };
125///     }
126///   }
127#[derive(serde::Serialize, serde::Deserialize)]
128#[serde(rename_all = "snake_case")]
129#[derive(Clone, PartialEq, ::prost::Message)]
130pub struct Operation {
131    /// A list of tags for API documentation control. Tags can be used for logical
132    /// grouping of operations by resources or any other qualifier.
133    #[prost(string, repeated, tag = "1")]
134    pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
135    /// A short summary of what the operation does. For maximum readability in the
136    /// swagger-ui, this field SHOULD be less than 120 characters.
137    #[prost(string, tag = "2")]
138    pub summary: ::prost::alloc::string::String,
139    /// A verbose explanation of the operation behavior. GFM syntax can be used for
140    /// rich text representation.
141    #[prost(string, tag = "3")]
142    pub description: ::prost::alloc::string::String,
143    /// Additional external documentation for this operation.
144    #[prost(message, optional, tag = "4")]
145    pub external_docs: ::core::option::Option<ExternalDocumentation>,
146    /// Unique string used to identify the operation. The id MUST be unique among
147    /// all operations described in the API. Tools and libraries MAY use the
148    /// operationId to uniquely identify an operation, therefore, it is recommended
149    /// to follow common programming naming conventions.
150    #[prost(string, tag = "5")]
151    pub operation_id: ::prost::alloc::string::String,
152    /// A list of MIME types the operation can consume. This overrides the consumes
153    /// definition at the OpenAPI Object. An empty value MAY be used to clear the
154    /// global definition. Value MUST be as described under Mime Types.
155    #[prost(string, repeated, tag = "6")]
156    pub consumes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
157    /// A list of MIME types the operation can produce. This overrides the produces
158    /// definition at the OpenAPI Object. An empty value MAY be used to clear the
159    /// global definition. Value MUST be as described under Mime Types.
160    #[prost(string, repeated, tag = "7")]
161    pub produces: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
162    /// The list of possible responses as they are returned from executing this
163    /// operation.
164    #[prost(map = "string, message", tag = "9")]
165    pub responses: ::std::collections::HashMap<::prost::alloc::string::String, Response>,
166    /// The transfer protocol for the operation. Values MUST be from the list:
167    /// "http", "https", "ws", "wss". The value overrides the OpenAPI Object
168    /// schemes definition.
169    #[prost(enumeration = "Scheme", repeated, tag = "10")]
170    pub schemes: ::prost::alloc::vec::Vec<i32>,
171    /// Declares this operation to be deprecated. Usage of the declared operation
172    /// should be refrained. Default value is false.
173    #[prost(bool, tag = "11")]
174    pub deprecated: bool,
175    /// A declaration of which security schemes are applied for this operation. The
176    /// list of values describes alternative security schemes that can be used
177    /// (that is, there is a logical OR between the security requirements). This
178    /// definition overrides any declared top-level security. To remove a top-level
179    /// security declaration, an empty array can be used.
180    #[prost(message, repeated, tag = "12")]
181    pub security: ::prost::alloc::vec::Vec<SecurityRequirement>,
182    /// Custom properties that start with "x-" such as "x-foo" used to describe
183    /// extra functionality that is not covered by the standard OpenAPI Specification.
184    /// See: <https://swagger.io/docs/specification/2-0/swagger-extensions/>
185    #[prost(map = "string, message", tag = "13")]
186    pub extensions: ::std::collections::HashMap<
187        ::prost::alloc::string::String,
188        ::prost_wkt_types::Value,
189    >,
190    /// Custom parameters such as HTTP request headers.
191    /// See: <https://swagger.io/docs/specification/2-0/describing-parameters/>
192    /// and <https://swagger.io/specification/v2/#parameter-object.>
193    #[prost(message, optional, tag = "14")]
194    pub parameters: ::core::option::Option<Parameters>,
195}
196/// `Parameters` is a representation of OpenAPI v2 specification's parameters object.
197/// Note: This technically breaks compatibility with the OpenAPI 2 definition structure as we only
198/// allow header parameters to be set here since we do not want users specifying custom non-header
199/// parameters beyond those inferred from the Protobuf schema.
200/// See: <https://swagger.io/specification/v2/#parameter-object>
201#[derive(serde::Serialize, serde::Deserialize)]
202#[serde(rename_all = "snake_case")]
203#[derive(Clone, PartialEq, ::prost::Message)]
204pub struct Parameters {
205    /// `Headers` is one or more HTTP header parameter.
206    /// See: <https://swagger.io/docs/specification/2-0/describing-parameters/#header-parameters>
207    #[prost(message, repeated, tag = "1")]
208    pub headers: ::prost::alloc::vec::Vec<HeaderParameter>,
209}
210/// `HeaderParameter` a HTTP header parameter.
211/// See: <https://swagger.io/specification/v2/#parameter-object>
212#[derive(serde::Serialize, serde::Deserialize)]
213#[serde(rename_all = "snake_case")]
214#[derive(Clone, PartialEq, ::prost::Message)]
215pub struct HeaderParameter {
216    /// `Name` is the header name.
217    #[prost(string, tag = "1")]
218    pub name: ::prost::alloc::string::String,
219    /// `Description` is a short description of the header.
220    #[prost(string, tag = "2")]
221    pub description: ::prost::alloc::string::String,
222    /// `Type` is the type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported.
223    /// See: <https://swagger.io/specification/v2/#parameterType.>
224    #[prost(enumeration = "header_parameter::Type", tag = "3")]
225    pub r#type: i32,
226    /// `Format` The extending format for the previously mentioned type.
227    #[prost(string, tag = "4")]
228    pub format: ::prost::alloc::string::String,
229    /// `Required` indicates if the header is optional
230    #[prost(bool, tag = "5")]
231    pub required: bool,
232}
233/// Nested message and enum types in `HeaderParameter`.
234pub mod header_parameter {
235    /// `Type` is a supported HTTP header type.
236    /// See <https://swagger.io/specification/v2/#parameterType.>
237    #[derive(serde::Serialize, serde::Deserialize)]
238    #[serde(rename_all = "snake_case")]
239    #[derive(
240        Clone,
241        Copy,
242        Debug,
243        PartialEq,
244        Eq,
245        Hash,
246        PartialOrd,
247        Ord,
248        ::prost::Enumeration
249    )]
250    #[repr(i32)]
251    pub enum Type {
252        Unknown = 0,
253        String = 1,
254        Number = 2,
255        Integer = 3,
256        Boolean = 4,
257    }
258    impl Type {
259        /// String value of the enum field names used in the ProtoBuf definition.
260        ///
261        /// The values are not transformed in any way and thus are considered stable
262        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
263        pub fn as_str_name(&self) -> &'static str {
264            match self {
265                Self::Unknown => "UNKNOWN",
266                Self::String => "STRING",
267                Self::Number => "NUMBER",
268                Self::Integer => "INTEGER",
269                Self::Boolean => "BOOLEAN",
270            }
271        }
272        /// Creates an enum from field names used in the ProtoBuf definition.
273        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
274            match value {
275                "UNKNOWN" => Some(Self::Unknown),
276                "STRING" => Some(Self::String),
277                "NUMBER" => Some(Self::Number),
278                "INTEGER" => Some(Self::Integer),
279                "BOOLEAN" => Some(Self::Boolean),
280                _ => None,
281            }
282        }
283    }
284}
285/// `Header` is a representation of OpenAPI v2 specification's Header object.
286///
287/// See: <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#headerObject>
288///
289#[derive(serde::Serialize, serde::Deserialize)]
290#[serde(rename_all = "snake_case")]
291#[derive(Clone, PartialEq, ::prost::Message)]
292pub struct Header {
293    /// `Description` is a short description of the header.
294    #[prost(string, tag = "1")]
295    pub description: ::prost::alloc::string::String,
296    /// The type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported.
297    #[prost(string, tag = "2")]
298    pub r#type: ::prost::alloc::string::String,
299    /// `Format` The extending format for the previously mentioned type.
300    #[prost(string, tag = "3")]
301    pub format: ::prost::alloc::string::String,
302    /// `Default` Declares the value of the header that the server will use if none is provided.
303    /// See: <https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2.>
304    /// Unlike JSON Schema this value MUST conform to the defined type for the header.
305    #[prost(string, tag = "6")]
306    pub default: ::prost::alloc::string::String,
307    /// 'Pattern' See <https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3.>
308    #[prost(string, tag = "13")]
309    pub pattern: ::prost::alloc::string::String,
310}
311/// `Response` is a representation of OpenAPI v2 specification's Response object.
312///
313/// See: <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#responseObject>
314///
315#[derive(serde::Serialize, serde::Deserialize)]
316#[serde(rename_all = "snake_case")]
317#[derive(Clone, PartialEq, ::prost::Message)]
318pub struct Response {
319    /// `Description` is a short description of the response.
320    /// GFM syntax can be used for rich text representation.
321    #[prost(string, tag = "1")]
322    pub description: ::prost::alloc::string::String,
323    /// `Schema` optionally defines the structure of the response.
324    /// If `Schema` is not provided, it means there is no content to the response.
325    #[prost(message, optional, tag = "2")]
326    pub schema: ::core::option::Option<Schema>,
327    /// `Headers` A list of headers that are sent with the response.
328    /// `Header` name is expected to be a string in the canonical format of the MIME header key
329    /// See: <https://golang.org/pkg/net/textproto/#CanonicalMIMEHeaderKey>
330    #[prost(map = "string, message", tag = "3")]
331    pub headers: ::std::collections::HashMap<::prost::alloc::string::String, Header>,
332    /// `Examples` gives per-mimetype response examples.
333    /// See: <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#example-object>
334    #[prost(map = "string, string", tag = "4")]
335    pub examples: ::std::collections::HashMap<
336        ::prost::alloc::string::String,
337        ::prost::alloc::string::String,
338    >,
339    /// Custom properties that start with "x-" such as "x-foo" used to describe
340    /// extra functionality that is not covered by the standard OpenAPI Specification.
341    /// See: <https://swagger.io/docs/specification/2-0/swagger-extensions/>
342    #[prost(map = "string, message", tag = "5")]
343    pub extensions: ::std::collections::HashMap<
344        ::prost::alloc::string::String,
345        ::prost_wkt_types::Value,
346    >,
347}
348/// `Info` is a representation of OpenAPI v2 specification's Info object.
349///
350/// See: <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#infoObject>
351///
352/// Example:
353///
354///   option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
355///     info: {
356///       title: "Echo API";
357///       version: "1.0";
358///       description: "";
359///       contact: {
360///         name: "gRPC-Gateway project";
361///         url: "<https://github.com/grpc-ecosystem/grpc-gateway";>
362///         email: "none@example.com";
363///       };
364///       license: {
365///         name: "BSD 3-Clause License";
366///         url: "<https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE";>
367///       };
368///     };
369///     ...
370///   };
371///
372#[derive(serde::Serialize, serde::Deserialize)]
373#[serde(rename_all = "snake_case")]
374#[derive(Clone, PartialEq, ::prost::Message)]
375pub struct Info {
376    /// The title of the application.
377    #[prost(string, tag = "1")]
378    pub title: ::prost::alloc::string::String,
379    /// A short description of the application. GFM syntax can be used for rich
380    /// text representation.
381    #[prost(string, tag = "2")]
382    pub description: ::prost::alloc::string::String,
383    /// The Terms of Service for the API.
384    #[prost(string, tag = "3")]
385    pub terms_of_service: ::prost::alloc::string::String,
386    /// The contact information for the exposed API.
387    #[prost(message, optional, tag = "4")]
388    pub contact: ::core::option::Option<Contact>,
389    /// The license information for the exposed API.
390    #[prost(message, optional, tag = "5")]
391    pub license: ::core::option::Option<License>,
392    /// Provides the version of the application API (not to be confused
393    /// with the specification version).
394    #[prost(string, tag = "6")]
395    pub version: ::prost::alloc::string::String,
396    /// Custom properties that start with "x-" such as "x-foo" used to describe
397    /// extra functionality that is not covered by the standard OpenAPI Specification.
398    /// See: <https://swagger.io/docs/specification/2-0/swagger-extensions/>
399    #[prost(map = "string, message", tag = "7")]
400    pub extensions: ::std::collections::HashMap<
401        ::prost::alloc::string::String,
402        ::prost_wkt_types::Value,
403    >,
404}
405/// `Contact` is a representation of OpenAPI v2 specification's Contact object.
406///
407/// See: <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#contactObject>
408///
409/// Example:
410///
411///   option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
412///     info: {
413///       ...
414///       contact: {
415///         name: "gRPC-Gateway project";
416///         url: "<https://github.com/grpc-ecosystem/grpc-gateway";>
417///         email: "none@example.com";
418///       };
419///       ...
420///     };
421///     ...
422///   };
423///
424#[derive(serde::Serialize, serde::Deserialize)]
425#[serde(rename_all = "snake_case")]
426#[derive(Clone, PartialEq, ::prost::Message)]
427pub struct Contact {
428    /// The identifying name of the contact person/organization.
429    #[prost(string, tag = "1")]
430    pub name: ::prost::alloc::string::String,
431    /// The URL pointing to the contact information. MUST be in the format of a
432    /// URL.
433    #[prost(string, tag = "2")]
434    pub url: ::prost::alloc::string::String,
435    /// The email address of the contact person/organization. MUST be in the format
436    /// of an email address.
437    #[prost(string, tag = "3")]
438    pub email: ::prost::alloc::string::String,
439}
440/// `License` is a representation of OpenAPI v2 specification's License object.
441///
442/// See: <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#licenseObject>
443///
444/// Example:
445///
446///   option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
447///     info: {
448///       ...
449///       license: {
450///         name: "BSD 3-Clause License";
451///         url: "<https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE";>
452///       };
453///       ...
454///     };
455///     ...
456///   };
457///
458#[derive(serde::Serialize, serde::Deserialize)]
459#[serde(rename_all = "snake_case")]
460#[derive(Clone, PartialEq, ::prost::Message)]
461pub struct License {
462    /// The license name used for the API.
463    #[prost(string, tag = "1")]
464    pub name: ::prost::alloc::string::String,
465    /// A URL to the license used for the API. MUST be in the format of a URL.
466    #[prost(string, tag = "2")]
467    pub url: ::prost::alloc::string::String,
468}
469/// `ExternalDocumentation` is a representation of OpenAPI v2 specification's
470/// ExternalDocumentation object.
471///
472/// See: <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#externalDocumentationObject>
473///
474/// Example:
475///
476///   option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
477///     ...
478///     external_docs: {
479///       description: "More about gRPC-Gateway";
480///       url: "<https://github.com/grpc-ecosystem/grpc-gateway";>
481///     }
482///     ...
483///   };
484///
485#[derive(serde::Serialize, serde::Deserialize)]
486#[serde(rename_all = "snake_case")]
487#[derive(Clone, PartialEq, ::prost::Message)]
488pub struct ExternalDocumentation {
489    /// A short description of the target documentation. GFM syntax can be used for
490    /// rich text representation.
491    #[prost(string, tag = "1")]
492    pub description: ::prost::alloc::string::String,
493    /// The URL for the target documentation. Value MUST be in the format
494    /// of a URL.
495    #[prost(string, tag = "2")]
496    pub url: ::prost::alloc::string::String,
497}
498/// `Schema` is a representation of OpenAPI v2 specification's Schema object.
499///
500/// See: <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject>
501///
502#[derive(serde::Serialize, serde::Deserialize)]
503#[serde(rename_all = "snake_case")]
504#[derive(Clone, PartialEq, ::prost::Message)]
505pub struct Schema {
506    #[prost(message, optional, tag = "1")]
507    pub json_schema: ::core::option::Option<JsonSchema>,
508    /// Adds support for polymorphism. The discriminator is the schema property
509    /// name that is used to differentiate between other schema that inherit this
510    /// schema. The property name used MUST be defined at this schema and it MUST
511    /// be in the required property list. When used, the value MUST be the name of
512    /// this schema or any schema that inherits it.
513    #[prost(string, tag = "2")]
514    pub discriminator: ::prost::alloc::string::String,
515    /// Relevant only for Schema "properties" definitions. Declares the property as
516    /// "read only". This means that it MAY be sent as part of a response but MUST
517    /// NOT be sent as part of the request. Properties marked as readOnly being
518    /// true SHOULD NOT be in the required list of the defined schema. Default
519    /// value is false.
520    #[prost(bool, tag = "3")]
521    pub read_only: bool,
522    /// Additional external documentation for this schema.
523    #[prost(message, optional, tag = "5")]
524    pub external_docs: ::core::option::Option<ExternalDocumentation>,
525    /// A free-form property to include an example of an instance for this schema in JSON.
526    /// This is copied verbatim to the output.
527    #[prost(string, tag = "6")]
528    pub example: ::prost::alloc::string::String,
529}
530/// `EnumSchema` is subset of fields from the OpenAPI v2 specification's Schema object.
531/// Only fields that are applicable to Enums are included
532/// See: <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject>
533///
534/// Example:
535///
536///   option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_enum) = {
537///     ...
538///     title: "MyEnum";
539///     description:"This is my nice enum";
540///     example: "ZERO";
541///     required: true;
542///     ...
543///   };
544///
545#[derive(serde::Serialize, serde::Deserialize)]
546#[serde(rename_all = "snake_case")]
547#[derive(Clone, PartialEq, ::prost::Message)]
548pub struct EnumSchema {
549    /// A short description of the schema.
550    #[prost(string, tag = "1")]
551    pub description: ::prost::alloc::string::String,
552    #[prost(string, tag = "2")]
553    pub default: ::prost::alloc::string::String,
554    /// The title of the schema.
555    #[prost(string, tag = "3")]
556    pub title: ::prost::alloc::string::String,
557    #[prost(bool, tag = "4")]
558    pub required: bool,
559    #[prost(bool, tag = "5")]
560    pub read_only: bool,
561    /// Additional external documentation for this schema.
562    #[prost(message, optional, tag = "6")]
563    pub external_docs: ::core::option::Option<ExternalDocumentation>,
564    #[prost(string, tag = "7")]
565    pub example: ::prost::alloc::string::String,
566    /// Ref is used to define an external reference to include in the message.
567    /// This could be a fully qualified proto message reference, and that type must
568    /// be imported into the protofile. If no message is identified, the Ref will
569    /// be used verbatim in the output.
570    /// For example:
571    ///   `ref: ".google.protobuf.Timestamp"`.
572    #[prost(string, tag = "8")]
573    pub r#ref: ::prost::alloc::string::String,
574    /// Custom properties that start with "x-" such as "x-foo" used to describe
575    /// extra functionality that is not covered by the standard OpenAPI Specification.
576    /// See: <https://swagger.io/docs/specification/2-0/swagger-extensions/>
577    #[prost(map = "string, message", tag = "9")]
578    pub extensions: ::std::collections::HashMap<
579        ::prost::alloc::string::String,
580        ::prost_wkt_types::Value,
581    >,
582}
583/// `JSONSchema` represents properties from JSON Schema taken, and as used, in
584/// the OpenAPI v2 spec.
585///
586/// This includes changes made by OpenAPI v2.
587///
588/// See: <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject>
589///
590/// See also: <https://cswr.github.io/JsonSchema/spec/basic_types/,>
591/// <https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json>
592///
593/// Example:
594///
595///   message SimpleMessage {
596///     option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
597///       json_schema: {
598///         title: "SimpleMessage"
599///         description: "A simple message."
600///         required: \["id"\]
601///       }
602///     };
603///
604///     // Id represents the message identifier.
605///     string id = 1; [
606///         (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
607///           description: "The unique identifier of the simple message."
608///         }];
609///   }
610///
611#[derive(serde::Serialize, serde::Deserialize)]
612#[serde(rename_all = "snake_case")]
613#[derive(Clone, PartialEq, ::prost::Message)]
614pub struct JsonSchema {
615    /// Ref is used to define an external reference to include in the message.
616    /// This could be a fully qualified proto message reference, and that type must
617    /// be imported into the protofile. If no message is identified, the Ref will
618    /// be used verbatim in the output.
619    /// For example:
620    ///   `ref: ".google.protobuf.Timestamp"`.
621    #[prost(string, tag = "3")]
622    pub r#ref: ::prost::alloc::string::String,
623    /// The title of the schema.
624    #[prost(string, tag = "5")]
625    pub title: ::prost::alloc::string::String,
626    /// A short description of the schema.
627    #[prost(string, tag = "6")]
628    pub description: ::prost::alloc::string::String,
629    #[prost(string, tag = "7")]
630    pub default: ::prost::alloc::string::String,
631    #[prost(bool, tag = "8")]
632    pub read_only: bool,
633    /// A free-form property to include a JSON example of this field. This is copied
634    /// verbatim to the output swagger.json. Quotes must be escaped.
635    /// This property is the same for 2.0 and 3.0.0 <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md#schemaObject>  <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject>
636    #[prost(string, tag = "9")]
637    pub example: ::prost::alloc::string::String,
638    #[prost(double, tag = "10")]
639    pub multiple_of: f64,
640    /// Maximum represents an inclusive upper limit for a numeric instance. The
641    /// value of MUST be a number,
642    #[prost(double, tag = "11")]
643    pub maximum: f64,
644    #[prost(bool, tag = "12")]
645    pub exclusive_maximum: bool,
646    /// minimum represents an inclusive lower limit for a numeric instance. The
647    /// value of MUST be a number,
648    #[prost(double, tag = "13")]
649    pub minimum: f64,
650    #[prost(bool, tag = "14")]
651    pub exclusive_minimum: bool,
652    #[prost(uint64, tag = "15")]
653    pub max_length: u64,
654    #[prost(uint64, tag = "16")]
655    pub min_length: u64,
656    #[prost(string, tag = "17")]
657    pub pattern: ::prost::alloc::string::String,
658    #[prost(uint64, tag = "20")]
659    pub max_items: u64,
660    #[prost(uint64, tag = "21")]
661    pub min_items: u64,
662    #[prost(bool, tag = "22")]
663    pub unique_items: bool,
664    #[prost(uint64, tag = "24")]
665    pub max_properties: u64,
666    #[prost(uint64, tag = "25")]
667    pub min_properties: u64,
668    #[prost(string, repeated, tag = "26")]
669    pub required: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
670    /// Items in 'array' must be unique.
671    #[prost(string, repeated, tag = "34")]
672    pub array: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
673    #[prost(enumeration = "json_schema::JsonSchemaSimpleTypes", repeated, tag = "35")]
674    pub r#type: ::prost::alloc::vec::Vec<i32>,
675    /// `Format`
676    #[prost(string, tag = "36")]
677    pub format: ::prost::alloc::string::String,
678    /// Items in `enum` must be unique <https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1>
679    #[prost(string, repeated, tag = "46")]
680    pub r#enum: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
681    /// Additional field level properties used when generating the OpenAPI v2 file.
682    #[prost(message, optional, tag = "1001")]
683    pub field_configuration: ::core::option::Option<json_schema::FieldConfiguration>,
684    /// Custom properties that start with "x-" such as "x-foo" used to describe
685    /// extra functionality that is not covered by the standard OpenAPI Specification.
686    /// See: <https://swagger.io/docs/specification/2-0/swagger-extensions/>
687    #[prost(map = "string, message", tag = "48")]
688    pub extensions: ::std::collections::HashMap<
689        ::prost::alloc::string::String,
690        ::prost_wkt_types::Value,
691    >,
692}
693/// Nested message and enum types in `JSONSchema`.
694pub mod json_schema {
695    /// 'FieldConfiguration' provides additional field level properties used when generating the OpenAPI v2 file.
696    /// These properties are not defined by OpenAPIv2, but they are used to control the generation.
697    #[derive(serde::Serialize, serde::Deserialize)]
698    #[serde(rename_all = "snake_case")]
699    #[derive(Clone, PartialEq, ::prost::Message)]
700    pub struct FieldConfiguration {
701        /// Alternative parameter name when used as path parameter. If set, this will
702        /// be used as the complete parameter name when this field is used as a path
703        /// parameter. Use this to avoid having auto generated path parameter names
704        /// for overlapping paths.
705        #[prost(string, tag = "47")]
706        pub path_param_name: ::prost::alloc::string::String,
707    }
708    #[derive(serde::Serialize, serde::Deserialize)]
709    #[serde(rename_all = "snake_case")]
710    #[derive(
711        Clone,
712        Copy,
713        Debug,
714        PartialEq,
715        Eq,
716        Hash,
717        PartialOrd,
718        Ord,
719        ::prost::Enumeration
720    )]
721    #[repr(i32)]
722    pub enum JsonSchemaSimpleTypes {
723        Unknown = 0,
724        Array = 1,
725        Boolean = 2,
726        Integer = 3,
727        Null = 4,
728        Number = 5,
729        Object = 6,
730        String = 7,
731    }
732    impl JsonSchemaSimpleTypes {
733        /// String value of the enum field names used in the ProtoBuf definition.
734        ///
735        /// The values are not transformed in any way and thus are considered stable
736        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
737        pub fn as_str_name(&self) -> &'static str {
738            match self {
739                Self::Unknown => "UNKNOWN",
740                Self::Array => "ARRAY",
741                Self::Boolean => "BOOLEAN",
742                Self::Integer => "INTEGER",
743                Self::Null => "NULL",
744                Self::Number => "NUMBER",
745                Self::Object => "OBJECT",
746                Self::String => "STRING",
747            }
748        }
749        /// Creates an enum from field names used in the ProtoBuf definition.
750        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
751            match value {
752                "UNKNOWN" => Some(Self::Unknown),
753                "ARRAY" => Some(Self::Array),
754                "BOOLEAN" => Some(Self::Boolean),
755                "INTEGER" => Some(Self::Integer),
756                "NULL" => Some(Self::Null),
757                "NUMBER" => Some(Self::Number),
758                "OBJECT" => Some(Self::Object),
759                "STRING" => Some(Self::String),
760                _ => None,
761            }
762        }
763    }
764}
765/// `Tag` is a representation of OpenAPI v2 specification's Tag object.
766///
767/// See: <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#tagObject>
768///
769#[derive(serde::Serialize, serde::Deserialize)]
770#[serde(rename_all = "snake_case")]
771#[derive(Clone, PartialEq, ::prost::Message)]
772pub struct Tag {
773    /// The name of the tag. Use it to allow override of the name of a
774    /// global Tag object, then use that name to reference the tag throughout the
775    /// OpenAPI file.
776    #[prost(string, tag = "1")]
777    pub name: ::prost::alloc::string::String,
778    /// A short description for the tag. GFM syntax can be used for rich text
779    /// representation.
780    #[prost(string, tag = "2")]
781    pub description: ::prost::alloc::string::String,
782    /// Additional external documentation for this tag.
783    #[prost(message, optional, tag = "3")]
784    pub external_docs: ::core::option::Option<ExternalDocumentation>,
785    /// Custom properties that start with "x-" such as "x-foo" used to describe
786    /// extra functionality that is not covered by the standard OpenAPI Specification.
787    /// See: <https://swagger.io/docs/specification/2-0/swagger-extensions/>
788    #[prost(map = "string, message", tag = "4")]
789    pub extensions: ::std::collections::HashMap<
790        ::prost::alloc::string::String,
791        ::prost_wkt_types::Value,
792    >,
793}
794/// `SecurityDefinitions` is a representation of OpenAPI v2 specification's
795/// Security Definitions object.
796///
797/// See: <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject>
798///
799/// A declaration of the security schemes available to be used in the
800/// specification. This does not enforce the security schemes on the operations
801/// and only serves to provide the relevant details for each scheme.
802#[derive(serde::Serialize, serde::Deserialize)]
803#[serde(rename_all = "snake_case")]
804#[derive(Clone, PartialEq, ::prost::Message)]
805pub struct SecurityDefinitions {
806    /// A single security scheme definition, mapping a "name" to the scheme it
807    /// defines.
808    #[prost(map = "string, message", tag = "1")]
809    pub security: ::std::collections::HashMap<
810        ::prost::alloc::string::String,
811        SecurityScheme,
812    >,
813}
814/// `SecurityScheme` is a representation of OpenAPI v2 specification's
815/// Security Scheme object.
816///
817/// See: <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securitySchemeObject>
818///
819/// Allows the definition of a security scheme that can be used by the
820/// operations. Supported schemes are basic authentication, an API key (either as
821/// a header or as a query parameter) and OAuth2's common flows (implicit,
822/// password, application and access code).
823#[derive(serde::Serialize, serde::Deserialize)]
824#[serde(rename_all = "snake_case")]
825#[derive(Clone, PartialEq, ::prost::Message)]
826pub struct SecurityScheme {
827    /// The type of the security scheme. Valid values are "basic",
828    /// "apiKey" or "oauth2".
829    #[prost(enumeration = "security_scheme::Type", tag = "1")]
830    pub r#type: i32,
831    /// A short description for security scheme.
832    #[prost(string, tag = "2")]
833    pub description: ::prost::alloc::string::String,
834    /// The name of the header or query parameter to be used.
835    /// Valid for apiKey.
836    #[prost(string, tag = "3")]
837    pub name: ::prost::alloc::string::String,
838    /// The location of the API key. Valid values are "query" or
839    /// "header".
840    /// Valid for apiKey.
841    #[prost(enumeration = "security_scheme::In", tag = "4")]
842    pub r#in: i32,
843    /// The flow used by the OAuth2 security scheme. Valid values are
844    /// "implicit", "password", "application" or "accessCode".
845    /// Valid for oauth2.
846    #[prost(enumeration = "security_scheme::Flow", tag = "5")]
847    pub flow: i32,
848    /// The authorization URL to be used for this flow. This SHOULD be in
849    /// the form of a URL.
850    /// Valid for oauth2/implicit and oauth2/accessCode.
851    #[prost(string, tag = "6")]
852    pub authorization_url: ::prost::alloc::string::String,
853    /// The token URL to be used for this flow. This SHOULD be in the
854    /// form of a URL.
855    /// Valid for oauth2/password, oauth2/application and oauth2/accessCode.
856    #[prost(string, tag = "7")]
857    pub token_url: ::prost::alloc::string::String,
858    /// The available scopes for the OAuth2 security scheme.
859    /// Valid for oauth2.
860    #[prost(message, optional, tag = "8")]
861    pub scopes: ::core::option::Option<Scopes>,
862    /// Custom properties that start with "x-" such as "x-foo" used to describe
863    /// extra functionality that is not covered by the standard OpenAPI Specification.
864    /// See: <https://swagger.io/docs/specification/2-0/swagger-extensions/>
865    #[prost(map = "string, message", tag = "9")]
866    pub extensions: ::std::collections::HashMap<
867        ::prost::alloc::string::String,
868        ::prost_wkt_types::Value,
869    >,
870}
871/// Nested message and enum types in `SecurityScheme`.
872pub mod security_scheme {
873    /// The type of the security scheme. Valid values are "basic",
874    /// "apiKey" or "oauth2".
875    #[derive(serde::Serialize, serde::Deserialize)]
876    #[serde(rename_all = "snake_case")]
877    #[derive(
878        Clone,
879        Copy,
880        Debug,
881        PartialEq,
882        Eq,
883        Hash,
884        PartialOrd,
885        Ord,
886        ::prost::Enumeration
887    )]
888    #[repr(i32)]
889    pub enum Type {
890        Invalid = 0,
891        Basic = 1,
892        ApiKey = 2,
893        Oauth2 = 3,
894    }
895    impl Type {
896        /// String value of the enum field names used in the ProtoBuf definition.
897        ///
898        /// The values are not transformed in any way and thus are considered stable
899        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
900        pub fn as_str_name(&self) -> &'static str {
901            match self {
902                Self::Invalid => "TYPE_INVALID",
903                Self::Basic => "TYPE_BASIC",
904                Self::ApiKey => "TYPE_API_KEY",
905                Self::Oauth2 => "TYPE_OAUTH2",
906            }
907        }
908        /// Creates an enum from field names used in the ProtoBuf definition.
909        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
910            match value {
911                "TYPE_INVALID" => Some(Self::Invalid),
912                "TYPE_BASIC" => Some(Self::Basic),
913                "TYPE_API_KEY" => Some(Self::ApiKey),
914                "TYPE_OAUTH2" => Some(Self::Oauth2),
915                _ => None,
916            }
917        }
918    }
919    /// The location of the API key. Valid values are "query" or "header".
920    #[derive(serde::Serialize, serde::Deserialize)]
921    #[serde(rename_all = "snake_case")]
922    #[derive(
923        Clone,
924        Copy,
925        Debug,
926        PartialEq,
927        Eq,
928        Hash,
929        PartialOrd,
930        Ord,
931        ::prost::Enumeration
932    )]
933    #[repr(i32)]
934    pub enum In {
935        Invalid = 0,
936        Query = 1,
937        Header = 2,
938    }
939    impl In {
940        /// String value of the enum field names used in the ProtoBuf definition.
941        ///
942        /// The values are not transformed in any way and thus are considered stable
943        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
944        pub fn as_str_name(&self) -> &'static str {
945            match self {
946                Self::Invalid => "IN_INVALID",
947                Self::Query => "IN_QUERY",
948                Self::Header => "IN_HEADER",
949            }
950        }
951        /// Creates an enum from field names used in the ProtoBuf definition.
952        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
953            match value {
954                "IN_INVALID" => Some(Self::Invalid),
955                "IN_QUERY" => Some(Self::Query),
956                "IN_HEADER" => Some(Self::Header),
957                _ => None,
958            }
959        }
960    }
961    /// The flow used by the OAuth2 security scheme. Valid values are
962    /// "implicit", "password", "application" or "accessCode".
963    #[derive(serde::Serialize, serde::Deserialize)]
964    #[serde(rename_all = "snake_case")]
965    #[derive(
966        Clone,
967        Copy,
968        Debug,
969        PartialEq,
970        Eq,
971        Hash,
972        PartialOrd,
973        Ord,
974        ::prost::Enumeration
975    )]
976    #[repr(i32)]
977    pub enum Flow {
978        Invalid = 0,
979        Implicit = 1,
980        Password = 2,
981        Application = 3,
982        AccessCode = 4,
983    }
984    impl Flow {
985        /// String value of the enum field names used in the ProtoBuf definition.
986        ///
987        /// The values are not transformed in any way and thus are considered stable
988        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
989        pub fn as_str_name(&self) -> &'static str {
990            match self {
991                Self::Invalid => "FLOW_INVALID",
992                Self::Implicit => "FLOW_IMPLICIT",
993                Self::Password => "FLOW_PASSWORD",
994                Self::Application => "FLOW_APPLICATION",
995                Self::AccessCode => "FLOW_ACCESS_CODE",
996            }
997        }
998        /// Creates an enum from field names used in the ProtoBuf definition.
999        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1000            match value {
1001                "FLOW_INVALID" => Some(Self::Invalid),
1002                "FLOW_IMPLICIT" => Some(Self::Implicit),
1003                "FLOW_PASSWORD" => Some(Self::Password),
1004                "FLOW_APPLICATION" => Some(Self::Application),
1005                "FLOW_ACCESS_CODE" => Some(Self::AccessCode),
1006                _ => None,
1007            }
1008        }
1009    }
1010}
1011/// `SecurityRequirement` is a representation of OpenAPI v2 specification's
1012/// Security Requirement object.
1013///
1014/// See: <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityRequirementObject>
1015///
1016/// Lists the required security schemes to execute this operation. The object can
1017/// have multiple security schemes declared in it which are all required (that
1018/// is, there is a logical AND between the schemes).
1019///
1020/// The name used for each property MUST correspond to a security scheme
1021/// declared in the Security Definitions.
1022#[derive(serde::Serialize, serde::Deserialize)]
1023#[serde(rename_all = "snake_case")]
1024#[derive(Clone, PartialEq, ::prost::Message)]
1025pub struct SecurityRequirement {
1026    /// Each name must correspond to a security scheme which is declared in
1027    /// the Security Definitions. If the security scheme is of type "oauth2",
1028    /// then the value is a list of scope names required for the execution.
1029    /// For other security scheme types, the array MUST be empty.
1030    #[prost(map = "string, message", tag = "1")]
1031    pub security_requirement: ::std::collections::HashMap<
1032        ::prost::alloc::string::String,
1033        security_requirement::SecurityRequirementValue,
1034    >,
1035}
1036/// Nested message and enum types in `SecurityRequirement`.
1037pub mod security_requirement {
1038    /// If the security scheme is of type "oauth2", then the value is a list of
1039    /// scope names required for the execution. For other security scheme types,
1040    /// the array MUST be empty.
1041    #[derive(serde::Serialize, serde::Deserialize)]
1042    #[serde(rename_all = "snake_case")]
1043    #[derive(Clone, PartialEq, ::prost::Message)]
1044    pub struct SecurityRequirementValue {
1045        #[prost(string, repeated, tag = "1")]
1046        pub scope: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1047    }
1048}
1049/// `Scopes` is a representation of OpenAPI v2 specification's Scopes object.
1050///
1051/// See: <https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#scopesObject>
1052///
1053/// Lists the available scopes for an OAuth2 security scheme.
1054#[derive(serde::Serialize, serde::Deserialize)]
1055#[serde(rename_all = "snake_case")]
1056#[derive(Clone, PartialEq, ::prost::Message)]
1057pub struct Scopes {
1058    /// Maps between a name of a scope to a short description of it (as the value
1059    /// of the property).
1060    #[prost(map = "string, string", tag = "1")]
1061    pub scope: ::std::collections::HashMap<
1062        ::prost::alloc::string::String,
1063        ::prost::alloc::string::String,
1064    >,
1065}
1066/// Scheme describes the schemes supported by the OpenAPI Swagger
1067/// and Operation objects.
1068#[derive(serde::Serialize, serde::Deserialize)]
1069#[serde(rename_all = "snake_case")]
1070#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1071#[repr(i32)]
1072pub enum Scheme {
1073    Unknown = 0,
1074    Http = 1,
1075    Https = 2,
1076    Ws = 3,
1077    Wss = 4,
1078}
1079impl Scheme {
1080    /// String value of the enum field names used in the ProtoBuf definition.
1081    ///
1082    /// The values are not transformed in any way and thus are considered stable
1083    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1084    pub fn as_str_name(&self) -> &'static str {
1085        match self {
1086            Self::Unknown => "UNKNOWN",
1087            Self::Http => "HTTP",
1088            Self::Https => "HTTPS",
1089            Self::Ws => "WS",
1090            Self::Wss => "WSS",
1091        }
1092    }
1093    /// Creates an enum from field names used in the ProtoBuf definition.
1094    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1095        match value {
1096            "UNKNOWN" => Some(Self::Unknown),
1097            "HTTP" => Some(Self::Http),
1098            "HTTPS" => Some(Self::Https),
1099            "WS" => Some(Self::Ws),
1100            "WSS" => Some(Self::Wss),
1101            _ => None,
1102        }
1103    }
1104}