cx_api/generated/
com.coralogix.openapi.v1.rs

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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
// This file is @generated by prost-build.
/// ServiceOpenAPI is a message used to annotate gRPC services with additional
/// OpenAPI-specific metadata. This includes service description, version, and
/// and error model full qualified name.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceOpenApi {
    /// Description of the service.
    #[prost(string, tag = "1")]
    pub description: ::prost::alloc::string::String,
    /// Version of the service.
    #[prost(string, tag = "2")]
    pub version: ::prost::alloc::string::String,
    /// Full qualified name of error model used by the service (defaults to com.coralogix.openapi.ApiError).
    #[prost(string, tag = "3")]
    pub error_model: ::prost::alloc::string::String,
    /// Name of the resource used in openapi spec.
    #[prost(string, tag = "4")]
    pub resource_name: ::prost::alloc::string::String,
}
/// MethodOpenAPI is a message used to annotate gRPC methods with additional
/// OpenAPI-specific metadata. This includes whether the method operates on a REST resource,
/// its description, request schema, error responses, and the index of the HTTP rule where endpoints is defined.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MethodOpenApi {
    /// Indicates if the method operates on a REST resource.
    #[prost(bool, tag = "1")]
    pub resource: bool,
    /// Description of the method.
    #[prost(string, tag = "3")]
    pub description: ::prost::alloc::string::String,
    /// Schema of the request message. (Used when you want to use different schema than the one that will be generated from method request mesage type).
    #[prost(string, tag = "4")]
    pub request_schema: ::prost::alloc::string::String,
    /// Schema of the response message. (Used when you want to use different schema than the one that will be generated from method response mesage type).
    #[prost(string, tag = "5")]
    pub response_schema: ::prost::alloc::string::String,
    /// Map of error response codes to descriptions.
    #[prost(map = "uint32, string", tag = "6")]
    pub error_responses: ::std::collections::HashMap<
        u32,
        ::prost::alloc::string::String,
    >,
    /// Index of the associated HTTP rule.
    #[prost(uint32, tag = "7")]
    pub http_rule_index: u32,
    /// Name of the path parameter used in openapi spec.
    #[prost(string, tag = "8")]
    pub path_parameter_name: ::prost::alloc::string::String,
    /// Map of extensions. Value is a free-form property to include a JSON of this field. This is copied to generated schema. Quotes must be escaped.
    #[prost(map = "string, string", tag = "9")]
    pub extensions: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// Indicates if the method is a datasource.
    #[prost(bool, tag = "10")]
    pub datasource: bool,
}
/// MessageOpenAPI is a message used to annotate gRPC message types with additional
/// OpenAPI-specific metadata, such as description and whether the message is a REST resource.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessageOpenApi {
    /// Name of the message.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Description of the message.
    #[prost(string, tag = "2")]
    pub description: ::prost::alloc::string::String,
    /// Indicates if the message is a REST resource.
    #[prost(bool, tag = "3")]
    pub resource: bool,
    /// Map of extensions. Value is a free-form property to include a JSON of this field. This is copied to generated schema. Quotes must be escaped.
    #[prost(map = "string, string", tag = "4")]
    pub extensions: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EnumOpenApi {
    /// Name of the enum.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Description of the enum.
    #[prost(string, tag = "2")]
    pub description: ::prost::alloc::string::String,
    /// Map of extensions. Value is a free-form property to include a JSON of this field. This is copied to generated schema. Quotes must be escaped.
    #[prost(map = "string, string", tag = "3")]
    pub extensions: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
/// FieldOpenAPI is a message used to annotate fields within gRPC message types
/// with additional OpenAPI-specific metadata. This includes field descriptions,
/// examples, validation patterns, length constraints, and other properties.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FieldOpenApi {
    /// Used for renaming field in OpenAPI schema.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Description of the field. Defaults to the field name.
    #[prost(string, tag = "2")]
    pub description: ::prost::alloc::string::String,
    /// A free-form property to include a JSON example of this field. This is copied to generated schema. Quotes must be escaped.
    #[prost(string, tag = "3")]
    pub example: ::prost::alloc::string::String,
    /// Regex pattern the field value should match.
    #[prost(string, tag = "4")]
    pub pattern: ::prost::alloc::string::String,
    /// Minimum length for string fields. Defaults to 1.
    #[prost(int32, tag = "5")]
    pub min_length: i32,
    /// Maximum length for string fields. Defaults to 4096.
    #[prost(int32, tag = "6")]
    pub max_length: i32,
    /// Minimum number of items for repeated fields. Defaults to 1.
    #[prost(int32, tag = "7")]
    pub min_items: i32,
    /// Maximum number of items for repeated fields. Defaults to 4096.
    #[prost(int32, tag = "8")]
    pub max_items: i32,
    /// Indicates if the field is required.
    #[prost(bool, tag = "9")]
    pub required: bool,
    /// Indicates if the field is an identifier.
    #[prost(bool, tag = "10")]
    pub identifier: bool,
    /// Format of the field.
    #[prost(string, tag = "11")]
    pub format: ::prost::alloc::string::String,
}
/// ApiError is a message representing a standardized error response format.
/// It contains a list of individual errors, a trace identifier, and a status code.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApiError {
    #[prost(message, repeated, tag = "1")]
    pub errors: ::prost::alloc::vec::Vec<api_error::Error>,
    #[prost(message, optional, tag = "2")]
    pub trace: ::core::option::Option<::prost::alloc::string::String>,
    /// HTTP status code associated with the error.
    #[prost(message, optional, tag = "3")]
    pub status_code: ::core::option::Option<i32>,
}
/// Nested message and enum types in `ApiError`.
pub mod api_error {
    /// Nested message Error representing a single error occurrence.
    #[derive(serde::Serialize, serde::Deserialize)]
    #[serde(rename_all = "snake_case")]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Error {
        #[prost(enumeration = "error::ErrorCode", tag = "1")]
        pub code: i32,
        /// Human-readable error message.
        #[prost(message, optional, tag = "2")]
        pub message: ::core::option::Option<::prost::alloc::string::String>,
        /// Additional information about the error.
        #[prost(message, optional, tag = "3")]
        pub more_info: ::core::option::Option<::prost::alloc::string::String>,
    }
    /// Nested message and enum types in `Error`.
    pub mod error {
        /// Enum ErorCode defining possible error codes.
        #[derive(serde::Serialize, serde::Deserialize)]
        #[serde(rename_all = "snake_case")]
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum ErrorCode {
            BadRequestOrUnspecified = 0,
            Unauthorized = 1,
            Forbidden = 2,
            NotFound = 3,
            MethodInternalError = 4,
            Conflict = 5,
            Unauthenticated = 6,
            ResourceExhausted = 7,
            DeadlineExceeded = 8,
        }
        impl ErrorCode {
            /// String value of the enum field names used in the ProtoBuf definition.
            ///
            /// The values are not transformed in any way and thus are considered stable
            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
            pub fn as_str_name(&self) -> &'static str {
                match self {
                    Self::BadRequestOrUnspecified => {
                        "ERROR_CODE_BAD_REQUEST_OR_UNSPECIFIED"
                    }
                    Self::Unauthorized => "ERROR_CODE_UNAUTHORIZED",
                    Self::Forbidden => "ERROR_CODE_FORBIDDEN",
                    Self::NotFound => "ERROR_CODE_NOT_FOUND",
                    Self::MethodInternalError => "ERROR_CODE_METHOD_INTERNAL_ERROR",
                    Self::Conflict => "ERROR_CODE_CONFLICT",
                    Self::Unauthenticated => "ERROR_CODE_UNAUTHENTICATED",
                    Self::ResourceExhausted => "ERROR_CODE_RESOURCE_EXHAUSTED",
                    Self::DeadlineExceeded => "ERROR_CODE_DEADLINE_EXCEEDED",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "ERROR_CODE_BAD_REQUEST_OR_UNSPECIFIED" => {
                        Some(Self::BadRequestOrUnspecified)
                    }
                    "ERROR_CODE_UNAUTHORIZED" => Some(Self::Unauthorized),
                    "ERROR_CODE_FORBIDDEN" => Some(Self::Forbidden),
                    "ERROR_CODE_NOT_FOUND" => Some(Self::NotFound),
                    "ERROR_CODE_METHOD_INTERNAL_ERROR" => Some(Self::MethodInternalError),
                    "ERROR_CODE_CONFLICT" => Some(Self::Conflict),
                    "ERROR_CODE_UNAUTHENTICATED" => Some(Self::Unauthenticated),
                    "ERROR_CODE_RESOURCE_EXHAUSTED" => Some(Self::ResourceExhausted),
                    "ERROR_CODE_DEADLINE_EXCEEDED" => Some(Self::DeadlineExceeded),
                    _ => None,
                }
            }
        }
    }
}