Skip to main content

momento_protos/
function_types.rs

1// This file is @generated by prost-build.
2/// A Function is an extension of Momento; for users to build their own Momento apis.
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct Function {
5    /// This is an immutable unique identifier for the function, across versions.
6    #[prost(string, tag = "1")]
7    pub function_id: ::prost::alloc::string::String,
8    /// The name of the function.
9    #[prost(string, tag = "2")]
10    pub name: ::prost::alloc::string::String,
11    /// A convenience for consoles.
12    #[prost(string, tag = "3")]
13    pub description: ::prost::alloc::string::String,
14    /// What is the current version of the function set to use upon invocation?
15    #[prost(message, optional, tag = "4")]
16    pub current_version: ::core::option::Option<CurrentFunctionVersion>,
17    /// What is the actual latest version of the function?
18    #[prost(uint32, tag = "5")]
19    pub latest_version: u32,
20    /// How many concurrent invocations are allowed for this function
21    #[prost(uint32, tag = "6")]
22    pub concurrency_limit: u32,
23    /// Human-readable datetime string in UTC format
24    #[prost(string, tag = "7")]
25    pub last_updated_at: ::prost::alloc::string::String,
26}
27#[derive(Clone, Copy, PartialEq, ::prost::Message)]
28pub struct CurrentFunctionVersion {
29    #[prost(oneof = "current_function_version::Version", tags = "1, 2")]
30    pub version: ::core::option::Option<current_function_version::Version>,
31}
32/// Nested message and enum types in `_CurrentFunctionVersion`.
33pub mod current_function_version {
34    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
35    pub struct Latest {}
36    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
37    pub struct Pinned {
38        #[prost(uint32, tag = "1")]
39        pub pinned_version: u32,
40    }
41    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
42    pub enum Version {
43        #[prost(message, tag = "1")]
44        Latest(Latest),
45        #[prost(message, tag = "2")]
46        Pinned(Pinned),
47    }
48}
49/// A specific version of a Function, with its versioned configuration data.
50#[derive(Clone, PartialEq, ::prost::Message)]
51pub struct FunctionVersion {
52    /// This unique identifier should change when a function's metadata is updated
53    #[prost(message, optional, tag = "1")]
54    pub id: ::core::option::Option<FunctionId>,
55    /// The wasm ID this function uses
56    #[prost(message, optional, tag = "20")]
57    pub wasm_id: ::core::option::Option<WasmId>,
58    /// The environment variables available to this function via the WASI environment interface
59    #[prost(map = "string, message", tag = "40")]
60    pub environment: ::std::collections::HashMap<
61        ::prost::alloc::string::String,
62        EnvironmentValue,
63    >,
64}
65#[derive(Clone, PartialEq, ::prost::Message)]
66pub struct EnvironmentValue {
67    #[prost(oneof = "environment_value::Value", tags = "1")]
68    pub value: ::core::option::Option<environment_value::Value>,
69}
70/// Nested message and enum types in `_EnvironmentValue`.
71pub mod environment_value {
72    #[derive(Clone, PartialEq, ::prost::Oneof)]
73    pub enum Value {
74        /// An environment variable value
75        #[prost(string, tag = "1")]
76        Literal(::prost::alloc::string::String),
77    }
78}
79/// Metadata for a wasm archive. These can exist independently of a Function.
80/// For example, Templates are just special Wasm archives that are accessible to more than 1 user.
81/// In this way, we can manage Templates independently of concrete user Functions, and users can
82/// reuse their wasms across multiple Functions (which would be different configurations).
83#[derive(Clone, PartialEq, ::prost::Message)]
84pub struct Wasm {
85    /// The globally unique identifier tuple for this wasm.
86    /// It may be a shared ID, as in the case of a Template Function, or it may be
87    /// unique to one Function.
88    #[prost(message, optional, tag = "1")]
89    pub id: ::core::option::Option<WasmId>,
90    /// The name of the wasm.
91    #[prost(string, tag = "2")]
92    pub name: ::prost::alloc::string::String,
93    /// The description of the wasm.
94    #[prost(string, tag = "3")]
95    pub description: ::prost::alloc::string::String,
96}
97#[derive(Clone, PartialEq, ::prost::Message)]
98pub struct FunctionId {
99    /// Globally unique id, this is stable across versions of the Function.
100    #[prost(string, tag = "1")]
101    pub id: ::prost::alloc::string::String,
102    /// A sub-id of sorts. Together with the id, this is a unique identifier for a function configuration.
103    #[prost(uint32, tag = "2")]
104    pub version: u32,
105}
106#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct WasmId {
108    /// Globally unique id, this is stable across versions of the wasm.
109    #[prost(string, tag = "1")]
110    pub id: ::prost::alloc::string::String,
111    /// A sub-id of sorts. Together with the id, this is a unique identifier for a wasm binary.
112    #[prost(uint32, tag = "2")]
113    pub version: u32,
114}