Skip to main content

function_sdk_rust/generated/
v1.rs

1// This file is @generated by prost-build.
2/// A RunFunctionRequest requests that the function be run.
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct RunFunctionRequest {
5    /// Metadata pertaining to this request.
6    #[prost(message, optional, tag = "1")]
7    pub meta: ::core::option::Option<RequestMeta>,
8    /// The observed state prior to invocation of a function pipeline. State passed
9    /// to each function is fresh as of the time the pipeline was invoked, not as
10    /// of the time each function was invoked.
11    #[prost(message, optional, tag = "2")]
12    pub observed: ::core::option::Option<State>,
13    /// Desired state according to a function pipeline. The state passed to a
14    /// particular function may have been accumulated by previous functions in the
15    /// pipeline.
16    ///
17    /// Note that the desired state must be a partial object with only the fields
18    /// that this function (and its predecessors in the pipeline) wants to have set
19    /// in the object. Copying a non-partial observed state to desired is most
20    /// likely not what you want to do. Leaving out fields that had been returned
21    /// as desired before will result in them being deleted from the objects in the
22    /// cluster.
23    #[prost(message, optional, tag = "3")]
24    pub desired: ::core::option::Option<State>,
25    /// Optional input specific to this function invocation. A JSON representation
26    /// of the 'input' block of the relevant entry in a function pipeline.
27    #[prost(message, optional, tag = "4")]
28    pub input: ::core::option::Option<::pbjson_types::Struct>,
29    /// Optional context. Crossplane may pass arbitrary contextual information to a
30    /// function. A function may also return context in its RunFunctionResponse,
31    /// and that context will be passed to subsequent functions. Crossplane
32    /// discards all context returned by the last function in the pipeline.
33    #[prost(message, optional, tag = "5")]
34    pub context: ::core::option::Option<::pbjson_types::Struct>,
35    /// Optional resources that the function specified in its requirements. Note
36    /// that resources is a map to Resources, plural. The map key corresponds to
37    /// the key in a RunFunctionResponse's requirements.extra_resources field. If a
38    /// function requested extra resources that did not exist, Crossplane sets
39    /// the map key to an empty Resources message to indicate that it attempted to
40    /// satisfy the request. This field is only populated when the function uses
41    /// extra_resources in its requirements.
42    ///
43    /// Deprecated: Use required_resources instead.
44    #[prost(map = "string, message", tag = "6")]
45    pub extra_resources: ::std::collections::HashMap<
46        ::prost::alloc::string::String,
47        Resources,
48    >,
49    /// Optional credentials that this function may use to communicate with an
50    /// external system.
51    #[prost(map = "string, message", tag = "7")]
52    pub credentials: ::std::collections::HashMap<
53        ::prost::alloc::string::String,
54        Credentials,
55    >,
56    /// Optional resources that the function specified in its requirements. Note
57    /// that resources is a map to Resources, plural. The map key corresponds to
58    /// the key in a RunFunctionResponse's requirements.resources field. If a
59    /// function requested required resources that did not exist, Crossplane sets
60    /// the map key to an empty Resources message to indicate that it attempted to
61    /// satisfy the request. This field is only populated when the function uses
62    /// resources in its requirements.
63    #[prost(map = "string, message", tag = "8")]
64    pub required_resources: ::std::collections::HashMap<
65        ::prost::alloc::string::String,
66        Resources,
67    >,
68    /// Optional schemas that the function specified in its requirements. The map
69    /// key corresponds to the key in a RunFunctionResponse's requirements.schemas
70    /// field. If a function requested a schema that could not be found, Crossplane
71    /// sets the map key to an empty Schema message to indicate that it attempted
72    /// to satisfy the request.
73    #[prost(map = "string, message", tag = "9")]
74    pub required_schemas: ::std::collections::HashMap<
75        ::prost::alloc::string::String,
76        Schema,
77    >,
78}
79/// Credentials that a function may use to communicate with an external system.
80#[derive(Clone, PartialEq, ::prost::Message)]
81pub struct Credentials {
82    /// Source of the credentials.
83    #[prost(oneof = "credentials::Source", tags = "1")]
84    pub source: ::core::option::Option<credentials::Source>,
85}
86/// Nested message and enum types in `Credentials`.
87pub mod credentials {
88    /// Source of the credentials.
89    #[derive(Clone, PartialEq, ::prost::Oneof)]
90    pub enum Source {
91        /// Credential data loaded by Crossplane, for example from a Secret.
92        #[prost(message, tag = "1")]
93        CredentialData(super::CredentialData),
94    }
95}
96/// CredentialData loaded by Crossplane, for example from a Secret.
97#[derive(Clone, PartialEq, ::prost::Message)]
98pub struct CredentialData {
99    #[prost(map = "string, bytes", tag = "1")]
100    pub data: ::std::collections::HashMap<
101        ::prost::alloc::string::String,
102        ::prost::alloc::vec::Vec<u8>,
103    >,
104}
105/// Resources represents the state of several Crossplane resources.
106#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct Resources {
108    #[prost(message, repeated, tag = "1")]
109    pub items: ::prost::alloc::vec::Vec<Resource>,
110}
111/// A RunFunctionResponse contains the result of a function run.
112#[derive(Clone, PartialEq, ::prost::Message)]
113pub struct RunFunctionResponse {
114    /// Metadata pertaining to this response.
115    #[prost(message, optional, tag = "1")]
116    pub meta: ::core::option::Option<ResponseMeta>,
117    /// Desired state according to a function pipeline. functions may add desired
118    /// state, and may mutate or delete any part of the desired state they are
119    /// concerned with. A function must pass through any part of the desired state
120    /// that it is not concerned with.
121    ///
122    /// Note that the desired state must be a partial object with only the fields
123    /// that this function (and its predecessors in the pipeline) wants to have set
124    /// in the object. Copying a non-partial observed state to desired is most
125    /// likely not what you want to do. Leaving out fields that had been returned
126    /// as desired before will result in them being deleted from the objects in the
127    /// cluster.
128    #[prost(message, optional, tag = "2")]
129    pub desired: ::core::option::Option<State>,
130    /// Results of the function run. Results are used for observability purposes.
131    #[prost(message, repeated, tag = "3")]
132    pub results: ::prost::alloc::vec::Vec<Result>,
133    /// Optional context to be passed to the next function in the pipeline as part
134    /// of the RunFunctionRequest. Dropped on the last function in the pipeline.
135    #[prost(message, optional, tag = "4")]
136    pub context: ::core::option::Option<::pbjson_types::Struct>,
137    /// Requirements that must be satisfied for this function to run successfully.
138    #[prost(message, optional, tag = "5")]
139    pub requirements: ::core::option::Option<Requirements>,
140    /// Status conditions to be applied to the XR. Conditions may also optionally
141    /// be applied to the XR's associated claim.
142    ///
143    /// Conditions are only used for composition. They're ignored by Operations.
144    #[prost(message, repeated, tag = "6")]
145    pub conditions: ::prost::alloc::vec::Vec<Condition>,
146    /// Optional output specific to this function invocation.
147    ///
148    /// Only Operations use function output. XRs will discard any function output.
149    #[prost(message, optional, tag = "7")]
150    pub output: ::core::option::Option<::pbjson_types::Struct>,
151}
152/// RequestMeta contains metadata pertaining to a RunFunctionRequest.
153#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
154pub struct RequestMeta {
155    /// An opaque string identifying a request. Requests with identical tags will
156    /// be otherwise identical.
157    #[prost(string, tag = "1")]
158    pub tag: ::prost::alloc::string::String,
159    /// Capabilities supported by this version of Crossplane. Functions may use
160    /// this to determine whether Crossplane will honor certain fields in their
161    /// response, or populate certain fields in their request.
162    #[prost(enumeration = "Capability", repeated, tag = "2")]
163    pub capabilities: ::prost::alloc::vec::Vec<i32>,
164}
165/// Requirements that must be satisfied for a function to run successfully.
166#[derive(Clone, PartialEq, ::prost::Message)]
167pub struct Requirements {
168    /// Resources that this function requires. The map key uniquely identifies the
169    /// group of resources.
170    ///
171    /// Deprecated: Use resources instead.
172    #[prost(map = "string, message", tag = "1")]
173    pub extra_resources: ::std::collections::HashMap<
174        ::prost::alloc::string::String,
175        ResourceSelector,
176    >,
177    /// Resources that this function requires. The map key uniquely identifies the
178    /// group of resources.
179    #[prost(map = "string, message", tag = "2")]
180    pub resources: ::std::collections::HashMap<
181        ::prost::alloc::string::String,
182        ResourceSelector,
183    >,
184    /// Schemas that this function requires. The map key uniquely identifies the
185    /// schema request.
186    #[prost(map = "string, message", tag = "3")]
187    pub schemas: ::std::collections::HashMap<
188        ::prost::alloc::string::String,
189        SchemaSelector,
190    >,
191}
192/// SchemaSelector identifies a resource kind whose OpenAPI schema is requested.
193#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
194pub struct SchemaSelector {
195    /// API version of the resource kind, e.g. "example.org/v1".
196    #[prost(string, tag = "1")]
197    pub api_version: ::prost::alloc::string::String,
198    /// Kind of resource, e.g. "MyResource".
199    #[prost(string, tag = "2")]
200    pub kind: ::prost::alloc::string::String,
201}
202/// Schema represents the OpenAPI schema for a resource kind.
203#[derive(Clone, PartialEq, ::prost::Message)]
204pub struct Schema {
205    /// The OpenAPI v3 schema of the resource kind as unstructured JSON.
206    /// For CRDs this is the spec.versions\[\].schema.openAPIV3Schema field.
207    /// Empty if Crossplane could not find a schema for the requested kind.
208    #[prost(message, optional, tag = "1")]
209    pub openapi_v3: ::core::option::Option<::pbjson_types::Struct>,
210}
211/// ResourceSelector selects a group of resources, either by name or by label.
212#[derive(Clone, PartialEq, ::prost::Message)]
213pub struct ResourceSelector {
214    /// API version of resources to select.
215    #[prost(string, tag = "1")]
216    pub api_version: ::prost::alloc::string::String,
217    /// Kind of resources to select.
218    #[prost(string, tag = "2")]
219    pub kind: ::prost::alloc::string::String,
220    /// Match resources in this namespace. Omit namespace to match cluster scoped
221    /// resources, or to match namespaced resources by labels across all
222    /// namespaces.
223    #[prost(string, optional, tag = "5")]
224    pub namespace: ::core::option::Option<::prost::alloc::string::String>,
225    /// Resources to match.
226    #[prost(oneof = "resource_selector::Match", tags = "3, 4")]
227    pub r#match: ::core::option::Option<resource_selector::Match>,
228}
229/// Nested message and enum types in `ResourceSelector`.
230pub mod resource_selector {
231    /// Resources to match.
232    #[derive(Clone, PartialEq, ::prost::Oneof)]
233    pub enum Match {
234        /// Match the resource with this name.
235        #[prost(string, tag = "3")]
236        MatchName(::prost::alloc::string::String),
237        /// Match all resources with these labels.
238        #[prost(message, tag = "4")]
239        MatchLabels(super::MatchLabels),
240    }
241}
242/// MatchLabels defines a set of labels to match resources against.
243#[derive(Clone, PartialEq, ::prost::Message)]
244pub struct MatchLabels {
245    #[prost(map = "string, string", tag = "1")]
246    pub labels: ::std::collections::HashMap<
247        ::prost::alloc::string::String,
248        ::prost::alloc::string::String,
249    >,
250}
251/// ResponseMeta contains metadata pertaining to a RunFunctionResponse.
252#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
253pub struct ResponseMeta {
254    /// An opaque string identifying the content of the request. Must match the
255    /// meta.tag of the corresponding RunFunctionRequest.
256    #[prost(string, tag = "1")]
257    pub tag: ::prost::alloc::string::String,
258    /// Time-to-live of this response. Crossplane will call the function again when
259    /// the TTL expires. Crossplane may cache the response to avoid calling the
260    /// function again until the TTL expires.
261    #[prost(message, optional, tag = "2")]
262    pub ttl: ::core::option::Option<::pbjson_types::Duration>,
263}
264/// State of the XR (XR) and any resources.
265#[derive(Clone, PartialEq, ::prost::Message)]
266pub struct State {
267    /// The state of the XR (XR).
268    #[prost(message, optional, tag = "1")]
269    pub composite: ::core::option::Option<Resource>,
270    /// The state of any other resources. In composition functions these are the
271    /// composed resources. In operation functions they're arbitrary resources that
272    /// the operation wants to create or update.
273    #[prost(map = "string, message", tag = "2")]
274    pub resources: ::std::collections::HashMap<::prost::alloc::string::String, Resource>,
275}
276/// A Resource represents the state of a Kubernetes resource.
277#[derive(Clone, PartialEq, ::prost::Message)]
278pub struct Resource {
279    /// The JSON representation of the resource.
280    ///
281    /// * Crossplane will set this field in a RunFunctionRequest to the entire
282    ///   observed state of a resource - including its metadata, spec, and status.
283    ///
284    /// * A function should set this field in a RunFunctionRequest to communicate
285    ///   the desired state of the resource.
286    ///
287    /// * A function may only specify the desired status of a XR - not its metadata
288    ///   or spec. A function should not return desired metadata or spec for a XR.
289    ///   This will be ignored.
290    ///
291    /// * A function may not specify the desired status of any other resource -
292    ///   e.g. composed resources. It may only specify their metadata and spec.
293    ///   Status will be ignored.
294    #[prost(message, optional, tag = "1")]
295    pub resource: ::core::option::Option<::pbjson_types::Struct>,
296    /// The resource's connection details.
297    ///
298    /// * Crossplane will set this field in a RunFunctionRequest to communicate the
299    ///   the observed connection details of a composite or composed resource.
300    ///
301    /// * A function should set this field in a RunFunctionResponse to indicate the
302    ///   desired connection details of legacy XRs. For modern XRs, this will be ignored.
303    ///
304    /// * A function should not set this field in a RunFunctionResponse to indicate
305    ///   the desired connection details of a composed resource. This will be
306    ///   ignored.
307    ///
308    /// Connection details are only used for composition. They're ignored by
309    /// Operations.
310    #[prost(map = "string, bytes", tag = "2")]
311    pub connection_details: ::std::collections::HashMap<
312        ::prost::alloc::string::String,
313        ::prost::alloc::vec::Vec<u8>,
314    >,
315    /// Ready indicates whether the resource should be considered ready.
316    ///
317    /// * Crossplane will never set this field in a RunFunctionRequest.
318    ///
319    /// * A function should set this field to READY_TRUE in a RunFunctionResponse
320    ///   to indicate that a desired resource is ready.
321    ///
322    /// * A function should set this field to READY_TRUE in a RunFunctionResponse
323    ///   to indicate that a desired XR is ready. This overwrites the standard
324    ///   readiness detection that determines the ready state of the composite by the
325    ///   ready state of the composed resources.
326    ///
327    /// Ready is only used for composition. It's ignored by Operations.
328    #[prost(enumeration = "Ready", tag = "3")]
329    pub ready: i32,
330}
331/// A Result of running a function.
332#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
333pub struct Result {
334    /// Severity of this result.
335    #[prost(enumeration = "Severity", tag = "1")]
336    pub severity: i32,
337    /// Human-readable details about the result.
338    #[prost(string, tag = "2")]
339    pub message: ::prost::alloc::string::String,
340    /// Optional PascalCase, machine-readable reason for this result. If omitted,
341    /// the value will be ComposeResources.
342    #[prost(string, optional, tag = "3")]
343    pub reason: ::core::option::Option<::prost::alloc::string::String>,
344    /// The resources this result targets.
345    #[prost(enumeration = "Target", optional, tag = "4")]
346    pub target: ::core::option::Option<i32>,
347}
348/// Status condition to be applied to the XR. Condition may also optionally be
349/// applied to the XR's associated claim. For detailed information on proper
350/// usage of status conditions, please see
351/// <https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties.>
352#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
353pub struct Condition {
354    /// Type of condition in PascalCase.
355    #[prost(string, tag = "1")]
356    pub r#type: ::prost::alloc::string::String,
357    /// Status of the condition.
358    #[prost(enumeration = "Status", tag = "2")]
359    pub status: i32,
360    /// Reason contains a programmatic identifier indicating the reason for the
361    /// condition's last transition. Producers of specific condition types may
362    /// define expected values and meanings for this field, and whether the values
363    /// are considered a guaranteed API. The value should be a PascalCase string.
364    /// This field may not be empty.
365    #[prost(string, tag = "3")]
366    pub reason: ::prost::alloc::string::String,
367    /// Message is a human readable message indicating details about the
368    /// transition. This may be an empty string.
369    #[prost(string, optional, tag = "4")]
370    pub message: ::core::option::Option<::prost::alloc::string::String>,
371    /// The resources this condition targets.
372    #[prost(enumeration = "Target", optional, tag = "5")]
373    pub target: ::core::option::Option<i32>,
374}
375/// Capability indicates that Crossplane supports a particular feature.
376/// Functions can check for capabilities to determine whether Crossplane will
377/// honor a particular request or response field.
378#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
379#[repr(i32)]
380pub enum Capability {
381    Unspecified = 0,
382    /// Crossplane sends capabilities in RequestMeta. If this capability is
383    /// present, the function knows that if another capability is absent, it's
384    /// because Crossplane doesn't support it (not because Crossplane predates
385    /// capability advertisement). Added in Crossplane v2.2.
386    Capabilities = 1,
387    /// Crossplane supports the requirements.resources field. Functions can return
388    /// resource requirements and Crossplane will fetch the requested resources and
389    /// return them in required_resources. Added in Crossplane v1.15.
390    RequiredResources = 2,
391    /// Crossplane supports the credentials field. Functions can receive
392    /// credentials from secrets specified in the Composition. Added in Crossplane
393    /// v1.16.
394    Credentials = 3,
395    /// Crossplane supports the conditions field. Functions can return status
396    /// conditions to be applied to the XR and optionally its claim. Added in
397    /// Crossplane v1.17.
398    Conditions = 4,
399    /// Crossplane supports the requirements.schemas field. Functions can request
400    /// OpenAPI schemas and Crossplane will return them in required_schemas. Added
401    /// in Crossplane v2.2.
402    RequiredSchemas = 5,
403}
404impl Capability {
405    /// String value of the enum field names used in the ProtoBuf definition.
406    ///
407    /// The values are not transformed in any way and thus are considered stable
408    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
409    pub fn as_str_name(&self) -> &'static str {
410        match self {
411            Self::Unspecified => "CAPABILITY_UNSPECIFIED",
412            Self::Capabilities => "CAPABILITY_CAPABILITIES",
413            Self::RequiredResources => "CAPABILITY_REQUIRED_RESOURCES",
414            Self::Credentials => "CAPABILITY_CREDENTIALS",
415            Self::Conditions => "CAPABILITY_CONDITIONS",
416            Self::RequiredSchemas => "CAPABILITY_REQUIRED_SCHEMAS",
417        }
418    }
419    /// Creates an enum from field names used in the ProtoBuf definition.
420    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
421        match value {
422            "CAPABILITY_UNSPECIFIED" => Some(Self::Unspecified),
423            "CAPABILITY_CAPABILITIES" => Some(Self::Capabilities),
424            "CAPABILITY_REQUIRED_RESOURCES" => Some(Self::RequiredResources),
425            "CAPABILITY_CREDENTIALS" => Some(Self::Credentials),
426            "CAPABILITY_CONDITIONS" => Some(Self::Conditions),
427            "CAPABILITY_REQUIRED_SCHEMAS" => Some(Self::RequiredSchemas),
428            _ => None,
429        }
430    }
431}
432/// Ready indicates whether a resource should be considered ready.
433#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
434#[repr(i32)]
435pub enum Ready {
436    Unspecified = 0,
437    /// True means the resource has been observed to be ready.
438    True = 1,
439    /// False means the resource has not been observed to be ready.
440    False = 2,
441}
442impl Ready {
443    /// String value of the enum field names used in the ProtoBuf definition.
444    ///
445    /// The values are not transformed in any way and thus are considered stable
446    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
447    pub fn as_str_name(&self) -> &'static str {
448        match self {
449            Self::Unspecified => "READY_UNSPECIFIED",
450            Self::True => "READY_TRUE",
451            Self::False => "READY_FALSE",
452        }
453    }
454    /// Creates an enum from field names used in the ProtoBuf definition.
455    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
456        match value {
457            "READY_UNSPECIFIED" => Some(Self::Unspecified),
458            "READY_TRUE" => Some(Self::True),
459            "READY_FALSE" => Some(Self::False),
460            _ => None,
461        }
462    }
463}
464/// Severity of function results.
465#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
466#[repr(i32)]
467pub enum Severity {
468    Unspecified = 0,
469    /// Fatal results are fatal; subsequent functions may run, but the function
470    /// pipeline run will be considered a failure and the first fatal result will
471    /// be returned as an error.
472    Fatal = 1,
473    /// Warning results are non-fatal; the entire pipeline will run to completion
474    /// but warning events and debug logs associated with the XR or Operation will
475    /// be emitted.
476    Warning = 2,
477    /// Normal results are emitted as normal events and debug logs associated with
478    /// the XR or operation.
479    Normal = 3,
480}
481impl Severity {
482    /// String value of the enum field names used in the ProtoBuf definition.
483    ///
484    /// The values are not transformed in any way and thus are considered stable
485    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
486    pub fn as_str_name(&self) -> &'static str {
487        match self {
488            Self::Unspecified => "SEVERITY_UNSPECIFIED",
489            Self::Fatal => "SEVERITY_FATAL",
490            Self::Warning => "SEVERITY_WARNING",
491            Self::Normal => "SEVERITY_NORMAL",
492        }
493    }
494    /// Creates an enum from field names used in the ProtoBuf definition.
495    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
496        match value {
497            "SEVERITY_UNSPECIFIED" => Some(Self::Unspecified),
498            "SEVERITY_FATAL" => Some(Self::Fatal),
499            "SEVERITY_WARNING" => Some(Self::Warning),
500            "SEVERITY_NORMAL" => Some(Self::Normal),
501            _ => None,
502        }
503    }
504}
505/// Target of function results and conditions.
506#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
507#[repr(i32)]
508pub enum Target {
509    /// If the target is unspecified, the result targets the XR.
510    Unspecified = 0,
511    /// Target the XR. Results that target the XR should include detailed, advanced
512    /// information.
513    Composite = 1,
514    /// Target the XR and the claim. Results that target the XR and the claim
515    /// should include only end-user friendly information.
516    CompositeAndClaim = 2,
517}
518impl Target {
519    /// String value of the enum field names used in the ProtoBuf definition.
520    ///
521    /// The values are not transformed in any way and thus are considered stable
522    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
523    pub fn as_str_name(&self) -> &'static str {
524        match self {
525            Self::Unspecified => "TARGET_UNSPECIFIED",
526            Self::Composite => "TARGET_COMPOSITE",
527            Self::CompositeAndClaim => "TARGET_COMPOSITE_AND_CLAIM",
528        }
529    }
530    /// Creates an enum from field names used in the ProtoBuf definition.
531    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
532        match value {
533            "TARGET_UNSPECIFIED" => Some(Self::Unspecified),
534            "TARGET_COMPOSITE" => Some(Self::Composite),
535            "TARGET_COMPOSITE_AND_CLAIM" => Some(Self::CompositeAndClaim),
536            _ => None,
537        }
538    }
539}
540#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
541#[repr(i32)]
542pub enum Status {
543    ConditionUnspecified = 0,
544    ConditionUnknown = 1,
545    ConditionTrue = 2,
546    ConditionFalse = 3,
547}
548impl Status {
549    /// String value of the enum field names used in the ProtoBuf definition.
550    ///
551    /// The values are not transformed in any way and thus are considered stable
552    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
553    pub fn as_str_name(&self) -> &'static str {
554        match self {
555            Self::ConditionUnspecified => "STATUS_CONDITION_UNSPECIFIED",
556            Self::ConditionUnknown => "STATUS_CONDITION_UNKNOWN",
557            Self::ConditionTrue => "STATUS_CONDITION_TRUE",
558            Self::ConditionFalse => "STATUS_CONDITION_FALSE",
559        }
560    }
561    /// Creates an enum from field names used in the ProtoBuf definition.
562    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
563        match value {
564            "STATUS_CONDITION_UNSPECIFIED" => Some(Self::ConditionUnspecified),
565            "STATUS_CONDITION_UNKNOWN" => Some(Self::ConditionUnknown),
566            "STATUS_CONDITION_TRUE" => Some(Self::ConditionTrue),
567            "STATUS_CONDITION_FALSE" => Some(Self::ConditionFalse),
568            _ => None,
569        }
570    }
571}
572/// Generated client implementations.
573pub mod function_runner_service_client {
574    #![allow(
575        unused_variables,
576        dead_code,
577        missing_docs,
578        clippy::wildcard_imports,
579        clippy::let_unit_value,
580    )]
581    use tonic::codegen::*;
582    use tonic::codegen::http::Uri;
583    /// A FunctionRunnerService is a function.
584    #[derive(Debug, Clone)]
585    pub struct FunctionRunnerServiceClient<T> {
586        inner: tonic::client::Grpc<T>,
587    }
588    impl FunctionRunnerServiceClient<tonic::transport::Channel> {
589        /// Attempt to create a new client by connecting to a given endpoint.
590        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
591        where
592            D: TryInto<tonic::transport::Endpoint>,
593            D::Error: Into<StdError>,
594        {
595            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
596            Ok(Self::new(conn))
597        }
598    }
599    impl<T> FunctionRunnerServiceClient<T>
600    where
601        T: tonic::client::GrpcService<tonic::body::Body>,
602        T::Error: Into<StdError>,
603        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
604        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
605    {
606        pub fn new(inner: T) -> Self {
607            let inner = tonic::client::Grpc::new(inner);
608            Self { inner }
609        }
610        pub fn with_origin(inner: T, origin: Uri) -> Self {
611            let inner = tonic::client::Grpc::with_origin(inner, origin);
612            Self { inner }
613        }
614        pub fn with_interceptor<F>(
615            inner: T,
616            interceptor: F,
617        ) -> FunctionRunnerServiceClient<InterceptedService<T, F>>
618        where
619            F: tonic::service::Interceptor,
620            T::ResponseBody: Default,
621            T: tonic::codegen::Service<
622                http::Request<tonic::body::Body>,
623                Response = http::Response<
624                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
625                >,
626            >,
627            <T as tonic::codegen::Service<
628                http::Request<tonic::body::Body>,
629            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
630        {
631            FunctionRunnerServiceClient::new(InterceptedService::new(inner, interceptor))
632        }
633        /// Compress requests with the given encoding.
634        ///
635        /// This requires the server to support it otherwise it might respond with an
636        /// error.
637        #[must_use]
638        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
639            self.inner = self.inner.send_compressed(encoding);
640            self
641        }
642        /// Enable decompressing responses.
643        #[must_use]
644        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
645            self.inner = self.inner.accept_compressed(encoding);
646            self
647        }
648        /// Limits the maximum size of a decoded message.
649        ///
650        /// Default: `4MB`
651        #[must_use]
652        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
653            self.inner = self.inner.max_decoding_message_size(limit);
654            self
655        }
656        /// Limits the maximum size of an encoded message.
657        ///
658        /// Default: `usize::MAX`
659        #[must_use]
660        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
661            self.inner = self.inner.max_encoding_message_size(limit);
662            self
663        }
664        /// RunFunction runs the function.
665        pub async fn run_function(
666            &mut self,
667            request: impl tonic::IntoRequest<super::RunFunctionRequest>,
668        ) -> std::result::Result<
669            tonic::Response<super::RunFunctionResponse>,
670            tonic::Status,
671        > {
672            self.inner
673                .ready()
674                .await
675                .map_err(|e| {
676                    tonic::Status::unknown(
677                        format!("Service was not ready: {}", e.into()),
678                    )
679                })?;
680            let codec = tonic_prost::ProstCodec::default();
681            let path = http::uri::PathAndQuery::from_static(
682                "/apiextensions.fn.proto.v1.FunctionRunnerService/RunFunction",
683            );
684            let mut req = request.into_request();
685            req.extensions_mut()
686                .insert(
687                    GrpcMethod::new(
688                        "apiextensions.fn.proto.v1.FunctionRunnerService",
689                        "RunFunction",
690                    ),
691                );
692            self.inner.unary(req, path, codec).await
693        }
694    }
695}
696/// Generated server implementations.
697pub mod function_runner_service_server {
698    #![allow(
699        unused_variables,
700        dead_code,
701        missing_docs,
702        clippy::wildcard_imports,
703        clippy::let_unit_value,
704    )]
705    use tonic::codegen::*;
706    /// Generated trait containing gRPC methods that should be implemented for use with FunctionRunnerServiceServer.
707    #[async_trait]
708    pub trait FunctionRunnerService: std::marker::Send + std::marker::Sync + 'static {
709        /// RunFunction runs the function.
710        async fn run_function(
711            &self,
712            request: tonic::Request<super::RunFunctionRequest>,
713        ) -> std::result::Result<
714            tonic::Response<super::RunFunctionResponse>,
715            tonic::Status,
716        >;
717    }
718    /// A FunctionRunnerService is a function.
719    #[derive(Debug)]
720    pub struct FunctionRunnerServiceServer<T> {
721        inner: Arc<T>,
722        accept_compression_encodings: EnabledCompressionEncodings,
723        send_compression_encodings: EnabledCompressionEncodings,
724        max_decoding_message_size: Option<usize>,
725        max_encoding_message_size: Option<usize>,
726    }
727    impl<T> FunctionRunnerServiceServer<T> {
728        pub fn new(inner: T) -> Self {
729            Self::from_arc(Arc::new(inner))
730        }
731        pub fn from_arc(inner: Arc<T>) -> Self {
732            Self {
733                inner,
734                accept_compression_encodings: Default::default(),
735                send_compression_encodings: Default::default(),
736                max_decoding_message_size: None,
737                max_encoding_message_size: None,
738            }
739        }
740        pub fn with_interceptor<F>(
741            inner: T,
742            interceptor: F,
743        ) -> InterceptedService<Self, F>
744        where
745            F: tonic::service::Interceptor,
746        {
747            InterceptedService::new(Self::new(inner), interceptor)
748        }
749        /// Enable decompressing requests with the given encoding.
750        #[must_use]
751        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
752            self.accept_compression_encodings.enable(encoding);
753            self
754        }
755        /// Compress responses with the given encoding, if the client supports it.
756        #[must_use]
757        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
758            self.send_compression_encodings.enable(encoding);
759            self
760        }
761        /// Limits the maximum size of a decoded message.
762        ///
763        /// Default: `4MB`
764        #[must_use]
765        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
766            self.max_decoding_message_size = Some(limit);
767            self
768        }
769        /// Limits the maximum size of an encoded message.
770        ///
771        /// Default: `usize::MAX`
772        #[must_use]
773        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
774            self.max_encoding_message_size = Some(limit);
775            self
776        }
777    }
778    impl<T, B> tonic::codegen::Service<http::Request<B>>
779    for FunctionRunnerServiceServer<T>
780    where
781        T: FunctionRunnerService,
782        B: Body + std::marker::Send + 'static,
783        B::Error: Into<StdError> + std::marker::Send + 'static,
784    {
785        type Response = http::Response<tonic::body::Body>;
786        type Error = std::convert::Infallible;
787        type Future = BoxFuture<Self::Response, Self::Error>;
788        fn poll_ready(
789            &mut self,
790            _cx: &mut Context<'_>,
791        ) -> Poll<std::result::Result<(), Self::Error>> {
792            Poll::Ready(Ok(()))
793        }
794        fn call(&mut self, req: http::Request<B>) -> Self::Future {
795            match req.uri().path() {
796                "/apiextensions.fn.proto.v1.FunctionRunnerService/RunFunction" => {
797                    #[allow(non_camel_case_types)]
798                    struct RunFunctionSvc<T: FunctionRunnerService>(pub Arc<T>);
799                    impl<
800                        T: FunctionRunnerService,
801                    > tonic::server::UnaryService<super::RunFunctionRequest>
802                    for RunFunctionSvc<T> {
803                        type Response = super::RunFunctionResponse;
804                        type Future = BoxFuture<
805                            tonic::Response<Self::Response>,
806                            tonic::Status,
807                        >;
808                        fn call(
809                            &mut self,
810                            request: tonic::Request<super::RunFunctionRequest>,
811                        ) -> Self::Future {
812                            let inner = Arc::clone(&self.0);
813                            let fut = async move {
814                                <T as FunctionRunnerService>::run_function(&inner, request)
815                                    .await
816                            };
817                            Box::pin(fut)
818                        }
819                    }
820                    let accept_compression_encodings = self.accept_compression_encodings;
821                    let send_compression_encodings = self.send_compression_encodings;
822                    let max_decoding_message_size = self.max_decoding_message_size;
823                    let max_encoding_message_size = self.max_encoding_message_size;
824                    let inner = self.inner.clone();
825                    let fut = async move {
826                        let method = RunFunctionSvc(inner);
827                        let codec = tonic_prost::ProstCodec::default();
828                        let mut grpc = tonic::server::Grpc::new(codec)
829                            .apply_compression_config(
830                                accept_compression_encodings,
831                                send_compression_encodings,
832                            )
833                            .apply_max_message_size_config(
834                                max_decoding_message_size,
835                                max_encoding_message_size,
836                            );
837                        let res = grpc.unary(method, req).await;
838                        Ok(res)
839                    };
840                    Box::pin(fut)
841                }
842                _ => {
843                    Box::pin(async move {
844                        let mut response = http::Response::new(
845                            tonic::body::Body::default(),
846                        );
847                        let headers = response.headers_mut();
848                        headers
849                            .insert(
850                                tonic::Status::GRPC_STATUS,
851                                (tonic::Code::Unimplemented as i32).into(),
852                            );
853                        headers
854                            .insert(
855                                http::header::CONTENT_TYPE,
856                                tonic::metadata::GRPC_CONTENT_TYPE,
857                            );
858                        Ok(response)
859                    })
860                }
861            }
862        }
863    }
864    impl<T> Clone for FunctionRunnerServiceServer<T> {
865        fn clone(&self) -> Self {
866            let inner = self.inner.clone();
867            Self {
868                inner,
869                accept_compression_encodings: self.accept_compression_encodings,
870                send_compression_encodings: self.send_compression_encodings,
871                max_decoding_message_size: self.max_decoding_message_size,
872                max_encoding_message_size: self.max_encoding_message_size,
873            }
874        }
875    }
876    /// Generated gRPC service name
877    pub const SERVICE_NAME: &str = "apiextensions.fn.proto.v1.FunctionRunnerService";
878    impl<T> tonic::server::NamedService for FunctionRunnerServiceServer<T> {
879        const NAME: &'static str = SERVICE_NAME;
880    }
881}