diff --git a/Cargo.toml b/Cargo.toml index 7cc00db..e0f4e30 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ description = "The Rust API build for the Aruna Object Storage (AOS)" edition = "2021" license = "Apache-2.0" name = "aruna-rust-api" -version = "2.0.0-beta.15" +version = "2.0.0-beta.15.1" include = ["src/aruna", "src/aruna_no_transport", "src/lib.rs"] diff --git a/src/aruna/aruna.api.dataproxy.services.v2.rs b/src/aruna/aruna.api.dataproxy.services.v2.rs index 998180d..5742d99 100644 --- a/src/aruna/aruna.api.dataproxy.services.v2.rs +++ b/src/aruna/aruna.api.dataproxy.services.v2.rs @@ -1,4 +1,3 @@ -// This file is @generated by prost-build. #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/src/aruna/aruna.api.health.v2.rs b/src/aruna/aruna.api.health.v2.rs index 2afa8e0..0f325d4 100644 --- a/src/aruna/aruna.api.health.v2.rs +++ b/src/aruna/aruna.api.health.v2.rs @@ -1,4 +1,3 @@ -// This file is @generated by prost-build. #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/src/aruna/aruna.api.hooks.services.v2.rs b/src/aruna/aruna.api.hooks.services.v2.rs index 31c22ee..32907ee 100644 --- a/src/aruna/aruna.api.hooks.services.v2.rs +++ b/src/aruna/aruna.api.hooks.services.v2.rs @@ -1,4 +1,3 @@ -// This file is @generated by prost-build. #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/src/aruna/aruna.api.notification.services.v2.rs b/src/aruna/aruna.api.notification.services.v2.rs index 4784401..c43dbfc 100644 --- a/src/aruna/aruna.api.notification.services.v2.rs +++ b/src/aruna/aruna.api.notification.services.v2.rs @@ -1,4 +1,3 @@ -// This file is @generated by prost-build. #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/src/aruna/aruna.api.storage.models.v2.rs b/src/aruna/aruna.api.storage.models.v2.rs index d5451de..efb338a 100644 --- a/src/aruna/aruna.api.storage.models.v2.rs +++ b/src/aruna/aruna.api.storage.models.v2.rs @@ -1,4 +1,3 @@ -// This file is @generated by prost-build. /// ------------- USERS & PERMISSIONS ----------------------- #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/src/aruna/aruna.api.storage.services.v2.rs b/src/aruna/aruna.api.storage.services.v2.rs index 6c5b0de..13a8447 100644 --- a/src/aruna/aruna.api.storage.services.v2.rs +++ b/src/aruna/aruna.api.storage.services.v2.rs @@ -1,143 +1,243 @@ -// This file is @generated by prost-build. #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateRuleRequest { +pub struct CreateCollectionRequest { + /// collection name #[prost(string, tag = "1")] - pub rule: ::prost::alloc::string::String, + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "9")] + pub title: ::prost::alloc::string::String, + /// description #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, - #[prost(bool, tag = "3")] - pub public: bool, + /// collection specific labels / hooks + #[prost(message, repeated, tag = "3")] + pub key_values: ::prost::alloc::vec::Vec, + /// Internal /External relations (URLs / IDs from external sources) + #[prost(message, repeated, tag = "4")] + pub relations: ::prost::alloc::vec::Vec, + /// DataClass + #[prost(enumeration = "super::super::models::v2::DataClass", tag = "5")] + pub data_class: i32, + #[prost(string, optional, tag = "7")] + pub metadata_license_tag: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag = "8")] + pub default_data_license_tag: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "10")] + pub authors: ::prost::alloc::vec::Vec, + /// Parent_id MUST be project + #[prost(oneof = "create_collection_request::Parent", tags = "6")] + pub parent: ::core::option::Option, +} +/// Nested message and enum types in `CreateCollectionRequest`. +pub mod create_collection_request { + /// Parent_id MUST be project + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Parent { + #[prost(string, tag = "6")] + ProjectId(::prost::alloc::string::String), + } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateRuleResponse { +pub struct CreateCollectionResponse { + /// The new collection_id + #[prost(message, optional, tag = "1")] + pub collection: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetCollectionRequest { + /// Requested id #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, + pub collection_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetRuleRequest { +pub struct GetCollectionResponse { + /// Overview of the requested collection + #[prost(message, optional, tag = "1")] + pub collection: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetCollectionsRequest { + #[prost(string, repeated, tag = "1")] + pub collection_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetCollectionsResponse { + /// List of collection overviews + #[prost(message, repeated, tag = "1")] + pub collections: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteCollectionRequest { #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, + pub collection_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct Rule { +pub struct DeleteCollectionResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateCollectionNameRequest { #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, + pub collection_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateCollectionNameResponse { + #[prost(message, optional, tag = "1")] + pub collection: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateCollectionDescriptionRequest { + #[prost(string, tag = "1")] + pub collection_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] - pub rule: ::prost::alloc::string::String, - #[prost(string, tag = "3")] pub description: ::prost::alloc::string::String, - #[prost(bool, tag = "4")] - pub public: bool, - #[prost(string, tag = "5")] - pub owner: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetRuleResponse { +pub struct UpdateCollectionDescriptionResponse { #[prost(message, optional, tag = "1")] - pub rule: ::core::option::Option, + pub collection: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListRuleRequest {} +pub struct UpdateCollectionKeyValuesRequest { + #[prost(string, tag = "1")] + pub collection_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub add_key_values: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub remove_key_values: ::prost::alloc::vec::Vec, +} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListRuleResponse { - #[prost(message, repeated, tag = "1")] - pub rules: ::prost::alloc::vec::Vec, +pub struct UpdateCollectionKeyValuesResponse { + #[prost(message, optional, tag = "1")] + pub collection: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateRuleRequest { +pub struct UpdateCollectionDataClassRequest { #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub rule: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub description: ::prost::alloc::string::String, - #[prost(bool, tag = "4")] - pub public: bool, + pub collection_id: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::DataClass", tag = "2")] + pub data_class: i32, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateRuleResponse { +pub struct UpdateCollectionDataClassResponse { #[prost(message, optional, tag = "1")] - pub rule: ::core::option::Option, + pub collection: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteRuleRequest { +pub struct SnapshotCollectionRequest { #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, + pub collection_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteRuleResponse {} +pub struct SnapshotCollectionResponse { + /// This collection will be returned via an Persistent Identifier! Updates will be impossible + #[prost(message, optional, tag = "1")] + pub collection: ::core::option::Option, +} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateRuleBindingRequest { +pub struct UpdateCollectionLicensesRequest { #[prost(string, tag = "1")] - pub rule_id: ::prost::alloc::string::String, + pub collection_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] - pub object_id: ::prost::alloc::string::String, - #[prost(bool, tag = "3")] - pub cascading: bool, + pub metadata_license_tag: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub default_data_license_tag: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateRuleBindingResponse { +pub struct UpdateCollectionLicensesResponse { + #[prost(message, optional, tag = "1")] + pub collection: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateCollectionTitleRequest { #[prost(string, tag = "1")] - pub rule_id: ::prost::alloc::string::String, + pub collection_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] - pub object_id: ::prost::alloc::string::String, - #[prost(bool, tag = "3")] - pub cascading: bool, + pub title: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteRuleBindingRequest { +pub struct UpdateCollectionTitleResponse { + #[prost(message, optional, tag = "1")] + pub collection: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateCollectionAuthorsRequest { #[prost(string, tag = "1")] - pub rule_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub object_id: ::prost::alloc::string::String, + pub collection_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub add_authors: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub remove_authors: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteRuleBindingResponse {} +pub struct UpdateCollectionAuthorsResponse { + #[prost(message, optional, tag = "1")] + pub collection: ::core::option::Option, +} /// Generated client implementations. -pub mod rules_service_client { +pub mod collection_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// RulesService + /// CollectionService /// /// Status: BETA /// - /// Contains all methods to edit and change rules + /// Contains all methods that get/create or update Collection and associated resources #[derive(Debug, Clone)] - pub struct RulesServiceClient { + pub struct CollectionServiceClient { inner: tonic::client::Grpc, } - impl RulesServiceClient { + impl CollectionServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -148,7 +248,7 @@ pub mod rules_service_client { Ok(Self::new(conn)) } } - impl RulesServiceClient + impl CollectionServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -166,7 +266,7 @@ pub mod rules_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> RulesServiceClient> + ) -> CollectionServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -180,7 +280,7 @@ pub mod rules_service_client { http::Request, >>::Error: Into + Send + Sync, { - RulesServiceClient::new(InterceptedService::new(inner, interceptor)) + CollectionServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -213,16 +313,16 @@ pub mod rules_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// CreateRule + /// CreateNewCollection /// - /// Status: ALPHA + /// Status: BETA /// - /// Create a new rule - pub async fn create_rule( + /// creates a new Collection + pub async fn create_collection( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -236,28 +336,28 @@ pub mod rules_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.RulesService/CreateRule", + "/aruna.api.storage.services.v2.CollectionService/CreateCollection", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.RulesService", - "CreateRule", + "aruna.api.storage.services.v2.CollectionService", + "CreateCollection", ), ); self.inner.unary(req, path, codec).await } - /// GetRule + /// GetCollection /// - /// Status: ALPHA + /// Status: BETA /// - /// Gets an existing rule - pub async fn get_rule( + /// Request a specific collection by ID + pub async fn get_collection( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -271,28 +371,28 @@ pub mod rules_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.RulesService/GetRule", + "/aruna.api.storage.services.v2.CollectionService/GetCollection", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.RulesService", - "GetRule", + "aruna.api.storage.services.v2.CollectionService", + "GetCollection", ), ); self.inner.unary(req, path, codec).await } - /// ListRule + /// GetCollections /// - /// Status: ALPHA + /// Status: BETA /// - /// Lists rules -> Owned and public rules - pub async fn list_rule( + /// Queries multiple collections by ID + pub async fn get_collections( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -306,28 +406,28 @@ pub mod rules_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.RulesService/ListRule", + "/aruna.api.storage.services.v2.CollectionService/GetCollections", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.RulesService", - "ListRule", + "aruna.api.storage.services.v2.CollectionService", + "GetCollections", ), ); self.inner.unary(req, path, codec).await } - /// UpdateRule + /// DeleteCollection /// - /// Status: ALPHA + /// Status: STABLE /// - /// Updates an existing rule - pub async fn update_rule( + /// This request deletes the collection. + pub async fn delete_collection( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -341,28 +441,28 @@ pub mod rules_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.RulesService/UpdateRule", + "/aruna.api.storage.services.v2.CollectionService/DeleteCollection", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.RulesService", - "UpdateRule", + "aruna.api.storage.services.v2.CollectionService", + "DeleteCollection", ), ); self.inner.unary(req, path, codec).await } - /// DeleteRule + /// UpdateCollectionName /// - /// Status: ALPHA + /// Status: BETA /// - /// Deletes an existing rule - pub async fn delete_rule( + /// Updates the collection name. Caveat! Will rename the "s3 bucket" for data proxies! + pub async fn update_collection_name( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -376,28 +476,28 @@ pub mod rules_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.RulesService/DeleteRule", + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionName", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.RulesService", - "DeleteRule", + "aruna.api.storage.services.v2.CollectionService", + "UpdateCollectionName", ), ); self.inner.unary(req, path, codec).await } - /// CreateRuleBinding + /// UpdateCollectionDescription /// - /// Status: ALPHA + /// Status: BETA /// - /// Associates a rule with an object, optionally cascading the rule to all children - pub async fn create_rule_binding( + /// Updates the collection description. + pub async fn update_collection_description( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -411,28 +511,28 @@ pub mod rules_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.RulesService/CreateRuleBinding", + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionDescription", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.RulesService", - "CreateRuleBinding", + "aruna.api.storage.services.v2.CollectionService", + "UpdateCollectionDescription", ), ); self.inner.unary(req, path, codec).await } - /// DeleteRuleBinding + /// UpdateCollectionKeyValues /// - /// Status: ALPHA + /// Status: BETA /// - /// Disassociates a rule from an object - pub async fn delete_rule_binding( + /// Updates the collection key values. + pub async fn update_collection_key_values( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -446,116 +546,354 @@ pub mod rules_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.RulesService/DeleteRuleBinding", + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionKeyValues", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.RulesService", - "DeleteRuleBinding", + "aruna.api.storage.services.v2.CollectionService", + "UpdateCollectionKeyValues", ), ); self.inner.unary(req, path, codec).await } - } -} -/// Generated server implementations. -pub mod rules_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with RulesServiceServer. - #[async_trait] - pub trait RulesService: Send + Sync + 'static { - /// CreateRule + /// UpdateCollectionDataClass /// - /// Status: ALPHA + /// Status: BETA /// - /// Create a new rule - async fn create_rule( - &self, - request: tonic::Request, + /// Updates the collection name. All (meta) data will be overwritten. + pub async fn update_collection_data_class( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// GetRule + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionDataClass", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.CollectionService", + "UpdateCollectionDataClass", + ), + ); + self.inner.unary(req, path, codec).await + } + /// SnapshotCollectionRequest /// - /// Status: ALPHA + /// Status: BETA /// - /// Gets an existing rule - async fn get_rule( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// ListRule + /// Archives the full collection, rendering all downstream relations immutable + pub async fn snapshot_collection( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.CollectionService/SnapshotCollection", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.CollectionService", + "SnapshotCollection", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateLicenses /// - /// Status: ALPHA + /// Status: BETA /// - /// Lists rules -> Owned and public rules - async fn list_rule( - &self, - request: tonic::Request, + /// Updates the collections metadata license and/or default data license. + pub async fn update_collection_licenses( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// UpdateRule + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionLicenses", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.CollectionService", + "UpdateCollectionLicenses", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateTitle /// /// Status: ALPHA /// - /// Updates an existing rule - async fn update_rule( - &self, - request: tonic::Request, + /// Updates the collections metadata title. + pub async fn update_collection_title( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// DeleteRule + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionTitle", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.CollectionService", + "UpdateCollectionTitle", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateAuthors /// /// Status: ALPHA /// - /// Deletes an existing rule - async fn delete_rule( - &self, - request: tonic::Request, + /// Updates the collections metadata title. + pub async fn update_collection_authors( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionAuthors", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.CollectionService", + "UpdateCollectionAuthors", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod collection_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with CollectionServiceServer. + #[async_trait] + pub trait CollectionService: Send + Sync + 'static { + /// CreateNewCollection + /// + /// Status: BETA + /// + /// creates a new Collection + async fn create_collection( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, tonic::Status, >; - /// CreateRuleBinding + /// GetCollection + /// + /// Status: BETA + /// + /// Request a specific collection by ID + async fn get_collection( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetCollections + /// + /// Status: BETA + /// + /// Queries multiple collections by ID + async fn get_collections( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteCollection + /// + /// Status: STABLE + /// + /// This request deletes the collection. + async fn delete_collection( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateCollectionName + /// + /// Status: BETA + /// + /// Updates the collection name. Caveat! Will rename the "s3 bucket" for data proxies! + async fn update_collection_name( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateCollectionDescription + /// + /// Status: BETA + /// + /// Updates the collection description. + async fn update_collection_description( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateCollectionKeyValues + /// + /// Status: BETA + /// + /// Updates the collection key values. + async fn update_collection_key_values( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateCollectionDataClass + /// + /// Status: BETA + /// + /// Updates the collection name. All (meta) data will be overwritten. + async fn update_collection_data_class( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// SnapshotCollectionRequest + /// + /// Status: BETA + /// + /// Archives the full collection, rendering all downstream relations immutable + async fn snapshot_collection( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateLicenses + /// + /// Status: BETA + /// + /// Updates the collections metadata license and/or default data license. + async fn update_collection_licenses( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateTitle /// /// Status: ALPHA /// - /// Associates a rule with an object, optionally cascading the rule to all children - async fn create_rule_binding( + /// Updates the collections metadata title. + async fn update_collection_title( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// DeleteRuleBinding + /// UpdateAuthors /// /// Status: ALPHA /// - /// Disassociates a rule from an object - async fn delete_rule_binding( + /// Updates the collections metadata title. + async fn update_collection_authors( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// RulesService + /// CollectionService /// /// Status: BETA /// - /// Contains all methods to edit and change rules + /// Contains all methods that get/create or update Collection and associated resources #[derive(Debug)] - pub struct RulesServiceServer { + pub struct CollectionServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -563,7 +901,7 @@ pub mod rules_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl RulesServiceServer { + impl CollectionServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -615,9 +953,9 @@ pub mod rules_service_server { self } } - impl tonic::codegen::Service> for RulesServiceServer + impl tonic::codegen::Service> for CollectionServiceServer where - T: RulesService, + T: CollectionService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -633,25 +971,26 @@ pub mod rules_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.RulesService/CreateRule" => { + "/aruna.api.storage.services.v2.CollectionService/CreateCollection" => { #[allow(non_camel_case_types)] - struct CreateRuleSvc(pub Arc); + struct CreateCollectionSvc(pub Arc); impl< - T: RulesService, - > tonic::server::UnaryService - for CreateRuleSvc { - type Response = super::CreateRuleResponse; + T: CollectionService, + > tonic::server::UnaryService + for CreateCollectionSvc { + type Response = super::CreateCollectionResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_rule(&inner, request).await + ::create_collection(&inner, request) + .await }; Box::pin(fut) } @@ -663,7 +1002,7 @@ pub mod rules_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateRuleSvc(inner); + let method = CreateCollectionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -679,25 +1018,26 @@ pub mod rules_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.RulesService/GetRule" => { + "/aruna.api.storage.services.v2.CollectionService/GetCollection" => { #[allow(non_camel_case_types)] - struct GetRuleSvc(pub Arc); + struct GetCollectionSvc(pub Arc); impl< - T: RulesService, - > tonic::server::UnaryService - for GetRuleSvc { - type Response = super::GetRuleResponse; + T: CollectionService, + > tonic::server::UnaryService + for GetCollectionSvc { + type Response = super::GetCollectionResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_rule(&inner, request).await + ::get_collection(&inner, request) + .await }; Box::pin(fut) } @@ -709,7 +1049,7 @@ pub mod rules_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetRuleSvc(inner); + let method = GetCollectionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -725,25 +1065,26 @@ pub mod rules_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.RulesService/ListRule" => { + "/aruna.api.storage.services.v2.CollectionService/GetCollections" => { #[allow(non_camel_case_types)] - struct ListRuleSvc(pub Arc); + struct GetCollectionsSvc(pub Arc); impl< - T: RulesService, - > tonic::server::UnaryService - for ListRuleSvc { - type Response = super::ListRuleResponse; + T: CollectionService, + > tonic::server::UnaryService + for GetCollectionsSvc { + type Response = super::GetCollectionsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::list_rule(&inner, request).await + ::get_collections(&inner, request) + .await }; Box::pin(fut) } @@ -755,7 +1096,7 @@ pub mod rules_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ListRuleSvc(inner); + let method = GetCollectionsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -771,25 +1112,26 @@ pub mod rules_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.RulesService/UpdateRule" => { + "/aruna.api.storage.services.v2.CollectionService/DeleteCollection" => { #[allow(non_camel_case_types)] - struct UpdateRuleSvc(pub Arc); + struct DeleteCollectionSvc(pub Arc); impl< - T: RulesService, - > tonic::server::UnaryService - for UpdateRuleSvc { - type Response = super::UpdateRuleResponse; + T: CollectionService, + > tonic::server::UnaryService + for DeleteCollectionSvc { + type Response = super::DeleteCollectionResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_rule(&inner, request).await + ::delete_collection(&inner, request) + .await }; Box::pin(fut) } @@ -801,7 +1143,7 @@ pub mod rules_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateRuleSvc(inner); + let method = DeleteCollectionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -817,25 +1159,29 @@ pub mod rules_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.RulesService/DeleteRule" => { + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionName" => { #[allow(non_camel_case_types)] - struct DeleteRuleSvc(pub Arc); + struct UpdateCollectionNameSvc(pub Arc); impl< - T: RulesService, - > tonic::server::UnaryService - for DeleteRuleSvc { - type Response = super::DeleteRuleResponse; + T: CollectionService, + > tonic::server::UnaryService + for UpdateCollectionNameSvc { + type Response = super::UpdateCollectionNameResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_rule(&inner, request).await + ::update_collection_name( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -847,7 +1193,7 @@ pub mod rules_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteRuleSvc(inner); + let method = UpdateCollectionNameSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -863,25 +1209,33 @@ pub mod rules_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.RulesService/CreateRuleBinding" => { + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionDescription" => { #[allow(non_camel_case_types)] - struct CreateRuleBindingSvc(pub Arc); + struct UpdateCollectionDescriptionSvc( + pub Arc, + ); impl< - T: RulesService, - > tonic::server::UnaryService - for CreateRuleBindingSvc { - type Response = super::CreateRuleBindingResponse; + T: CollectionService, + > tonic::server::UnaryService< + super::UpdateCollectionDescriptionRequest, + > for UpdateCollectionDescriptionSvc { + type Response = super::UpdateCollectionDescriptionResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::UpdateCollectionDescriptionRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_rule_binding(&inner, request) + ::update_collection_description( + &inner, + request, + ) .await }; Box::pin(fut) @@ -894,7 +1248,7 @@ pub mod rules_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateRuleBindingSvc(inner); + let method = UpdateCollectionDescriptionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -910,25 +1264,33 @@ pub mod rules_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.RulesService/DeleteRuleBinding" => { + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionKeyValues" => { #[allow(non_camel_case_types)] - struct DeleteRuleBindingSvc(pub Arc); + struct UpdateCollectionKeyValuesSvc( + pub Arc, + ); impl< - T: RulesService, - > tonic::server::UnaryService - for DeleteRuleBindingSvc { - type Response = super::DeleteRuleBindingResponse; + T: CollectionService, + > tonic::server::UnaryService< + super::UpdateCollectionKeyValuesRequest, + > for UpdateCollectionKeyValuesSvc { + type Response = super::UpdateCollectionKeyValuesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::UpdateCollectionKeyValuesRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_rule_binding(&inner, request) + ::update_collection_key_values( + &inner, + request, + ) .await }; Box::pin(fut) @@ -941,7 +1303,7 @@ pub mod rules_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteRuleBindingSvc(inner); + let method = UpdateCollectionKeyValuesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -957,154 +1319,514 @@ pub mod rules_service_server { }; Box::pin(fut) } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionDataClass" => { + #[allow(non_camel_case_types)] + struct UpdateCollectionDataClassSvc( + pub Arc, + ); + impl< + T: CollectionService, + > tonic::server::UnaryService< + super::UpdateCollectionDataClassRequest, + > for UpdateCollectionDataClassSvc { + type Response = super::UpdateCollectionDataClassResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::UpdateCollectionDataClassRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_collection_data_class( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateCollectionDataClassSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) } - } - } - } - impl Clone for RulesServiceServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for RulesServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.RulesService"; - } -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UserPermission { - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub user_name: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "3")] - pub permission_level: i32, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ResourceAuthorization { - #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub user_permission: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateAuthorizationRequest { - #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub user_id: ::prost::alloc::string::String, - /// Can also include "deny" - #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "3")] - pub permission_level: i32, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateAuthorizationResponse { - #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub user_id: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub user_name: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "4")] - pub permission_level: i32, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAuthorizationsRequest { - #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, - #[prost(bool, tag = "2")] - pub recursive: bool, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAuthorizationsResponse { - #[prost(message, repeated, tag = "1")] - pub authorizations: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteAuthorizationRequest { - #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub user_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteAuthorizationResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateAuthorizationRequest { - #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub user_id: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "3")] - pub permission_level: i32, + "/aruna.api.storage.services.v2.CollectionService/SnapshotCollection" => { + #[allow(non_camel_case_types)] + struct SnapshotCollectionSvc(pub Arc); + impl< + T: CollectionService, + > tonic::server::UnaryService + for SnapshotCollectionSvc { + type Response = super::SnapshotCollectionResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::snapshot_collection( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SnapshotCollectionSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionLicenses" => { + #[allow(non_camel_case_types)] + struct UpdateCollectionLicensesSvc(pub Arc); + impl< + T: CollectionService, + > tonic::server::UnaryService + for UpdateCollectionLicensesSvc { + type Response = super::UpdateCollectionLicensesResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::UpdateCollectionLicensesRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_collection_licenses( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateCollectionLicensesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionTitle" => { + #[allow(non_camel_case_types)] + struct UpdateCollectionTitleSvc(pub Arc); + impl< + T: CollectionService, + > tonic::server::UnaryService + for UpdateCollectionTitleSvc { + type Response = super::UpdateCollectionTitleResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_collection_title( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateCollectionTitleSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionAuthors" => { + #[allow(non_camel_case_types)] + struct UpdateCollectionAuthorsSvc(pub Arc); + impl< + T: CollectionService, + > tonic::server::UnaryService + for UpdateCollectionAuthorsSvc { + type Response = super::UpdateCollectionAuthorsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::UpdateCollectionAuthorsRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_collection_authors( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateCollectionAuthorsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for CollectionServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService + for CollectionServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.CollectionService"; + } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateAuthorizationResponse { - #[prost(message, optional, tag = "1")] - pub user_permission: ::core::option::Option, -} +pub struct GetStorageVersionRequest {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SemanticVersion { + /// Complete version string + #[prost(string, tag = "1")] + pub version_string: ::prost::alloc::string::String, + /// Semver according to + #[prost(int32, tag = "2")] + pub major: i32, + #[prost(int32, tag = "3")] + pub minor: i32, + #[prost(int32, tag = "4")] + pub patch: i32, + #[prost(string, tag = "5")] + pub labels: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LocationVersion { + /// Status of a specific Location e.g Gießen / dataproxy / 0.5.0-beta.1 + #[prost(string, tag = "1")] + pub location: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub version: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ComponentVersion { + /// Name of a specific component e.g. server, dataproxy etc. and their status by location + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub version: ::core::option::Option, +} +/// Version of each component by location +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetStorageVersionResponse { + #[prost(message, repeated, tag = "1")] + pub location_version: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetStorageStatusRequest {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LocationStatus { + /// Status of a specific Location e.g Gießen / AVAILABLE + #[prost(string, tag = "1")] + pub location: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub component_status: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ComponentStatus { + /// Name of a specific component e.g. server, dataproxy etc. and their status by location + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::ComponentStatus", tag = "2")] + pub status: i32, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetStorageStatusResponse { + /// List of all locations and their component / status + #[prost(message, repeated, tag = "1")] + pub location_status: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetPubkeysRequest {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetPubkeysResponse { + #[prost(message, repeated, tag = "1")] + pub pubkeys: ::prost::alloc::vec::Vec, +} +/// ------------------------------------- +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Announcement { + /// Announcement id + #[prost(string, tag = "1")] + pub announcement_id: ::prost::alloc::string::String, + /// Announcement type + #[prost(enumeration = "super::super::models::v2::AnnouncementType", tag = "2")] + pub announcement_type: i32, + /// Announcement title + #[prost(string, tag = "3")] + pub title: ::prost::alloc::string::String, + /// Short announcement summary + #[prost(string, tag = "4")] + pub teaser: ::prost::alloc::string::String, + /// URL for announcement preview image + #[prost(string, tag = "5")] + pub image_url: ::prost::alloc::string::String, + /// Announcement content text + #[prost(string, tag = "6")] + pub content: ::prost::alloc::string::String, + /// Initial announcement author + #[prost(string, tag = "7")] + pub created_by: ::prost::alloc::string::String, + /// Initial creation timestamp + #[prost(message, optional, tag = "8")] + pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>, + /// Author responsible for the last modification + #[prost(string, tag = "9")] + pub modified_by: ::prost::alloc::string::String, + /// Last modification timestamp + #[prost(message, optional, tag = "10")] + pub modified_at: ::core::option::Option<::prost_wkt_types::Timestamp>, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SetAnnouncementsRequest { + #[prost(message, repeated, tag = "1")] + pub announcements_upsert: ::prost::alloc::vec::Vec, + #[prost(string, repeated, tag = "2")] + pub announcements_delete: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SetAnnouncementsResponse { + #[prost(message, repeated, tag = "1")] + pub announcements: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAnnouncementsRequest { + #[prost(string, repeated, tag = "1")] + pub announcement_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, optional, tag = "2")] + pub page: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAnnouncementsResponse { + #[prost(message, repeated, tag = "1")] + pub announcements: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAnnouncementsByTypeRequest { + #[prost(enumeration = "super::super::models::v2::AnnouncementType", tag = "1")] + pub announcement_type: i32, + #[prost(message, optional, tag = "2")] + pub page: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAnnouncementsByTypeResponse { + #[prost(message, repeated, tag = "1")] + pub announcements: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAnnouncementRequest { + #[prost(string, tag = "1")] + pub announcement_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAnnouncementResponse { + #[prost(message, optional, tag = "1")] + pub announcement: ::core::option::Option, +} /// Generated client implementations. -pub mod authorization_service_client { +pub mod storage_status_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// AuthorizationService + /// StorageStatusService /// /// Status: BETA /// - /// Contains all methods to edit and change user authorization + /// This is a generic service that contains utility functions + /// these functions are used to query additional meta-information + /// about the status of storage components #[derive(Debug, Clone)] - pub struct AuthorizationServiceClient { + pub struct StorageStatusServiceClient { inner: tonic::client::Grpc, } - impl AuthorizationServiceClient { + impl StorageStatusServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -1115,7 +1837,7 @@ pub mod authorization_service_client { Ok(Self::new(conn)) } } - impl AuthorizationServiceClient + impl StorageStatusServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -1133,7 +1855,7 @@ pub mod authorization_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> AuthorizationServiceClient> + ) -> StorageStatusServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -1147,7 +1869,7 @@ pub mod authorization_service_client { http::Request, >>::Error: Into + Send + Sync, { - AuthorizationServiceClient::new(InterceptedService::new(inner, interceptor)) + StorageStatusServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -1180,17 +1902,17 @@ pub mod authorization_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// CreateAuthorization + /// GetStorageVersion /// /// Status: BETA /// - /// This creates a user-specific attribute that handles permission for a - /// specific resource - pub async fn create_authorization( + /// A request to get the current version of the server application + /// String representation and https://semver.org/ + pub async fn get_storage_version( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1204,28 +1926,28 @@ pub mod authorization_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.AuthorizationService/CreateAuthorization", + "/aruna.api.storage.services.v2.StorageStatusService/GetStorageVersion", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.AuthorizationService", - "CreateAuthorization", + "aruna.api.storage.services.v2.StorageStatusService", + "GetStorageVersion", ), ); self.inner.unary(req, path, codec).await } - /// GetAuthorization + /// GetStorageStatus /// - /// Status: BETA + /// Status: ALPHA /// - /// This gets resource specific user authorizations - pub async fn get_authorizations( + /// A request to get the current status of the storage components by location(s) + pub async fn get_storage_status( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1239,29 +1961,28 @@ pub mod authorization_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.AuthorizationService/GetAuthorizations", + "/aruna.api.storage.services.v2.StorageStatusService/GetStorageStatus", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.AuthorizationService", - "GetAuthorizations", + "aruna.api.storage.services.v2.StorageStatusService", + "GetStorageStatus", ), ); self.inner.unary(req, path, codec).await } - /// DeleteAuthorization + /// GetPubkeys /// /// Status: BETA /// - /// This deletes a user-specific attribute that handles permission for a - /// specific resource - pub async fn delete_authorization( + /// Get all public keys of all storage components + pub async fn get_pubkeys( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1275,29 +1996,30 @@ pub mod authorization_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.AuthorizationService/DeleteAuthorization", + "/aruna.api.storage.services.v2.StorageStatusService/GetPubkeys", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.AuthorizationService", - "DeleteAuthorization", + "aruna.api.storage.services.v2.StorageStatusService", + "GetPubkeys", ), ); self.inner.unary(req, path, codec).await } - /// UpdateAuthorization + /// Get Announcements /// /// Status: BETA /// - /// This creates a user-specific attribute that handles permission for a - /// specific resource - pub async fn update_authorization( + /// Query global announcements optionally filtered by specific ids. + /// - Returns all announcements if no ids are provided + /// - Returns only the specific announcements if ids are provided + pub async fn get_announcements( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1311,14 +2033,119 @@ pub mod authorization_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.AuthorizationService/UpdateAuthorization", + "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncements", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.AuthorizationService", - "UpdateAuthorization", + "aruna.api.storage.services.v2.StorageStatusService", + "GetAnnouncements", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetAnnouncementsByType + /// + /// Status: BETA + /// + /// Query global announcements by type + pub async fn get_announcements_by_type( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncementsByType", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.StorageStatusService", + "GetAnnouncementsByType", + ), + ); + self.inner.unary(req, path, codec).await + } + /// Get a specific Announcement + /// + /// Status: BETA + /// + /// Query a specific global announcement by its id + pub async fn get_announcement( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncement", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.StorageStatusService", + "GetAnnouncement", + ), + ); + self.inner.unary(req, path, codec).await + } + /// SetAnnouncements + /// + /// Status: BETA + /// + /// Update / add global announcements + pub async fn set_announcements( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.StorageStatusService/SetAnnouncements", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.StorageStatusService", + "SetAnnouncements", ), ); self.inner.unary(req, path, codec).await @@ -1326,71 +2153,109 @@ pub mod authorization_service_client { } } /// Generated server implementations. -pub mod authorization_service_server { +pub mod storage_status_service_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with AuthorizationServiceServer. + /// Generated trait containing gRPC methods that should be implemented for use with StorageStatusServiceServer. #[async_trait] - pub trait AuthorizationService: Send + Sync + 'static { - /// CreateAuthorization + pub trait StorageStatusService: Send + Sync + 'static { + /// GetStorageVersion /// /// Status: BETA /// - /// This creates a user-specific attribute that handles permission for a - /// specific resource - async fn create_authorization( + /// A request to get the current version of the server application + /// String representation and https://semver.org/ + async fn get_storage_version( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetAuthorization + /// GetStorageStatus + /// + /// Status: ALPHA + /// + /// A request to get the current status of the storage components by location(s) + async fn get_storage_status( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetPubkeys /// /// Status: BETA /// - /// This gets resource specific user authorizations - async fn get_authorizations( + /// Get all public keys of all storage components + async fn get_pubkeys( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// DeleteAuthorization + /// Get Announcements /// /// Status: BETA /// - /// This deletes a user-specific attribute that handles permission for a - /// specific resource - async fn delete_authorization( + /// Query global announcements optionally filtered by specific ids. + /// - Returns all announcements if no ids are provided + /// - Returns only the specific announcements if ids are provided + async fn get_announcements( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateAuthorization + /// GetAnnouncementsByType /// /// Status: BETA /// - /// This creates a user-specific attribute that handles permission for a - /// specific resource - async fn update_authorization( + /// Query global announcements by type + async fn get_announcements_by_type( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, + tonic::Status, + >; + /// Get a specific Announcement + /// + /// Status: BETA + /// + /// Query a specific global announcement by its id + async fn get_announcement( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// SetAnnouncements + /// + /// Status: BETA + /// + /// Update / add global announcements + async fn set_announcements( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, tonic::Status, >; } - /// AuthorizationService + /// StorageStatusService /// /// Status: BETA /// - /// Contains all methods to edit and change user authorization + /// This is a generic service that contains utility functions + /// these functions are used to query additional meta-information + /// about the status of storage components #[derive(Debug)] - pub struct AuthorizationServiceServer { + pub struct StorageStatusServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -1398,7 +2263,7 @@ pub mod authorization_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl AuthorizationServiceServer { + impl StorageStatusServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -1451,9 +2316,9 @@ pub mod authorization_service_server { } } impl tonic::codegen::Service> - for AuthorizationServiceServer + for StorageStatusServiceServer where - T: AuthorizationService, + T: StorageStatusService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -1469,25 +2334,25 @@ pub mod authorization_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.AuthorizationService/CreateAuthorization" => { + "/aruna.api.storage.services.v2.StorageStatusService/GetStorageVersion" => { #[allow(non_camel_case_types)] - struct CreateAuthorizationSvc(pub Arc); + struct GetStorageVersionSvc(pub Arc); impl< - T: AuthorizationService, - > tonic::server::UnaryService - for CreateAuthorizationSvc { - type Response = super::CreateAuthorizationResponse; + T: StorageStatusService, + > tonic::server::UnaryService + for GetStorageVersionSvc { + type Response = super::GetStorageVersionResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_authorization( + ::get_storage_version( &inner, request, ) @@ -1503,7 +2368,7 @@ pub mod authorization_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateAuthorizationSvc(inner); + let method = GetStorageVersionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1519,25 +2384,25 @@ pub mod authorization_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.AuthorizationService/GetAuthorizations" => { + "/aruna.api.storage.services.v2.StorageStatusService/GetStorageStatus" => { #[allow(non_camel_case_types)] - struct GetAuthorizationsSvc(pub Arc); + struct GetStorageStatusSvc(pub Arc); impl< - T: AuthorizationService, - > tonic::server::UnaryService - for GetAuthorizationsSvc { - type Response = super::GetAuthorizationsResponse; - type Future = BoxFuture< - tonic::Response, + T: StorageStatusService, + > tonic::server::UnaryService + for GetStorageStatusSvc { + type Response = super::GetStorageStatusResponse; + type Future = BoxFuture< + tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_authorizations( + ::get_storage_status( &inner, request, ) @@ -1553,7 +2418,7 @@ pub mod authorization_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetAuthorizationsSvc(inner); + let method = GetStorageStatusSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1569,25 +2434,72 @@ pub mod authorization_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.AuthorizationService/DeleteAuthorization" => { + "/aruna.api.storage.services.v2.StorageStatusService/GetPubkeys" => { #[allow(non_camel_case_types)] - struct DeleteAuthorizationSvc(pub Arc); + struct GetPubkeysSvc(pub Arc); impl< - T: AuthorizationService, - > tonic::server::UnaryService - for DeleteAuthorizationSvc { - type Response = super::DeleteAuthorizationResponse; + T: StorageStatusService, + > tonic::server::UnaryService + for GetPubkeysSvc { + type Response = super::GetPubkeysResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_authorization( + ::get_pubkeys(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetPubkeysSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncements" => { + #[allow(non_camel_case_types)] + struct GetAnnouncementsSvc(pub Arc); + impl< + T: StorageStatusService, + > tonic::server::UnaryService + for GetAnnouncementsSvc { + type Response = super::GetAnnouncementsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_announcements( &inner, request, ) @@ -1603,7 +2515,7 @@ pub mod authorization_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteAuthorizationSvc(inner); + let method = GetAnnouncementsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1619,25 +2531,27 @@ pub mod authorization_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.AuthorizationService/UpdateAuthorization" => { + "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncementsByType" => { #[allow(non_camel_case_types)] - struct UpdateAuthorizationSvc(pub Arc); + struct GetAnnouncementsByTypeSvc( + pub Arc, + ); impl< - T: AuthorizationService, - > tonic::server::UnaryService - for UpdateAuthorizationSvc { - type Response = super::UpdateAuthorizationResponse; + T: StorageStatusService, + > tonic::server::UnaryService + for GetAnnouncementsByTypeSvc { + type Response = super::GetAnnouncementsByTypeResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_authorization( + ::get_announcements_by_type( &inner, request, ) @@ -1653,7 +2567,107 @@ pub mod authorization_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateAuthorizationSvc(inner); + let method = GetAnnouncementsByTypeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncement" => { + #[allow(non_camel_case_types)] + struct GetAnnouncementSvc(pub Arc); + impl< + T: StorageStatusService, + > tonic::server::UnaryService + for GetAnnouncementSvc { + type Response = super::GetAnnouncementResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_announcement( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetAnnouncementSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.StorageStatusService/SetAnnouncements" => { + #[allow(non_camel_case_types)] + struct SetAnnouncementsSvc(pub Arc); + impl< + T: StorageStatusService, + > tonic::server::UnaryService + for SetAnnouncementsSvc { + type Response = super::SetAnnouncementsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::set_announcements( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SetAnnouncementsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1684,7 +2698,7 @@ pub mod authorization_service_server { } } } - impl Clone for AuthorizationServiceServer { + impl Clone for StorageStatusServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1696,7 +2710,7 @@ pub mod authorization_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -1706,103 +2720,251 @@ pub mod authorization_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService - for AuthorizationServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.AuthorizationService"; + impl tonic::server::NamedService + for StorageStatusServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.StorageStatusService"; } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct SearchResourcesRequest { +pub struct CreateDatasetRequest { + /// dataset name #[prost(string, tag = "1")] - pub query: ::prost::alloc::string::String, + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "10")] + pub title: ::prost::alloc::string::String, + /// Description #[prost(string, tag = "2")] - pub filter: ::prost::alloc::string::String, - #[prost(int64, tag = "3")] - pub limit: i64, - #[prost(int64, tag = "4")] - pub offset: i64, + pub description: ::prost::alloc::string::String, + /// dataset specific labels / hooks + #[prost(message, repeated, tag = "3")] + pub key_values: ::prost::alloc::vec::Vec, + /// Internal / External relations (URLs / IDs from external sources) + #[prost(message, repeated, tag = "4")] + pub relations: ::prost::alloc::vec::Vec, + /// DataClass + #[prost(enumeration = "super::super::models::v2::DataClass", tag = "5")] + pub data_class: i32, + #[prost(string, optional, tag = "8")] + pub metadata_license_tag: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag = "9")] + pub default_data_license_tag: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "11")] + pub authors: ::prost::alloc::vec::Vec, + /// Parent_id MUST be dataset + #[prost(oneof = "create_dataset_request::Parent", tags = "6, 7")] + pub parent: ::core::option::Option, +} +/// Nested message and enum types in `CreateDatasetRequest`. +pub mod create_dataset_request { + /// Parent_id MUST be dataset + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Parent { + #[prost(string, tag = "6")] + ProjectId(::prost::alloc::string::String), + #[prost(string, tag = "7")] + CollectionId(::prost::alloc::string::String), + } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct SearchResourcesResponse { - /// Json list for each found resource - #[prost(message, repeated, tag = "1")] - pub resources: ::prost::alloc::vec::Vec, - /// How many results are expected to be found ? - #[prost(int64, tag = "2")] - pub estimated_total: i64, - /// The last index returned - #[prost(int64, tag = "3")] - pub last_index: i64, +pub struct CreateDatasetResponse { + /// The new dataset_id + #[prost(message, optional, tag = "1")] + pub dataset: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetResourceRequest { +pub struct GetDatasetRequest { + /// Requested id #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, + pub dataset_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ResourceWithPermission { +pub struct GetDatasetResponse { + /// Overview of the requested dataset #[prost(message, optional, tag = "1")] - pub resource: ::core::option::Option, - #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "2")] - pub permission: i32, + pub dataset: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetResourceResponse { +pub struct GetDatasetsRequest { + #[prost(string, repeated, tag = "1")] + pub dataset_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetDatasetsResponse { + /// List of dataset overviews + #[prost(message, repeated, tag = "1")] + pub datasets: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteDatasetRequest { + #[prost(string, tag = "1")] + pub dataset_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteDatasetResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetNameRequest { + #[prost(string, tag = "1")] + pub dataset_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetNameResponse { #[prost(message, optional, tag = "1")] - pub resource: ::core::option::Option, + pub dataset: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetResourcesRequest { - #[prost(string, repeated, tag = "1")] - pub resource_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +pub struct UpdateDatasetDescriptionRequest { + #[prost(string, tag = "1")] + pub dataset_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetResourcesResponse { - #[prost(message, repeated, tag = "1")] - pub resources: ::prost::alloc::vec::Vec, +pub struct UpdateDatasetDescriptionResponse { + #[prost(message, optional, tag = "1")] + pub dataset: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct RequestResourceAccessRequest { +pub struct UpdateDatasetKeyValuesRequest { #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, + pub dataset_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub add_key_values: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub remove_key_values: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetKeyValuesResponse { + #[prost(message, optional, tag = "1")] + pub dataset: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetDataClassRequest { + #[prost(string, tag = "1")] + pub dataset_id: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::DataClass", tag = "2")] + pub data_class: i32, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetDataClassResponse { + #[prost(message, optional, tag = "1")] + pub dataset: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SnapshotDatasetRequest { + #[prost(string, tag = "1")] + pub dataset_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SnapshotDatasetResponse { + /// This dataset will be returned via an Persistent Identifier! Updates will be impossible + #[prost(message, optional, tag = "1")] + pub dataset: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetLicensesRequest { + #[prost(string, tag = "1")] + pub dataset_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] - pub message: ::prost::alloc::string::String, + pub metadata_license_tag: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub default_data_license_tag: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct RequestResourceAccessResponse {} +pub struct UpdateDatasetLicensesResponse { + #[prost(message, optional, tag = "1")] + pub dataset: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetTitleRequest { + #[prost(string, tag = "1")] + pub dataset_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub title: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetTitleResponse { + #[prost(message, optional, tag = "1")] + pub dataset: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetAuthorsRequest { + #[prost(string, tag = "1")] + pub dataset_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub add_authors: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub remove_authors: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetAuthorsResponse { + #[prost(message, optional, tag = "1")] + pub dataset: ::core::option::Option, +} /// Generated client implementations. -pub mod search_service_client { +pub mod dataset_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// SearchService - /// - /// Status: BETA + /// DatasetService /// - /// SearchService is used to query resources in the index and get a public view of them. + /// Contains all methods that get/create or update Dataset and associated resources #[derive(Debug, Clone)] - pub struct SearchServiceClient { + pub struct DatasetServiceClient { inner: tonic::client::Grpc, } - impl SearchServiceClient { + impl DatasetServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -1813,7 +2975,7 @@ pub mod search_service_client { Ok(Self::new(conn)) } } - impl SearchServiceClient + impl DatasetServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -1831,7 +2993,7 @@ pub mod search_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> SearchServiceClient> + ) -> DatasetServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -1845,7 +3007,7 @@ pub mod search_service_client { http::Request, >>::Error: Into + Send + Sync, { - SearchServiceClient::new(InterceptedService::new(inner, interceptor)) + DatasetServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -1878,16 +3040,16 @@ pub mod search_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// SearchResources + /// CreateNewDataset /// /// Status: BETA /// - /// Searches the index for applicable resources (only public + private can be searched) - pub async fn search_resources( + /// creates a new Dataset + pub async fn create_dataset( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1901,28 +3063,28 @@ pub mod search_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.SearchService/SearchResources", + "/aruna.api.storage.services.v2.DatasetService/CreateDataset", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.SearchService", - "SearchResources", + "aruna.api.storage.services.v2.DatasetService", + "CreateDataset", ), ); self.inner.unary(req, path, codec).await } - /// GetResource + /// GetDataset /// /// Status: BETA /// - /// Retrieves resource by its ID. - pub async fn get_resource( + /// Request a specific dataset by ID + pub async fn get_dataset( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1936,28 +3098,28 @@ pub mod search_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.SearchService/GetResource", + "/aruna.api.storage.services.v2.DatasetService/GetDataset", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.SearchService", - "GetResource", + "aruna.api.storage.services.v2.DatasetService", + "GetDataset", ), ); self.inner.unary(req, path, codec).await } - /// GetResources + /// GetDatasets /// /// Status: BETA /// - /// Retrieves resources by a list of IDs. - pub async fn get_resources( + /// Queries multiple datasets by ID + pub async fn get_datasets( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1971,28 +3133,28 @@ pub mod search_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.SearchService/GetResources", + "/aruna.api.storage.services.v2.DatasetService/GetDatasets", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.SearchService", - "GetResources", + "aruna.api.storage.services.v2.DatasetService", + "GetDatasets", ), ); self.inner.unary(req, path, codec).await } - /// RequestResourceAccess + /// DeleteDataset /// - /// Status: ALPHA + /// Status: STABLE /// - /// Requests access to resources - pub async fn request_resource_access( + /// This request deletes the dataset. + pub async fn delete_dataset( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -2006,1636 +3168,553 @@ pub mod search_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.SearchService/RequestResourceAccess", + "/aruna.api.storage.services.v2.DatasetService/DeleteDataset", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.SearchService", - "RequestResourceAccess", + "aruna.api.storage.services.v2.DatasetService", + "DeleteDataset", ), ); self.inner.unary(req, path, codec).await } - } -} -/// Generated server implementations. -pub mod search_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with SearchServiceServer. - #[async_trait] - pub trait SearchService: Send + Sync + 'static { - /// SearchResources + /// UpdateDatasetName /// /// Status: BETA /// - /// Searches the index for applicable resources (only public + private can be searched) - async fn search_resources( - &self, - request: tonic::Request, + /// Updates the dataset name. Caveat! Will rename the "s3 bucket" for data proxies! + pub async fn update_dataset_name( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// GetResource + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetName", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.DatasetService", + "UpdateDatasetName", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateDatasetDescription /// /// Status: BETA /// - /// Retrieves resource by its ID. - async fn get_resource( - &self, - request: tonic::Request, + /// Updates the dataset description. + pub async fn update_dataset_description( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// GetResources + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetDescription", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.DatasetService", + "UpdateDatasetDescription", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateDatasetKeyValues /// /// Status: BETA /// - /// Retrieves resources by a list of IDs. - async fn get_resources( - &self, - request: tonic::Request, + /// Updates the dataset key values. + pub async fn update_dataset_key_values( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// RequestResourceAccess + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetKeyValues", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.DatasetService", + "UpdateDatasetKeyValues", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateDatasetDataClass /// - /// Status: ALPHA + /// Status: BETA /// - /// Requests access to resources - async fn request_resource_access( - &self, - request: tonic::Request, + /// Updates the dataset name. All (meta) data will be overwritten. + pub async fn update_dataset_data_class( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - } - /// SearchService - /// - /// Status: BETA - /// - /// SearchService is used to query resources in the index and get a public view of them. - #[derive(Debug)] - pub struct SearchServiceServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl SearchServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetDataClass", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.DatasetService", + "UpdateDatasetDataClass", + ), + ); + self.inner.unary(req, path, codec).await } - /// Limits the maximum size of a decoded message. + /// SnapshotDatasetRequest /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. + /// Status: BETA /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for SearchServiceServer - where - T: SearchService, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( + /// Archives the full dataset, rendering all downstream relations immutable + pub async fn snapshot_dataset( &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/aruna.api.storage.services.v2.SearchService/SearchResources" => { - #[allow(non_camel_case_types)] - struct SearchResourcesSvc(pub Arc); - impl< - T: SearchService, - > tonic::server::UnaryService - for SearchResourcesSvc { - type Response = super::SearchResourcesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::search_resources(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = SearchResourcesSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.SearchService/GetResource" => { - #[allow(non_camel_case_types)] - struct GetResourceSvc(pub Arc); - impl< - T: SearchService, - > tonic::server::UnaryService - for GetResourceSvc { - type Response = super::GetResourceResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_resource(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetResourceSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.SearchService/GetResources" => { - #[allow(non_camel_case_types)] - struct GetResourcesSvc(pub Arc); - impl< - T: SearchService, - > tonic::server::UnaryService - for GetResourcesSvc { - type Response = super::GetResourcesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_resources(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetResourcesSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.SearchService/RequestResourceAccess" => { - #[allow(non_camel_case_types)] - struct RequestResourceAccessSvc(pub Arc); - impl< - T: SearchService, - > tonic::server::UnaryService - for RequestResourceAccessSvc { - type Response = super::RequestResourceAccessResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::request_resource_access( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = RequestResourceAccessSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for SearchServiceServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.DatasetService/SnapshotDataset", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.DatasetService", + "SnapshotDataset", + ), + ); + self.inner.unary(req, path, codec).await } - } - impl tonic::server::NamedService for SearchServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.SearchService"; - } -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateServiceAccountRequest { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub project_id: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "3")] - pub permission_level: i32, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ServiceAccount { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub permission: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateServiceAccountResponse { - #[prost(message, optional, tag = "1")] - pub service_account: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateServiceAccountTokenRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - /// Token permissions - #[prost(message, optional, tag = "2")] - pub permission: ::core::option::Option, - /// (optional) Token name - #[prost(string, tag = "3")] - pub name: ::prost::alloc::string::String, - /// (optional) Token expiry - #[prost(message, optional, tag = "4")] - pub expires_at: ::core::option::Option<::prost_wkt_types::Timestamp>, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateServiceAccountTokenResponse { - /// This contains only the token description - #[prost(message, optional, tag = "1")] - pub token: ::core::option::Option, - /// This is the actual secret API token - #[prost(string, tag = "2")] - pub token_secret: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetServiceAccountTokenRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub token_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetServiceAccountTokenResponse { - /// This contains only the token description - #[prost(message, optional, tag = "1")] - pub token: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetServiceAccountTokensRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetServiceAccountTokensResponse { - /// This contains only the token description - #[prost(message, repeated, tag = "1")] - pub tokens: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteServiceAccountTokenRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub token_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteServiceAccountTokenResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteServiceAccountTokensRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteServiceAccountTokensResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteServiceAccountRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteServiceAccountResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateS3CredentialsSvcAccountRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateS3CredentialsSvcAccountResponse { - #[prost(string, tag = "1")] - pub s3_access_key: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub s3_secret_key: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub s3_endpoint_url: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetS3CredentialsSvcAccountRequest { - /// If called as admin, an id must be provided - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetS3CredentialsSvcAccountResponse { - #[prost(string, tag = "1")] - pub s3_access_key: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub s3_secret_key: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub s3_endpoint_url: ::prost::alloc::string::String, + /// UpdateLicenses + /// + /// Status: BETA + /// + /// Updates the dataset metadata license and/or default data license. + pub async fn update_dataset_licenses( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetLicenses", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.DatasetService", + "UpdateDatasetLicenses", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateTitle + /// + /// Status: ALPHA + /// + /// Updates the datasets metadata title. + pub async fn update_dataset_title( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetTitle", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.DatasetService", + "UpdateDatasetTitle", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateAuthors + /// + /// Status: ALPHA + /// + /// Updates the datasets metadata title. + pub async fn update_dataset_authors( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetAuthors", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.DatasetService", + "UpdateDatasetAuthors", + ), + ); + self.inner.unary(req, path, codec).await + } + } } -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteS3CredentialsSvcAccountRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteS3CredentialsSvcAccountResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateDataproxyTokenSvcAccountRequest { - /// Needs to be provided by project admins - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - /// optional context to limit the scope - #[prost(message, optional, tag = "3")] - pub context: ::core::option::Option, - #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateDataproxyTokenSvcAccountResponse { - #[prost(string, tag = "1")] - pub token: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddPubkeySvcAccountRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub public_key: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddPubkeySvcAccountResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddTrustedEndpointsSvcAccountRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddTrustedEndpointsSvcAccountResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveTrustedEndpointsSvcAccountRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveTrustedEndpointsSvcAccountResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddDataProxyAttributeSvcAccountRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub attribute: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddDataProxyAttributeSvcAccountResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveDataProxyAttributeSvcAccountRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub dataproxy_id: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub attribute_name: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveDataProxyAttributeSvcAccountResponse {} -/// Generated client implementations. -pub mod service_account_service_client { +/// Generated server implementations. +pub mod dataset_service_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// ServiceAccountService - /// - /// Status: BETA - /// - /// Service that contains CRUD operations for service_accounts. - /// Service accounts are project specific accounts that can be used for automation. - #[derive(Debug, Clone)] - pub struct ServiceAccountServiceClient { - inner: tonic::client::Grpc, - } - impl ServiceAccountServiceClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl ServiceAccountServiceClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> ServiceAccountServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - ServiceAccountServiceClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. + /// Generated trait containing gRPC methods that should be implemented for use with DatasetServiceServer. + #[async_trait] + pub trait DatasetService: Send + Sync + 'static { + /// CreateNewDataset /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. + /// Status: BETA /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// CreateServiceAccount + /// creates a new Dataset + async fn create_dataset( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetDataset /// /// Status: BETA /// - /// Creates a service account for a given project - /// If the service account has permissions for the global Admin project - /// it will be a global service account that can interact with any resource - pub async fn create_service_account( - &mut self, - request: impl tonic::IntoRequest, + /// Request a specific dataset by ID + async fn get_dataset( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/CreateServiceAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "CreateServiceAccount", - ), - ); - self.inner.unary(req, path, codec).await - } - /// CreateServiceAccountToken + >; + /// GetDatasets /// /// Status: BETA /// - /// Creates a token for a service account - /// Each service account can only have one permission -> The token will have the same permission as the - /// service account or a subset of it. - pub async fn create_service_account_token( - &mut self, - request: impl tonic::IntoRequest, + /// Queries multiple datasets by ID + async fn get_datasets( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/CreateServiceAccountToken", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "CreateServiceAccountToken", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetServiceAccountToken + >; + /// DeleteDataset /// - /// Status: BETA + /// Status: STABLE /// - /// This requests the overall information about a specifc service account token (by id) - /// it will not contain the token itself. - pub async fn get_service_account_token( - &mut self, - request: impl tonic::IntoRequest, + /// This request deletes the dataset. + async fn delete_dataset( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/GetServiceAccountToken", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "GetServiceAccountToken", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetServiceAccountTokens + >; + /// UpdateDatasetName /// /// Status: BETA /// - /// This requests the overall information about all service account tokens - /// it will not contain the token itself. - pub async fn get_service_account_tokens( - &mut self, - request: impl tonic::IntoRequest, + /// Updates the dataset name. Caveat! Will rename the "s3 bucket" for data proxies! + async fn update_dataset_name( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/GetServiceAccountTokens", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "GetServiceAccountTokens", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeleteServiceAccountToken + >; + /// UpdateDatasetDescription /// /// Status: BETA /// - /// Deletes one service account token by ID - pub async fn delete_service_account_token( - &mut self, - request: impl tonic::IntoRequest, + /// Updates the dataset description. + async fn update_dataset_description( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccountToken", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "DeleteServiceAccountToken", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeleteServiceAccountTokens + >; + /// UpdateDatasetKeyValues /// /// Status: BETA /// - /// Deletes all service account tokens - pub async fn delete_service_account_tokens( - &mut self, - request: impl tonic::IntoRequest, + /// Updates the dataset key values. + async fn update_dataset_key_values( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccountTokens", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "DeleteServiceAccountTokens", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeleteServiceAccount + >; + /// UpdateDatasetDataClass /// /// Status: BETA /// - /// Deletes a service account (by id) - pub async fn delete_service_account( - &mut self, - request: impl tonic::IntoRequest, + /// Updates the dataset name. All (meta) data will be overwritten. + async fn update_dataset_data_class( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "DeleteServiceAccount", - ), - ); - self.inner.unary(req, path, codec).await - } - /// CreateS3CredentialsSvcAccount + >; + /// SnapshotDatasetRequest /// - /// Status: ALPHA + /// Status: BETA /// - /// Creates or updates S3 credentials for a specific SvcAccount and data_proxy - pub async fn create_s3_credentials_svc_account( - &mut self, - request: impl tonic::IntoRequest, + /// Archives the full dataset, rendering all downstream relations immutable + async fn snapshot_dataset( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/CreateS3CredentialsSvcAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "CreateS3CredentialsSvcAccount", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetS3CredentialsSvcAccount + >; + /// UpdateLicenses /// - /// Status: ALPHA + /// Status: BETA /// - /// Gets S3 credentials for a specific svc_account and data_proxy - pub async fn get_s3_credentials_svc_account( - &mut self, - request: impl tonic::IntoRequest, + /// Updates the dataset metadata license and/or default data license. + async fn update_dataset_licenses( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/GetS3CredentialsSvcAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "GetS3CredentialsSvcAccount", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeleteS3CredentialsSvcAccount + >; + /// UpdateTitle /// /// Status: ALPHA /// - /// Revokes existing S3 credentials for a specific user and data_proxy - pub async fn delete_s3_credentials_svc_account( - &mut self, - request: impl tonic::IntoRequest, + /// Updates the datasets metadata title. + async fn update_dataset_title( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/DeleteS3CredentialsSvcAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "DeleteS3CredentialsSvcAccount", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetDataproxyToken + >; + /// UpdateAuthors /// /// Status: ALPHA /// - /// Gets token for a specific SvcAccount and data_proxy - pub async fn create_dataproxy_token_svc_account( - &mut self, - request: impl tonic::IntoRequest< - super::CreateDataproxyTokenSvcAccountRequest, - >, + /// Updates the datasets metadata title. + async fn update_dataset_authors( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/CreateDataproxyTokenSvcAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "CreateDataproxyTokenSvcAccount", - ), - ); - self.inner.unary(req, path, codec).await + >; + } + /// DatasetService + /// + /// Contains all methods that get/create or update Dataset and associated resources + #[derive(Debug)] + pub struct DatasetServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl DatasetServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) } - /// AddPubkeySvcAccount - /// - /// Status: ALPHA - /// - /// Adds an ED25519 public key for the SvcAccount - pub async fn add_pubkey_svc_account( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/AddPubkeySvcAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "AddPubkeySvcAccount", - ), - ); - self.inner.unary(req, path, codec).await + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } } - /// AddTrustedEndpointsSvcAccount - /// - /// Status: ALPHA - /// - /// Adds an endpoint to the trusted endpoints list of the SvcAccount - pub async fn add_trusted_endpoints_svc_account( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/AddTrustedEndpointsSvcAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "AddTrustedEndpointsSvcAccount", - ), - ); - self.inner.unary(req, path, codec).await + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) } - /// RemoveTrustedEndpointsSvcAccount + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. /// - /// Status: ALPHA + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. /// - /// Removes an endpoint from the trusted endpoints list of the SvcAccount - pub async fn remove_trusted_endpoints_svc_account( + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for DatasetServiceServer + where + T: DatasetService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( &mut self, - request: impl tonic::IntoRequest< - super::RemoveTrustedEndpointsSvcAccountRequest, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/RemoveTrustedEndpointsSvcAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "RemoveTrustedEndpointsSvcAccount", - ), - ); - self.inner.unary(req, path, codec).await - } - /// AddDataProxyAttributeSvcAccount - /// - /// Status: ALPHA - /// - /// Adds an data proxy specific attribute to the SvcAccount - pub async fn add_data_proxy_attribute_svc_account( - &mut self, - request: impl tonic::IntoRequest< - super::AddDataProxyAttributeSvcAccountRequest, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/AddDataProxyAttributeSvcAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "AddDataProxyAttributeSvcAccount", - ), - ); - self.inner.unary(req, path, codec).await - } - /// RemoveDataProxyAttributeSvcAccount - /// - /// Status: ALPHA - /// - /// Removes an data proxy specific attribute from the SvcAccount - pub async fn remove_data_proxy_attribute_svc_account( - &mut self, - request: impl tonic::IntoRequest< - super::RemoveDataProxyAttributeSvcAccountRequest, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/RemoveDataProxyAttributeSvcAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "RemoveDataProxyAttributeSvcAccount", - ), - ); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod service_account_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with ServiceAccountServiceServer. - #[async_trait] - pub trait ServiceAccountService: Send + Sync + 'static { - /// CreateServiceAccount - /// - /// Status: BETA - /// - /// Creates a service account for a given project - /// If the service account has permissions for the global Admin project - /// it will be a global service account that can interact with any resource - async fn create_service_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// CreateServiceAccountToken - /// - /// Status: BETA - /// - /// Creates a token for a service account - /// Each service account can only have one permission -> The token will have the same permission as the - /// service account or a subset of it. - async fn create_service_account_token( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetServiceAccountToken - /// - /// Status: BETA - /// - /// This requests the overall information about a specifc service account token (by id) - /// it will not contain the token itself. - async fn get_service_account_token( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetServiceAccountTokens - /// - /// Status: BETA - /// - /// This requests the overall information about all service account tokens - /// it will not contain the token itself. - async fn get_service_account_tokens( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteServiceAccountToken - /// - /// Status: BETA - /// - /// Deletes one service account token by ID - async fn delete_service_account_token( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteServiceAccountTokens - /// - /// Status: BETA - /// - /// Deletes all service account tokens - async fn delete_service_account_tokens( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteServiceAccount - /// - /// Status: BETA - /// - /// Deletes a service account (by id) - async fn delete_service_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// CreateS3CredentialsSvcAccount - /// - /// Status: ALPHA - /// - /// Creates or updates S3 credentials for a specific SvcAccount and data_proxy - async fn create_s3_credentials_svc_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetS3CredentialsSvcAccount - /// - /// Status: ALPHA - /// - /// Gets S3 credentials for a specific svc_account and data_proxy - async fn get_s3_credentials_svc_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteS3CredentialsSvcAccount - /// - /// Status: ALPHA - /// - /// Revokes existing S3 credentials for a specific user and data_proxy - async fn delete_s3_credentials_svc_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetDataproxyToken - /// - /// Status: ALPHA - /// - /// Gets token for a specific SvcAccount and data_proxy - async fn create_dataproxy_token_svc_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AddPubkeySvcAccount - /// - /// Status: ALPHA - /// - /// Adds an ED25519 public key for the SvcAccount - async fn add_pubkey_svc_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AddTrustedEndpointsSvcAccount - /// - /// Status: ALPHA - /// - /// Adds an endpoint to the trusted endpoints list of the SvcAccount - async fn add_trusted_endpoints_svc_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// RemoveTrustedEndpointsSvcAccount - /// - /// Status: ALPHA - /// - /// Removes an endpoint from the trusted endpoints list of the SvcAccount - async fn remove_trusted_endpoints_svc_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AddDataProxyAttributeSvcAccount - /// - /// Status: ALPHA - /// - /// Adds an data proxy specific attribute to the SvcAccount - async fn add_data_proxy_attribute_svc_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// RemoveDataProxyAttributeSvcAccount - /// - /// Status: ALPHA - /// - /// Removes an data proxy specific attribute from the SvcAccount - async fn remove_data_proxy_attribute_svc_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// ServiceAccountService - /// - /// Status: BETA - /// - /// Service that contains CRUD operations for service_accounts. - /// Service accounts are project specific accounts that can be used for automation. - #[derive(Debug)] - pub struct ServiceAccountServiceServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl ServiceAccountServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> - for ServiceAccountServiceServer - where - T: ServiceAccountService, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.ServiceAccountService/CreateServiceAccount" => { + "/aruna.api.storage.services.v2.DatasetService/CreateDataset" => { #[allow(non_camel_case_types)] - struct CreateServiceAccountSvc(pub Arc); + struct CreateDatasetSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService - for CreateServiceAccountSvc { - type Response = super::CreateServiceAccountResponse; + T: DatasetService, + > tonic::server::UnaryService + for CreateDatasetSvc { + type Response = super::CreateDatasetResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_service_account( - &inner, - request, - ) - .await + ::create_dataset(&inner, request).await }; Box::pin(fut) } @@ -3647,7 +3726,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateServiceAccountSvc(inner); + let method = CreateDatasetSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3663,34 +3742,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/CreateServiceAccountToken" => { + "/aruna.api.storage.services.v2.DatasetService/GetDataset" => { #[allow(non_camel_case_types)] - struct CreateServiceAccountTokenSvc( - pub Arc, - ); + struct GetDatasetSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::CreateServiceAccountTokenRequest, - > for CreateServiceAccountTokenSvc { - type Response = super::CreateServiceAccountTokenResponse; + T: DatasetService, + > tonic::server::UnaryService + for GetDatasetSvc { + type Response = super::GetDatasetResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::CreateServiceAccountTokenRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_service_account_token( - &inner, - request, - ) - .await + ::get_dataset(&inner, request).await }; Box::pin(fut) } @@ -3702,7 +3772,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateServiceAccountTokenSvc(inner); + let method = GetDatasetSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3718,31 +3788,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/GetServiceAccountToken" => { + "/aruna.api.storage.services.v2.DatasetService/GetDatasets" => { #[allow(non_camel_case_types)] - struct GetServiceAccountTokenSvc( - pub Arc, - ); + struct GetDatasetsSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService - for GetServiceAccountTokenSvc { - type Response = super::GetServiceAccountTokenResponse; + T: DatasetService, + > tonic::server::UnaryService + for GetDatasetsSvc { + type Response = super::GetDatasetsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_service_account_token( - &inner, - request, - ) - .await + ::get_datasets(&inner, request).await }; Box::pin(fut) } @@ -3754,7 +3818,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetServiceAccountTokenSvc(inner); + let method = GetDatasetsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3770,33 +3834,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/GetServiceAccountTokens" => { + "/aruna.api.storage.services.v2.DatasetService/DeleteDataset" => { #[allow(non_camel_case_types)] - struct GetServiceAccountTokensSvc( - pub Arc, - ); + struct DeleteDatasetSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService - for GetServiceAccountTokensSvc { - type Response = super::GetServiceAccountTokensResponse; + T: DatasetService, + > tonic::server::UnaryService + for DeleteDatasetSvc { + type Response = super::DeleteDatasetResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::GetServiceAccountTokensRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_service_account_tokens( - &inner, - request, - ) - .await + ::delete_dataset(&inner, request).await }; Box::pin(fut) } @@ -3808,7 +3864,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetServiceAccountTokensSvc(inner); + let method = DeleteDatasetSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3824,33 +3880,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccountToken" => { + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetName" => { #[allow(non_camel_case_types)] - struct DeleteServiceAccountTokenSvc( - pub Arc, - ); + struct UpdateDatasetNameSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::DeleteServiceAccountTokenRequest, - > for DeleteServiceAccountTokenSvc { - type Response = super::DeleteServiceAccountTokenResponse; + T: DatasetService, + > tonic::server::UnaryService + for UpdateDatasetNameSvc { + type Response = super::UpdateDatasetNameResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::DeleteServiceAccountTokenRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_service_account_token( - &inner, - request, - ) + ::update_dataset_name(&inner, request) .await }; Box::pin(fut) @@ -3863,7 +3911,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteServiceAccountTokenSvc(inner); + let method = UpdateDatasetNameSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3879,17 +3927,14 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccountTokens" => { + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetDescription" => { #[allow(non_camel_case_types)] - struct DeleteServiceAccountTokensSvc( - pub Arc, - ); + struct UpdateDatasetDescriptionSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::DeleteServiceAccountTokensRequest, - > for DeleteServiceAccountTokensSvc { - type Response = super::DeleteServiceAccountTokensResponse; + T: DatasetService, + > tonic::server::UnaryService + for UpdateDatasetDescriptionSvc { + type Response = super::UpdateDatasetDescriptionResponse; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -3897,12 +3942,12 @@ pub mod service_account_service_server { fn call( &mut self, request: tonic::Request< - super::DeleteServiceAccountTokensRequest, + super::UpdateDatasetDescriptionRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_service_account_tokens( + ::update_dataset_description( &inner, request, ) @@ -3918,7 +3963,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteServiceAccountTokensSvc(inner); + let method = UpdateDatasetDescriptionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3934,25 +3979,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccount" => { + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetKeyValues" => { #[allow(non_camel_case_types)] - struct DeleteServiceAccountSvc(pub Arc); + struct UpdateDatasetKeyValuesSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService - for DeleteServiceAccountSvc { - type Response = super::DeleteServiceAccountResponse; + T: DatasetService, + > tonic::server::UnaryService + for UpdateDatasetKeyValuesSvc { + type Response = super::UpdateDatasetKeyValuesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_service_account( + ::update_dataset_key_values( &inner, request, ) @@ -3968,7 +4013,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteServiceAccountSvc(inner); + let method = UpdateDatasetKeyValuesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3984,30 +4029,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/CreateS3CredentialsSvcAccount" => { + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetDataClass" => { #[allow(non_camel_case_types)] - struct CreateS3CredentialsSvcAccountSvc( - pub Arc, - ); + struct UpdateDatasetDataClassSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::CreateS3CredentialsSvcAccountRequest, - > for CreateS3CredentialsSvcAccountSvc { - type Response = super::CreateS3CredentialsSvcAccountResponse; + T: DatasetService, + > tonic::server::UnaryService + for UpdateDatasetDataClassSvc { + type Response = super::UpdateDatasetDataClassResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::CreateS3CredentialsSvcAccountRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_s3_credentials_svc_account( + ::update_dataset_data_class( &inner, request, ) @@ -4023,7 +4063,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateS3CredentialsSvcAccountSvc(inner); + let method = UpdateDatasetDataClassSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4039,33 +4079,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/GetS3CredentialsSvcAccount" => { + "/aruna.api.storage.services.v2.DatasetService/SnapshotDataset" => { #[allow(non_camel_case_types)] - struct GetS3CredentialsSvcAccountSvc( - pub Arc, - ); + struct SnapshotDatasetSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::GetS3CredentialsSvcAccountRequest, - > for GetS3CredentialsSvcAccountSvc { - type Response = super::GetS3CredentialsSvcAccountResponse; + T: DatasetService, + > tonic::server::UnaryService + for SnapshotDatasetSvc { + type Response = super::SnapshotDatasetResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::GetS3CredentialsSvcAccountRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_s3_credentials_svc_account( - &inner, - request, - ) + ::snapshot_dataset(&inner, request) .await }; Box::pin(fut) @@ -4078,7 +4110,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetS3CredentialsSvcAccountSvc(inner); + let method = SnapshotDatasetSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4094,30 +4126,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/DeleteS3CredentialsSvcAccount" => { + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetLicenses" => { #[allow(non_camel_case_types)] - struct DeleteS3CredentialsSvcAccountSvc( - pub Arc, - ); + struct UpdateDatasetLicensesSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::DeleteS3CredentialsSvcAccountRequest, - > for DeleteS3CredentialsSvcAccountSvc { - type Response = super::DeleteS3CredentialsSvcAccountResponse; + T: DatasetService, + > tonic::server::UnaryService + for UpdateDatasetLicensesSvc { + type Response = super::UpdateDatasetLicensesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::DeleteS3CredentialsSvcAccountRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_s3_credentials_svc_account( + ::update_dataset_licenses( &inner, request, ) @@ -4133,7 +4160,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteS3CredentialsSvcAccountSvc(inner); + let method = UpdateDatasetLicensesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4149,33 +4176,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/CreateDataproxyTokenSvcAccount" => { + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetTitle" => { #[allow(non_camel_case_types)] - struct CreateDataproxyTokenSvcAccountSvc( - pub Arc, - ); + struct UpdateDatasetTitleSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::CreateDataproxyTokenSvcAccountRequest, - > for CreateDataproxyTokenSvcAccountSvc { - type Response = super::CreateDataproxyTokenSvcAccountResponse; + T: DatasetService, + > tonic::server::UnaryService + for UpdateDatasetTitleSvc { + type Response = super::UpdateDatasetTitleResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::CreateDataproxyTokenSvcAccountRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_dataproxy_token_svc_account( - &inner, - request, - ) + ::update_dataset_title(&inner, request) .await }; Box::pin(fut) @@ -4188,7 +4207,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateDataproxyTokenSvcAccountSvc(inner); + let method = UpdateDatasetTitleSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4204,25 +4223,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/AddPubkeySvcAccount" => { + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetAuthors" => { #[allow(non_camel_case_types)] - struct AddPubkeySvcAccountSvc(pub Arc); + struct UpdateDatasetAuthorsSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService - for AddPubkeySvcAccountSvc { - type Response = super::AddPubkeySvcAccountResponse; + T: DatasetService, + > tonic::server::UnaryService + for UpdateDatasetAuthorsSvc { + type Response = super::UpdateDatasetAuthorsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::add_pubkey_svc_account( + ::update_dataset_authors( &inner, request, ) @@ -4238,7 +4257,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = AddPubkeySvcAccountSvc(inner); + let method = UpdateDatasetAuthorsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4254,244 +4273,22 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/AddTrustedEndpointsSvcAccount" => { - #[allow(non_camel_case_types)] - struct AddTrustedEndpointsSvcAccountSvc( - pub Arc, - ); - impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::AddTrustedEndpointsSvcAccountRequest, - > for AddTrustedEndpointsSvcAccountSvc { - type Response = super::AddTrustedEndpointsSvcAccountResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::AddTrustedEndpointsSvcAccountRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::add_trusted_endpoints_svc_account( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = AddTrustedEndpointsSvcAccountSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.ServiceAccountService/RemoveTrustedEndpointsSvcAccount" => { - #[allow(non_camel_case_types)] - struct RemoveTrustedEndpointsSvcAccountSvc( - pub Arc, - ); - impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::RemoveTrustedEndpointsSvcAccountRequest, - > for RemoveTrustedEndpointsSvcAccountSvc { - type Response = super::RemoveTrustedEndpointsSvcAccountResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::RemoveTrustedEndpointsSvcAccountRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::remove_trusted_endpoints_svc_account( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = RemoveTrustedEndpointsSvcAccountSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.ServiceAccountService/AddDataProxyAttributeSvcAccount" => { - #[allow(non_camel_case_types)] - struct AddDataProxyAttributeSvcAccountSvc( - pub Arc, - ); - impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::AddDataProxyAttributeSvcAccountRequest, - > for AddDataProxyAttributeSvcAccountSvc { - type Response = super::AddDataProxyAttributeSvcAccountResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::AddDataProxyAttributeSvcAccountRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::add_data_proxy_attribute_svc_account( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = AddDataProxyAttributeSvcAccountSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.ServiceAccountService/RemoveDataProxyAttributeSvcAccount" => { - #[allow(non_camel_case_types)] - struct RemoveDataProxyAttributeSvcAccountSvc< - T: ServiceAccountService, - >( - pub Arc, - ); - impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::RemoveDataProxyAttributeSvcAccountRequest, - > for RemoveDataProxyAttributeSvcAccountSvc { - type Response = super::RemoveDataProxyAttributeSvcAccountResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::RemoveDataProxyAttributeSvcAccountRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::remove_data_proxy_attribute_svc_account( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = RemoveDataProxyAttributeSvcAccountSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) } } } } - impl Clone for ServiceAccountServiceServer { + impl Clone for DatasetServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -4503,7 +4300,7 @@ pub mod service_account_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -4513,218 +4310,139 @@ pub mod service_account_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService - for ServiceAccountServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.ServiceAccountService"; + impl tonic::server::NamedService for DatasetServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.DatasetService"; } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetStorageVersionRequest {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SemanticVersion { - /// Complete version string +pub struct ReplicateProjectDataRequest { #[prost(string, tag = "1")] - pub version_string: ::prost::alloc::string::String, - /// Semver according to - #[prost(int32, tag = "2")] - pub major: i32, - #[prost(int32, tag = "3")] - pub minor: i32, - #[prost(int32, tag = "4")] - pub patch: i32, - #[prost(string, tag = "5")] - pub labels: ::prost::alloc::string::String, + pub project_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct LocationVersion { - /// Status of a specific Location e.g Gießen / dataproxy / 0.5.0-beta.1 - #[prost(string, tag = "1")] - pub location: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub version: ::prost::alloc::vec::Vec, +pub struct ReplicateProjectDataResponse { + #[prost(enumeration = "super::super::models::v2::ReplicationStatus", tag = "1")] + pub status: i32, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ComponentVersion { - /// Name of a specific component e.g. server, dataproxy etc. and their status by location - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub version: ::core::option::Option, +pub struct PartialReplicateDataRequest { + #[prost(string, tag = "4")] + pub endpoint_id: ::prost::alloc::string::String, + #[prost(oneof = "partial_replicate_data_request::DataVariant", tags = "1, 2, 3")] + pub data_variant: ::core::option::Option< + partial_replicate_data_request::DataVariant, + >, +} +/// Nested message and enum types in `PartialReplicateDataRequest`. +pub mod partial_replicate_data_request { + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum DataVariant { + #[prost(string, tag = "1")] + CollectionId(::prost::alloc::string::String), + #[prost(string, tag = "2")] + DatasetId(::prost::alloc::string::String), + #[prost(string, tag = "3")] + ObjectId(::prost::alloc::string::String), + } } -/// Version of each component by location #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetStorageVersionResponse { - #[prost(message, repeated, tag = "1")] - pub location_version: ::prost::alloc::vec::Vec, +pub struct PartialReplicateDataResponse { + #[prost(enumeration = "super::super::models::v2::ReplicationStatus", tag = "1")] + pub status: i32, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetStorageStatusRequest {} +pub struct UpdateReplicationStatusRequest { + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::ReplicationStatus", tag = "3")] + pub status: i32, +} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct LocationStatus { - /// Status of a specific Location e.g Gießen / AVAILABLE - #[prost(string, tag = "1")] - pub location: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub component_status: ::prost::alloc::vec::Vec, -} +pub struct UpdateReplicationStatusResponse {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ComponentStatus { - /// Name of a specific component e.g. server, dataproxy etc. and their status by location +pub struct GetReplicationStatusRequest { #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::ComponentStatus", tag = "2")] - pub status: i32, + pub resource_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetStorageStatusResponse { - /// List of all locations and their component / status +pub struct GetReplicationStatusResponse { #[prost(message, repeated, tag = "1")] - pub location_status: ::prost::alloc::vec::Vec, + pub infos: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetPubkeysRequest {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetPubkeysResponse { - #[prost(message, repeated, tag = "1")] - pub pubkeys: ::prost::alloc::vec::Vec, -} -/// ------------------------------------- -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Announcement { - /// Announcement id - #[prost(string, tag = "1")] - pub announcement_id: ::prost::alloc::string::String, - /// Announcement type - #[prost(enumeration = "super::super::models::v2::AnnouncementType", tag = "2")] - pub announcement_type: i32, - /// Announcement title - #[prost(string, tag = "3")] - pub title: ::prost::alloc::string::String, - /// Short announcement summary - #[prost(string, tag = "4")] - pub teaser: ::prost::alloc::string::String, - /// URL for announcement preview image - #[prost(string, tag = "5")] - pub image_url: ::prost::alloc::string::String, - /// Announcement content text - #[prost(string, tag = "6")] - pub content: ::prost::alloc::string::String, - /// Initial announcement author - #[prost(string, tag = "7")] - pub created_by: ::prost::alloc::string::String, - /// Initial creation timestamp - #[prost(message, optional, tag = "8")] - pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>, - /// Author responsible for the last modification - #[prost(string, tag = "9")] - pub modified_by: ::prost::alloc::string::String, - /// Last modification timestamp - #[prost(message, optional, tag = "10")] - pub modified_at: ::core::option::Option<::prost_wkt_types::Timestamp>, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SetAnnouncementsRequest { - #[prost(message, repeated, tag = "1")] - pub announcements_upsert: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "2")] - pub announcements_delete: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SetAnnouncementsResponse { - #[prost(message, repeated, tag = "1")] - pub announcements: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAnnouncementsRequest { - #[prost(string, repeated, tag = "1")] - pub announcement_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub page: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAnnouncementsResponse { - #[prost(message, repeated, tag = "1")] - pub announcements: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAnnouncementsByTypeRequest { - #[prost(enumeration = "super::super::models::v2::AnnouncementType", tag = "1")] - pub announcement_type: i32, - #[prost(message, optional, tag = "2")] - pub page: ::core::option::Option, +pub struct ReplicationInfo { + #[prost(message, optional, tag = "5")] + pub endpoint_info: ::core::option::Option, + #[prost(oneof = "replication_info::Resource", tags = "1, 2, 3, 4")] + pub resource: ::core::option::Option, } -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAnnouncementsByTypeResponse { - #[prost(message, repeated, tag = "1")] - pub announcements: ::prost::alloc::vec::Vec, +/// Nested message and enum types in `ReplicationInfo`. +pub mod replication_info { + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Resource { + #[prost(string, tag = "1")] + ProjectId(::prost::alloc::string::String), + #[prost(string, tag = "2")] + CollectionId(::prost::alloc::string::String), + #[prost(string, tag = "3")] + DatasetId(::prost::alloc::string::String), + #[prost(string, tag = "4")] + ObjectId(::prost::alloc::string::String), + } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAnnouncementRequest { +pub struct DeleteReplicationRequest { #[prost(string, tag = "1")] - pub announcement_id: ::prost::alloc::string::String, + pub resource_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAnnouncementResponse { - #[prost(message, optional, tag = "1")] - pub announcement: ::core::option::Option, -} +pub struct DeleteReplicationResponse {} /// Generated client implementations. -pub mod storage_status_service_client { +pub mod data_replication_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// StorageStatusService - /// - /// Status: BETA - /// - /// This is a generic service that contains utility functions - /// these functions are used to query additional meta-information - /// about the status of storage components + /// DataReplicationService + /// Endpoint specific methods for syncing data #[derive(Debug, Clone)] - pub struct StorageStatusServiceClient { + pub struct DataReplicationServiceClient { inner: tonic::client::Grpc, } - impl StorageStatusServiceClient { + impl DataReplicationServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -4735,7 +4453,7 @@ pub mod storage_status_service_client { Ok(Self::new(conn)) } } - impl StorageStatusServiceClient + impl DataReplicationServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -4753,7 +4471,7 @@ pub mod storage_status_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> StorageStatusServiceClient> + ) -> DataReplicationServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -4767,7 +4485,9 @@ pub mod storage_status_service_client { http::Request, >>::Error: Into + Send + Sync, { - StorageStatusServiceClient::new(InterceptedService::new(inner, interceptor)) + DataReplicationServiceClient::new( + InterceptedService::new(inner, interceptor), + ) } /// Compress requests with the given encoding. /// @@ -4800,17 +4520,16 @@ pub mod storage_status_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// GetStorageVersion + /// ReplicateProjectData /// - /// Status: BETA + /// Status: ALPHA /// - /// A request to get the current version of the server application - /// String representation and https://semver.org/ - pub async fn get_storage_version( + /// Replicates the (full) project data from one endpoint to another + pub async fn replicate_project_data( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4824,28 +4543,28 @@ pub mod storage_status_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.StorageStatusService/GetStorageVersion", + "/aruna.api.storage.services.v2.DataReplicationService/ReplicateProjectData", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.StorageStatusService", - "GetStorageVersion", + "aruna.api.storage.services.v2.DataReplicationService", + "ReplicateProjectData", ), ); self.inner.unary(req, path, codec).await } - /// GetStorageStatus + /// PartialReplicateData /// /// Status: ALPHA /// - /// A request to get the current status of the storage components by location(s) - pub async fn get_storage_status( + /// Partial replicate data between endpoints + pub async fn partial_replicate_data( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4859,28 +4578,28 @@ pub mod storage_status_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.StorageStatusService/GetStorageStatus", + "/aruna.api.storage.services.v2.DataReplicationService/PartialReplicateData", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.StorageStatusService", - "GetStorageStatus", + "aruna.api.storage.services.v2.DataReplicationService", + "PartialReplicateData", ), ); self.inner.unary(req, path, codec).await } - /// GetPubkeys + /// UpdateReplicationStatus /// - /// Status: BETA + /// Status: ALPHA /// - /// Get all public keys of all storage components - pub async fn get_pubkeys( + /// Update the replication status of a project + pub async fn update_replication_status( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4894,30 +4613,28 @@ pub mod storage_status_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.StorageStatusService/GetPubkeys", + "/aruna.api.storage.services.v2.DataReplicationService/UpdateReplicationStatus", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.StorageStatusService", - "GetPubkeys", + "aruna.api.storage.services.v2.DataReplicationService", + "UpdateReplicationStatus", ), ); self.inner.unary(req, path, codec).await } - /// Get Announcements + /// GetReplicationStatus /// - /// Status: BETA + /// Status: ALPHA /// - /// Query global announcements optionally filtered by specific ids. - /// - Returns all announcements if no ids are provided - /// - Returns only the specific announcements if ids are provided - pub async fn get_announcements( + /// Get the replication status of a project + pub async fn get_replication_status( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4931,28 +4648,28 @@ pub mod storage_status_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncements", + "/aruna.api.storage.services.v2.DataReplicationService/GetReplicationStatus", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.StorageStatusService", - "GetAnnouncements", + "aruna.api.storage.services.v2.DataReplicationService", + "GetReplicationStatus", ), ); self.inner.unary(req, path, codec).await } - /// GetAnnouncementsByType + /// DeleteReplication /// - /// Status: BETA + /// Status: ALPHA /// - /// Query global announcements by type - pub async fn get_announcements_by_type( + /// Delete the replication status of a project + pub async fn delete_replication( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4966,194 +4683,92 @@ pub mod storage_status_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncementsByType", + "/aruna.api.storage.services.v2.DataReplicationService/DeleteReplication", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.StorageStatusService", - "GetAnnouncementsByType", + "aruna.api.storage.services.v2.DataReplicationService", + "DeleteReplication", ), ); self.inner.unary(req, path, codec).await } - /// Get a specific Announcement + } +} +/// Generated server implementations. +pub mod data_replication_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with DataReplicationServiceServer. + #[async_trait] + pub trait DataReplicationService: Send + Sync + 'static { + /// ReplicateProjectData /// - /// Status: BETA + /// Status: ALPHA /// - /// Query a specific global announcement by its id - pub async fn get_announcement( - &mut self, - request: impl tonic::IntoRequest, + /// Replicates the (full) project data from one endpoint to another + async fn replicate_project_data( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncement", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.StorageStatusService", - "GetAnnouncement", - ), - ); - self.inner.unary(req, path, codec).await - } - /// SetAnnouncements - /// - /// Status: BETA - /// - /// Update / add global announcements - pub async fn set_announcements( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.StorageStatusService/SetAnnouncements", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.StorageStatusService", - "SetAnnouncements", - ), - ); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod storage_status_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with StorageStatusServiceServer. - #[async_trait] - pub trait StorageStatusService: Send + Sync + 'static { - /// GetStorageVersion - /// - /// Status: BETA - /// - /// A request to get the current version of the server application - /// String representation and https://semver.org/ - async fn get_storage_version( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetStorageStatus + /// PartialReplicateData /// /// Status: ALPHA /// - /// A request to get the current status of the storage components by location(s) - async fn get_storage_status( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetPubkeys - /// - /// Status: BETA - /// - /// Get all public keys of all storage components - async fn get_pubkeys( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Get Announcements - /// - /// Status: BETA - /// - /// Query global announcements optionally filtered by specific ids. - /// - Returns all announcements if no ids are provided - /// - Returns only the specific announcements if ids are provided - async fn get_announcements( + /// Partial replicate data between endpoints + async fn partial_replicate_data( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetAnnouncementsByType + /// UpdateReplicationStatus /// - /// Status: BETA + /// Status: ALPHA /// - /// Query global announcements by type - async fn get_announcements_by_type( + /// Update the replication status of a project + async fn update_replication_status( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Get a specific Announcement + /// GetReplicationStatus /// - /// Status: BETA + /// Status: ALPHA /// - /// Query a specific global announcement by its id - async fn get_announcement( + /// Get the replication status of a project + async fn get_replication_status( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// SetAnnouncements + /// DeleteReplication /// - /// Status: BETA + /// Status: ALPHA /// - /// Update / add global announcements - async fn set_announcements( + /// Delete the replication status of a project + async fn delete_replication( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// StorageStatusService - /// - /// Status: BETA - /// - /// This is a generic service that contains utility functions - /// these functions are used to query additional meta-information - /// about the status of storage components + /// DataReplicationService + /// Endpoint specific methods for syncing data #[derive(Debug)] - pub struct StorageStatusServiceServer { + pub struct DataReplicationServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -5161,7 +4776,7 @@ pub mod storage_status_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl StorageStatusServiceServer { + impl DataReplicationServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -5214,9 +4829,9 @@ pub mod storage_status_service_server { } } impl tonic::codegen::Service> - for StorageStatusServiceServer + for DataReplicationServiceServer where - T: StorageStatusService, + T: DataReplicationService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -5232,25 +4847,27 @@ pub mod storage_status_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.StorageStatusService/GetStorageVersion" => { + "/aruna.api.storage.services.v2.DataReplicationService/ReplicateProjectData" => { #[allow(non_camel_case_types)] - struct GetStorageVersionSvc(pub Arc); + struct ReplicateProjectDataSvc( + pub Arc, + ); impl< - T: StorageStatusService, - > tonic::server::UnaryService - for GetStorageVersionSvc { - type Response = super::GetStorageVersionResponse; + T: DataReplicationService, + > tonic::server::UnaryService + for ReplicateProjectDataSvc { + type Response = super::ReplicateProjectDataResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_storage_version( + ::replicate_project_data( &inner, request, ) @@ -5266,7 +4883,7 @@ pub mod storage_status_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetStorageVersionSvc(inner); + let method = ReplicateProjectDataSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5282,25 +4899,27 @@ pub mod storage_status_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.StorageStatusService/GetStorageStatus" => { + "/aruna.api.storage.services.v2.DataReplicationService/PartialReplicateData" => { #[allow(non_camel_case_types)] - struct GetStorageStatusSvc(pub Arc); + struct PartialReplicateDataSvc( + pub Arc, + ); impl< - T: StorageStatusService, - > tonic::server::UnaryService - for GetStorageStatusSvc { - type Response = super::GetStorageStatusResponse; + T: DataReplicationService, + > tonic::server::UnaryService + for PartialReplicateDataSvc { + type Response = super::PartialReplicateDataResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_storage_status( + ::partial_replicate_data( &inner, request, ) @@ -5316,7 +4935,7 @@ pub mod storage_status_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetStorageStatusSvc(inner); + let method = PartialReplicateDataSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5332,25 +4951,32 @@ pub mod storage_status_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.StorageStatusService/GetPubkeys" => { + "/aruna.api.storage.services.v2.DataReplicationService/UpdateReplicationStatus" => { #[allow(non_camel_case_types)] - struct GetPubkeysSvc(pub Arc); + struct UpdateReplicationStatusSvc( + pub Arc, + ); impl< - T: StorageStatusService, - > tonic::server::UnaryService - for GetPubkeysSvc { - type Response = super::GetPubkeysResponse; + T: DataReplicationService, + > tonic::server::UnaryService + for UpdateReplicationStatusSvc { + type Response = super::UpdateReplicationStatusResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::UpdateReplicationStatusRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_pubkeys(&inner, request) + ::update_replication_status( + &inner, + request, + ) .await }; Box::pin(fut) @@ -5363,7 +4989,7 @@ pub mod storage_status_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetPubkeysSvc(inner); + let method = UpdateReplicationStatusSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5379,25 +5005,27 @@ pub mod storage_status_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncements" => { + "/aruna.api.storage.services.v2.DataReplicationService/GetReplicationStatus" => { #[allow(non_camel_case_types)] - struct GetAnnouncementsSvc(pub Arc); + struct GetReplicationStatusSvc( + pub Arc, + ); impl< - T: StorageStatusService, - > tonic::server::UnaryService - for GetAnnouncementsSvc { - type Response = super::GetAnnouncementsResponse; + T: DataReplicationService, + > tonic::server::UnaryService + for GetReplicationStatusSvc { + type Response = super::GetReplicationStatusResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_announcements( + ::get_replication_status( &inner, request, ) @@ -5413,7 +5041,7 @@ pub mod storage_status_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetAnnouncementsSvc(inner); + let method = GetReplicationStatusSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5429,127 +5057,25 @@ pub mod storage_status_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncementsByType" => { + "/aruna.api.storage.services.v2.DataReplicationService/DeleteReplication" => { #[allow(non_camel_case_types)] - struct GetAnnouncementsByTypeSvc( - pub Arc, - ); - impl< - T: StorageStatusService, - > tonic::server::UnaryService - for GetAnnouncementsByTypeSvc { - type Response = super::GetAnnouncementsByTypeResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_announcements_by_type( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetAnnouncementsByTypeSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncement" => { - #[allow(non_camel_case_types)] - struct GetAnnouncementSvc(pub Arc); - impl< - T: StorageStatusService, - > tonic::server::UnaryService - for GetAnnouncementSvc { - type Response = super::GetAnnouncementResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_announcement( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetAnnouncementSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.StorageStatusService/SetAnnouncements" => { - #[allow(non_camel_case_types)] - struct SetAnnouncementsSvc(pub Arc); + struct DeleteReplicationSvc(pub Arc); impl< - T: StorageStatusService, - > tonic::server::UnaryService - for SetAnnouncementsSvc { - type Response = super::SetAnnouncementsResponse; + T: DataReplicationService, + > tonic::server::UnaryService + for DeleteReplicationSvc { + type Response = super::DeleteReplicationResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::set_announcements( + ::delete_replication( &inner, request, ) @@ -5565,7 +5091,7 @@ pub mod storage_status_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = SetAnnouncementsSvc(inner); + let method = DeleteReplicationSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5596,7 +5122,7 @@ pub mod storage_status_service_server { } } } - impl Clone for StorageStatusServiceServer { + impl Clone for DataReplicationServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -5608,7 +5134,7 @@ pub mod storage_status_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -5618,29 +5144,25 @@ pub mod storage_status_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService - for StorageStatusServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.StorageStatusService"; + impl tonic::server::NamedService + for DataReplicationServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.DataReplicationService"; } } -/// Models -/// These are the models for the above described requests and responses. -/// gRPC best practises advice each Request and Response message in a RPC to be -/// called {rpc_name}Request and {rpc_name}Response. #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateObjectRequest { - /// collection name +pub struct CreateProjectRequest { + /// Project name #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, /// title - #[prost(string, tag = "12")] + #[prost(string, tag = "9")] pub title: ::prost::alloc::string::String, - /// description + /// Description #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, - /// collection specific labels / hooks + /// Project specific labels / hooks #[prost(message, repeated, tag = "3")] pub key_values: ::prost::alloc::vec::Vec, /// Internal / External relations (URLs / IDs from external sources) @@ -5649,305 +5171,175 @@ pub struct CreateObjectRequest { /// DataClass #[prost(enumeration = "super::super::models::v2::DataClass", tag = "5")] pub data_class: i32, - #[prost(message, repeated, tag = "9")] - pub hashes: ::prost::alloc::vec::Vec, - #[prost(string, tag = "10")] + /// Preferred endpoint + #[prost(string, tag = "6")] + pub preferred_endpoint: ::prost::alloc::string::String, + /// + #[prost(string, tag = "7")] pub metadata_license_tag: ::prost::alloc::string::String, - #[prost(string, tag = "11")] - pub data_license_tag: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "13")] + #[prost(string, tag = "8")] + pub default_data_license_tag: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "10")] pub authors: ::prost::alloc::vec::Vec, - /// Parent can be one of all other resources - #[prost(oneof = "create_object_request::Parent", tags = "6, 7, 8")] - pub parent: ::core::option::Option, -} -/// Nested message and enum types in `CreateObjectRequest`. -pub mod create_object_request { - /// Parent can be one of all other resources - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Parent { - #[prost(string, tag = "6")] - ProjectId(::prost::alloc::string::String), - #[prost(string, tag = "7")] - CollectionId(::prost::alloc::string::String), - #[prost(string, tag = "8")] - DatasetId(::prost::alloc::string::String), - } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateObjectResponse { +pub struct CreateProjectResponse { + /// The freshly created project #[prost(message, optional, tag = "1")] - pub object: ::core::option::Option, + pub project: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetUploadUrlRequest { - /// ObjectId +pub struct GetProjectRequest { + /// The id of the project to get #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, - /// Is this a multipart upload? - #[prost(bool, tag = "2")] - pub multipart: bool, - /// (optional) if multi was initialized - #[prost(int32, tag = "3")] - pub part_number: i32, + pub project_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetUploadUrlResponse { - /// URL - #[prost(string, tag = "1")] - pub url: ::prost::alloc::string::String, +pub struct GetProjectResponse { + /// Overview of the projectroject + #[prost(message, optional, tag = "1")] + pub project: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDownloadUrlRequest { - #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, +pub struct GetProjectsRequest { + /// optional filter for specific ids + #[prost(string, repeated, tag = "1")] + pub project_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDownloadUrlResponse { - /// URL - #[prost(string, tag = "1")] - pub url: ::prost::alloc::string::String, +pub struct GetProjectsResponse { + /// Overview of the projects + #[prost(message, repeated, tag = "1")] + pub projects: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CompletedPart { - /// Multipart identifier +pub struct DeleteProjectRequest { + /// The id of the project to destroy #[prost(string, tag = "1")] - pub etag: ::prost::alloc::string::String, - /// Part number - #[prost(int64, tag = "2")] - pub part: i64, + pub project_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct FinishObjectStagingRequest { - /// ObjectId +pub struct DeleteProjectResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateProjectNameRequest { #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, - /// Final content len - #[prost(int64, tag = "2")] - pub content_len: i64, - /// Hash of the uploaded data - used to verify the data integrity. - /// This supports multiple hashing algorithms. - #[prost(message, repeated, tag = "3")] - pub hashes: ::prost::alloc::vec::Vec, - /// If the upload was multipart, this is the list of parts that were uploaded. - /// Should be empty if the upload was not multipart. - /// (optional) - #[prost(message, repeated, tag = "4")] - pub completed_parts: ::prost::alloc::vec::Vec, + pub project_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct FinishObjectStagingResponse { - /// (new) Object overview +pub struct UpdateProjectNameResponse { #[prost(message, optional, tag = "1")] - pub object: ::core::option::Option, + pub project: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateObjectRequest { - /// Existing object ID +pub struct UpdateProjectDescriptionRequest { #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, - /// object name - #[prost(string, optional, tag = "2")] - pub name: ::core::option::Option<::prost::alloc::string::String>, - /// object description - #[prost(string, optional, tag = "3")] - pub description: ::core::option::Option<::prost::alloc::string::String>, - /// key_values to add - #[prost(message, repeated, tag = "4")] - pub add_key_values: ::prost::alloc::vec::Vec, - /// key_values to remove - #[prost(message, repeated, tag = "5")] - pub remove_key_values: ::prost::alloc::vec::Vec, - /// New DataClass - #[prost(enumeration = "super::super::models::v2::DataClass", tag = "7")] - pub data_class: i32, - #[prost(message, repeated, tag = "12")] - pub hashes: ::prost::alloc::vec::Vec, - /// Force new object revision - #[prost(bool, tag = "13")] - pub force_revision: bool, - #[prost(string, optional, tag = "14")] - pub metadata_license_tag: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "15")] - pub data_license_tag: ::core::option::Option<::prost::alloc::string::String>, - /// Parent can be one of all other resources - #[prost(oneof = "update_object_request::Parent", tags = "8, 9, 10")] - pub parent: ::core::option::Option, -} -/// Nested message and enum types in `UpdateObjectRequest`. -pub mod update_object_request { - /// Parent can be one of all other resources - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Parent { - #[prost(string, tag = "8")] - ProjectId(::prost::alloc::string::String), - #[prost(string, tag = "9")] - CollectionId(::prost::alloc::string::String), - #[prost(string, tag = "10")] - DatasetId(::prost::alloc::string::String), - } + pub project_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateObjectResponse { +pub struct UpdateProjectDescriptionResponse { #[prost(message, optional, tag = "1")] - pub object: ::core::option::Option, - #[prost(bool, tag = "2")] - pub new_revision: bool, + pub project: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CloneObjectRequest { - /// ObjectId +pub struct UpdateProjectKeyValuesRequest { #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, - /// - #[prost(oneof = "clone_object_request::Parent", tags = "2, 3, 4")] - pub parent: ::core::option::Option, -} -/// Nested message and enum types in `CloneObjectRequest`. -pub mod clone_object_request { - /// - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Parent { - #[prost(string, tag = "2")] - ProjectId(::prost::alloc::string::String), - #[prost(string, tag = "3")] - CollectionId(::prost::alloc::string::String), - #[prost(string, tag = "4")] - DatasetId(::prost::alloc::string::String), - } + pub project_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub add_key_values: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub remove_key_values: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CloneObjectResponse { - /// This describes the new object. +pub struct UpdateProjectKeyValuesResponse { #[prost(message, optional, tag = "1")] - pub object: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteObjectRequest { - /// ObjectId - #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, - /// Delete including revisions - #[prost(bool, tag = "2")] - pub with_revisions: bool, + pub project: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteObjectResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetObjectRequest { - /// Object Id +pub struct UpdateProjectDataClassRequest { #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, + pub project_id: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::DataClass", tag = "2")] + pub data_class: i32, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetObjectResponse { +pub struct UpdateProjectDataClassResponse { #[prost(message, optional, tag = "1")] - pub object: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetObjectsRequest { - /// Object ids - #[prost(string, repeated, tag = "1")] - pub object_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetObjectsResponse { - /// A List of objects - #[prost(message, repeated, tag = "1")] - pub objects: ::prost::alloc::vec::Vec, + pub project: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetObjectRevisionsRequest { - /// Object id - #[prost(string, tag = "2")] - pub object_id: ::prost::alloc::string::String, +pub struct ArchiveProjectRequest { + #[prost(string, tag = "1")] + pub project_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetObjectRevisionsResponse { - /// List of objects - #[prost(message, repeated, tag = "1")] - pub objects: ::prost::alloc::vec::Vec, +pub struct ArchiveProjectResponse { + /// This project will be returned via an Persistent Identifier! Updates will be impossible + #[prost(message, optional, tag = "1")] + pub project: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetLatestObjectRevisionRequest { - /// Object id +pub struct UpdateProjectLicensesRequest { #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, + pub project_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub metadata_license_tag: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub default_data_license_tag: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetLatestObjectRevisionResponse { - /// The object with the latest revision +pub struct UpdateProjectLicensesResponse { #[prost(message, optional, tag = "1")] - pub object: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetObjectEndpointsRequest { - /// Collection id - #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, - /// Object id - #[prost(string, tag = "2")] - pub object_id: ::prost::alloc::string::String, + pub project: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateObjectTitleRequest { - /// Object id +pub struct UpdateProjectTitleRequest { + /// Project id #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, + pub project_id: ::prost::alloc::string::String, /// New title #[prost(string, tag = "2")] pub title: ::prost::alloc::string::String, @@ -5955,18 +5347,18 @@ pub struct UpdateObjectTitleRequest { #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateObjectTitleResponse { +pub struct UpdateProjectTitleResponse { /// The updated object #[prost(message, optional, tag = "1")] - pub object: ::core::option::Option, + pub project: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateObjectAuthorsRequest { - /// Object id +pub struct UpdateProjectAuthorsRequest { + /// Project id #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, + pub project_id: ::prost::alloc::string::String, /// Add authors #[prost(message, repeated, tag = "2")] pub add_authors: ::prost::alloc::vec::Vec, @@ -5977,45 +5369,26 @@ pub struct UpdateObjectAuthorsRequest { #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateObjectAuthorsResponse { - /// The updated object - #[prost(message, optional, tag = "1")] - pub object: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SetObjectHashesRequest { - /// Object id - #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, - /// Hashes - #[prost(message, repeated, tag = "2")] - pub hashes: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SetObjectHashesResponse { - /// The updated object (possibly with error status) +pub struct UpdateProjectAuthorsResponse { + /// The updated project #[prost(message, optional, tag = "1")] - pub object: ::core::option::Option, + pub project: ::core::option::Option, } /// Generated client implementations. -pub mod object_service_client { +pub mod project_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// ObjectService + /// ProjectService /// /// Status: BETA /// - /// Contains all methods that get/create or update objects and associated resources + /// Contains all methods that get/create or update Projects and associated resources #[derive(Debug, Clone)] - pub struct ObjectServiceClient { + pub struct ProjectServiceClient { inner: tonic::client::Grpc, } - impl ObjectServiceClient { + impl ProjectServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -6026,7 +5399,7 @@ pub mod object_service_client { Ok(Self::new(conn)) } } - impl ObjectServiceClient + impl ProjectServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -6044,7 +5417,7 @@ pub mod object_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> ObjectServiceClient> + ) -> ProjectServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -6058,7 +5431,7 @@ pub mod object_service_client { http::Request, >>::Error: Into + Send + Sync, { - ObjectServiceClient::new(InterceptedService::new(inner, interceptor)) + ProjectServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -6091,18 +5464,16 @@ pub mod object_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// CreateObject + /// CreateProject /// /// Status: BETA /// - /// This creates a new object and puts it in a staging area. - /// Staging objects have an "INITIALIZING" status - /// and need to be finished either manually or by uploading data. - pub async fn create_object( + /// Creates a new project. All subsequent resources are part of a project. + pub async fn create_project( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6116,31 +5487,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/CreateObject", + "/aruna.api.storage.services.v2.ProjectService/CreateProject", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "CreateObject", + "aruna.api.storage.services.v2.ProjectService", + "CreateProject", ), ); self.inner.unary(req, path, codec).await } - /// GetUploadURL + /// GetProject /// /// Status: BETA /// - /// This is a proxy method that will call the apropriate method at dataproxy level - /// This method will return a (multi-part) url that can be used to upload a - /// file to S3. Part is a optional query parameter that can be used to upload a - /// part of the file / multipart upload. - pub async fn get_upload_url( + /// Requests a project (by id) + pub async fn get_project( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6154,29 +5522,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/GetUploadURL", + "/aruna.api.storage.services.v2.ProjectService/GetProject", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "GetUploadURL", + "aruna.api.storage.services.v2.ProjectService", + "GetProject", ), ); self.inner.unary(req, path, codec).await } - /// GetDownloadUrl + /// GetProjects /// /// Status: BETA /// - /// This is a proxy method that will call the apropriate method at dataproxy level - /// will return a url that can be used to download a file from S3. - pub async fn get_download_url( + /// Admin request to get all projects + pub async fn get_projects( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6190,28 +5557,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/GetDownloadURL", + "/aruna.api.storage.services.v2.ProjectService/GetProjects", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "GetDownloadURL", + "aruna.api.storage.services.v2.ProjectService", + "GetProjects", ), ); self.inner.unary(req, path, codec).await } - /// FinishObjectStaging + /// DeleteProject /// /// Status: BETA /// - /// This method completes the staging of an object. - pub async fn finish_object_staging( + /// Deletes the project and all its associated data. Must be empty! + pub async fn delete_project( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6225,32 +5592,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/FinishObjectStaging", + "/aruna.api.storage.services.v2.ProjectService/DeleteProject", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "FinishObjectStaging", + "aruna.api.storage.services.v2.ProjectService", + "DeleteProject", ), ); self.inner.unary(req, path, codec).await } - /// UpdateObject + /// UpdateProjectName /// /// Status: BETA /// - /// Objects are immutable! - /// Updating an object will create a new revision for the object - /// This method will put the new revision in a staging area. - /// Staged objects will get a separate staging id and need to be finished - /// before they can be used. - pub async fn update_object( + /// Updates the project name. Caveat! Will rename the "s3 bucket" for data proxies! + pub async fn update_project_name( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6264,30 +5627,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/UpdateObject", + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectName", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "UpdateObject", + "aruna.api.storage.services.v2.ProjectService", + "UpdateProjectName", ), ); self.inner.unary(req, path, codec).await } - /// CloneObject + /// UpdateProjectDescription /// /// Status: BETA /// - /// This method clones an object and creates a copy in the same collection. - /// This copy has a new id and revision and will not receive any updates from - /// the original object. - pub async fn clone_object( + /// Updates the project name. + pub async fn update_project_description( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6301,28 +5662,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/CloneObject", + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectDescription", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "CloneObject", + "aruna.api.storage.services.v2.ProjectService", + "UpdateProjectDescription", ), ); self.inner.unary(req, path, codec).await } - /// DeleteObject + /// UpdateProjectKeyValues /// /// Status: BETA /// - /// Deletes the object with the complete revision history. - pub async fn delete_object( + /// Updates the project key values. + pub async fn update_project_key_values( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6336,31 +5697,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/DeleteObject", + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectKeyValues", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "DeleteObject", + "aruna.api.storage.services.v2.ProjectService", + "UpdateProjectKeyValues", ), ); self.inner.unary(req, path, codec).await } - /// GetObject + /// UpdateProjectDataClass /// /// Status: BETA /// - /// gets a specific Object by ID that is associated to the - /// current collection By default only the latest revision of an object will be - /// returned Specify a revision_number to select an older revision With the - /// optional with_url boolean a download link can automatically be requested - pub async fn get_object( + /// Updates the project name. All (meta) data will be overwritten. + pub async fn update_project_data_class( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6374,28 +5732,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/GetObject", + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectDataClass", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "GetObject", + "aruna.api.storage.services.v2.ProjectService", + "UpdateProjectDataClass", ), ); self.inner.unary(req, path, codec).await } - /// GetObjects + /// UpdateLicense /// /// Status: BETA /// - /// Get multiple objects by ID at once - pub async fn get_objects( + /// Updates the project license. All (meta) data will be overwritten. + pub async fn update_project_licenses( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6409,28 +5767,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/GetObjects", + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectLicenses", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "GetObjects", + "aruna.api.storage.services.v2.ProjectService", + "UpdateProjectLicenses", ), ); self.inner.unary(req, path, codec).await } - /// UpdateTitle + /// ArchiveProjectRequest /// - /// Status: ALPHA + /// Status: BETA /// - /// This method updates the title of an object - pub async fn update_object_title( + /// Archives the full project, rendering all downstream relations immutable + pub async fn archive_project( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6444,28 +5802,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/UpdateObjectTitle", + "/aruna.api.storage.services.v2.ProjectService/ArchiveProject", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "UpdateObjectTitle", + "aruna.api.storage.services.v2.ProjectService", + "ArchiveProject", ), ); self.inner.unary(req, path, codec).await } - /// UpdateAuthors + /// UpdateTitle /// /// Status: ALPHA /// - /// This method updates the authors of an object - pub async fn update_object_authors( + /// This method updates the title of a project + pub async fn update_project_title( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6479,30 +5837,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/UpdateObjectAuthors", + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectTitle", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "UpdateObjectAuthors", + "aruna.api.storage.services.v2.ProjectService", + "UpdateProjectTitle", ), ); self.inner.unary(req, path, codec).await } - /// SetObjectHashes + /// UpdateAuthors /// /// Status: ALPHA /// - /// This method sets the object hashes if not already set - /// if a hash is already set, it will be compared to the new hash and - /// set the status to ERROR if they do not match - pub async fn set_object_hashes( + /// This method updates the authors of an object + pub async fn update_project_authors( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6516,14 +5872,14 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/SetObjectHashes", + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectAuthors", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "SetObjectHashes", + "aruna.api.storage.services.v2.ProjectService", + "UpdateProjectAuthors", ), ); self.inner.unary(req, path, codec).await @@ -6531,181 +5887,164 @@ pub mod object_service_client { } } /// Generated server implementations. -pub mod object_service_server { +pub mod project_service_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with ObjectServiceServer. + /// Generated trait containing gRPC methods that should be implemented for use with ProjectServiceServer. #[async_trait] - pub trait ObjectService: Send + Sync + 'static { - /// CreateObject + pub trait ProjectService: Send + Sync + 'static { + /// CreateProject /// /// Status: BETA /// - /// This creates a new object and puts it in a staging area. - /// Staging objects have an "INITIALIZING" status - /// and need to be finished either manually or by uploading data. - async fn create_object( + /// Creates a new project. All subsequent resources are part of a project. + async fn create_project( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetUploadURL + /// GetProject /// /// Status: BETA /// - /// This is a proxy method that will call the apropriate method at dataproxy level - /// This method will return a (multi-part) url that can be used to upload a - /// file to S3. Part is a optional query parameter that can be used to upload a - /// part of the file / multipart upload. - async fn get_upload_url( + /// Requests a project (by id) + async fn get_project( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetDownloadUrl + /// GetProjects /// /// Status: BETA /// - /// This is a proxy method that will call the apropriate method at dataproxy level - /// will return a url that can be used to download a file from S3. - async fn get_download_url( + /// Admin request to get all projects + async fn get_projects( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// FinishObjectStaging + /// DeleteProject /// /// Status: BETA /// - /// This method completes the staging of an object. - async fn finish_object_staging( + /// Deletes the project and all its associated data. Must be empty! + async fn delete_project( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateObject + /// UpdateProjectName /// /// Status: BETA /// - /// Objects are immutable! - /// Updating an object will create a new revision for the object - /// This method will put the new revision in a staging area. - /// Staged objects will get a separate staging id and need to be finished - /// before they can be used. - async fn update_object( + /// Updates the project name. Caveat! Will rename the "s3 bucket" for data proxies! + async fn update_project_name( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// CloneObject + /// UpdateProjectDescription /// /// Status: BETA /// - /// This method clones an object and creates a copy in the same collection. - /// This copy has a new id and revision and will not receive any updates from - /// the original object. - async fn clone_object( + /// Updates the project name. + async fn update_project_description( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// DeleteObject + /// UpdateProjectKeyValues /// /// Status: BETA /// - /// Deletes the object with the complete revision history. - async fn delete_object( - &self, - request: tonic::Request, + /// Updates the project key values. + async fn update_project_key_values( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetObject + /// UpdateProjectDataClass /// /// Status: BETA /// - /// gets a specific Object by ID that is associated to the - /// current collection By default only the latest revision of an object will be - /// returned Specify a revision_number to select an older revision With the - /// optional with_url boolean a download link can automatically be requested - async fn get_object( + /// Updates the project name. All (meta) data will be overwritten. + async fn update_project_data_class( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetObjects + /// UpdateLicense /// /// Status: BETA /// - /// Get multiple objects by ID at once - async fn get_objects( + /// Updates the project license. All (meta) data will be overwritten. + async fn update_project_licenses( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateTitle + /// ArchiveProjectRequest /// - /// Status: ALPHA + /// Status: BETA /// - /// This method updates the title of an object - async fn update_object_title( + /// Archives the full project, rendering all downstream relations immutable + async fn archive_project( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateAuthors + /// UpdateTitle /// /// Status: ALPHA /// - /// This method updates the authors of an object - async fn update_object_authors( + /// This method updates the title of a project + async fn update_project_title( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// SetObjectHashes + /// UpdateAuthors /// /// Status: ALPHA /// - /// This method sets the object hashes if not already set - /// if a hash is already set, it will be compared to the new hash and - /// set the status to ERROR if they do not match - async fn set_object_hashes( + /// This method updates the authors of an object + async fn update_project_authors( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// ObjectService + /// ProjectService /// /// Status: BETA /// - /// Contains all methods that get/create or update objects and associated resources + /// Contains all methods that get/create or update Projects and associated resources #[derive(Debug)] - pub struct ObjectServiceServer { + pub struct ProjectServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -6713,7 +6052,7 @@ pub mod object_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl ObjectServiceServer { + impl ProjectServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -6765,9 +6104,9 @@ pub mod object_service_server { self } } - impl tonic::codegen::Service> for ObjectServiceServer + impl tonic::codegen::Service> for ProjectServiceServer where - T: ObjectService, + T: ProjectService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -6783,25 +6122,25 @@ pub mod object_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.ObjectService/CreateObject" => { + "/aruna.api.storage.services.v2.ProjectService/CreateProject" => { #[allow(non_camel_case_types)] - struct CreateObjectSvc(pub Arc); + struct CreateProjectSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for CreateObjectSvc { - type Response = super::CreateObjectResponse; + T: ProjectService, + > tonic::server::UnaryService + for CreateProjectSvc { + type Response = super::CreateProjectResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_object(&inner, request).await + ::create_project(&inner, request).await }; Box::pin(fut) } @@ -6813,7 +6152,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateObjectSvc(inner); + let method = CreateProjectSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -6829,25 +6168,25 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/GetUploadURL" => { + "/aruna.api.storage.services.v2.ProjectService/GetProject" => { #[allow(non_camel_case_types)] - struct GetUploadURLSvc(pub Arc); + struct GetProjectSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for GetUploadURLSvc { - type Response = super::GetUploadUrlResponse; + T: ProjectService, + > tonic::server::UnaryService + for GetProjectSvc { + type Response = super::GetProjectResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_upload_url(&inner, request).await + ::get_project(&inner, request).await }; Box::pin(fut) } @@ -6859,7 +6198,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetUploadURLSvc(inner); + let method = GetProjectSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -6875,26 +6214,25 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/GetDownloadURL" => { + "/aruna.api.storage.services.v2.ProjectService/GetProjects" => { #[allow(non_camel_case_types)] - struct GetDownloadURLSvc(pub Arc); + struct GetProjectsSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for GetDownloadURLSvc { - type Response = super::GetDownloadUrlResponse; + T: ProjectService, + > tonic::server::UnaryService + for GetProjectsSvc { + type Response = super::GetProjectsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_download_url(&inner, request) - .await + ::get_projects(&inner, request).await }; Box::pin(fut) } @@ -6906,7 +6244,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetDownloadURLSvc(inner); + let method = GetProjectsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -6922,26 +6260,25 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/FinishObjectStaging" => { + "/aruna.api.storage.services.v2.ProjectService/DeleteProject" => { #[allow(non_camel_case_types)] - struct FinishObjectStagingSvc(pub Arc); + struct DeleteProjectSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for FinishObjectStagingSvc { - type Response = super::FinishObjectStagingResponse; + T: ProjectService, + > tonic::server::UnaryService + for DeleteProjectSvc { + type Response = super::DeleteProjectResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::finish_object_staging(&inner, request) - .await + ::delete_project(&inner, request).await }; Box::pin(fut) } @@ -6953,7 +6290,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = FinishObjectStagingSvc(inner); + let method = DeleteProjectSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -6969,25 +6306,26 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/UpdateObject" => { + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectName" => { #[allow(non_camel_case_types)] - struct UpdateObjectSvc(pub Arc); + struct UpdateProjectNameSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for UpdateObjectSvc { - type Response = super::UpdateObjectResponse; + T: ProjectService, + > tonic::server::UnaryService + for UpdateProjectNameSvc { + type Response = super::UpdateProjectNameResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_object(&inner, request).await + ::update_project_name(&inner, request) + .await }; Box::pin(fut) } @@ -6999,7 +6337,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateObjectSvc(inner); + let method = UpdateProjectNameSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -7015,25 +6353,31 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/CloneObject" => { + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectDescription" => { #[allow(non_camel_case_types)] - struct CloneObjectSvc(pub Arc); + struct UpdateProjectDescriptionSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for CloneObjectSvc { - type Response = super::CloneObjectResponse; + T: ProjectService, + > tonic::server::UnaryService + for UpdateProjectDescriptionSvc { + type Response = super::UpdateProjectDescriptionResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::UpdateProjectDescriptionRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::clone_object(&inner, request).await + ::update_project_description( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -7045,7 +6389,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CloneObjectSvc(inner); + let method = UpdateProjectDescriptionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -7061,25 +6405,29 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/DeleteObject" => { + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectKeyValues" => { #[allow(non_camel_case_types)] - struct DeleteObjectSvc(pub Arc); + struct UpdateProjectKeyValuesSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for DeleteObjectSvc { - type Response = super::DeleteObjectResponse; + T: ProjectService, + > tonic::server::UnaryService + for UpdateProjectKeyValuesSvc { + type Response = super::UpdateProjectKeyValuesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_object(&inner, request).await + ::update_project_key_values( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -7091,7 +6439,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteObjectSvc(inner); + let method = UpdateProjectKeyValuesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -7107,25 +6455,29 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/GetObject" => { + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectDataClass" => { #[allow(non_camel_case_types)] - struct GetObjectSvc(pub Arc); + struct UpdateProjectDataClassSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for GetObjectSvc { - type Response = super::GetObjectResponse; + T: ProjectService, + > tonic::server::UnaryService + for UpdateProjectDataClassSvc { + type Response = super::UpdateProjectDataClassResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_object(&inner, request).await + ::update_project_data_class( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -7137,7 +6489,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetObjectSvc(inner); + let method = UpdateProjectDataClassSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -7153,29 +6505,33 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/GetObjects" => { + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectLicenses" => { #[allow(non_camel_case_types)] - struct GetObjectsSvc(pub Arc); + struct UpdateProjectLicensesSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for GetObjectsSvc { - type Response = super::GetObjectsResponse; + T: ProjectService, + > tonic::server::UnaryService + for UpdateProjectLicensesSvc { + type Response = super::UpdateProjectLicensesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_objects(&inner, request).await - }; - Box::pin(fut) - } - } + ::update_project_licenses( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let max_decoding_message_size = self.max_decoding_message_size; @@ -7183,7 +6539,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetObjectsSvc(inner); + let method = UpdateProjectLicensesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -7199,25 +6555,25 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/UpdateObjectTitle" => { + "/aruna.api.storage.services.v2.ProjectService/ArchiveProject" => { #[allow(non_camel_case_types)] - struct UpdateObjectTitleSvc(pub Arc); + struct ArchiveProjectSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for UpdateObjectTitleSvc { - type Response = super::UpdateObjectTitleResponse; + T: ProjectService, + > tonic::server::UnaryService + for ArchiveProjectSvc { + type Response = super::ArchiveProjectResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_object_title(&inner, request) + ::archive_project(&inner, request) .await }; Box::pin(fut) @@ -7230,7 +6586,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateObjectTitleSvc(inner); + let method = ArchiveProjectSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -7246,25 +6602,25 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/UpdateObjectAuthors" => { + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectTitle" => { #[allow(non_camel_case_types)] - struct UpdateObjectAuthorsSvc(pub Arc); + struct UpdateProjectTitleSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for UpdateObjectAuthorsSvc { - type Response = super::UpdateObjectAuthorsResponse; + T: ProjectService, + > tonic::server::UnaryService + for UpdateProjectTitleSvc { + type Response = super::UpdateProjectTitleResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_object_authors(&inner, request) + ::update_project_title(&inner, request) .await }; Box::pin(fut) @@ -7277,7 +6633,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateObjectAuthorsSvc(inner); + let method = UpdateProjectTitleSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -7293,25 +6649,28 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/SetObjectHashes" => { + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectAuthors" => { #[allow(non_camel_case_types)] - struct SetObjectHashesSvc(pub Arc); + struct UpdateProjectAuthorsSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for SetObjectHashesSvc { - type Response = super::SetObjectHashesResponse; + T: ProjectService, + > tonic::server::UnaryService + for UpdateProjectAuthorsSvc { + type Response = super::UpdateProjectAuthorsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::set_object_hashes(&inner, request) + ::update_project_authors( + &inner, + request, + ) .await }; Box::pin(fut) @@ -7324,7 +6683,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = SetObjectHashesSvc(inner); + let method = UpdateProjectAuthorsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -7355,7 +6714,7 @@ pub mod object_service_server { } } } - impl Clone for ObjectServiceServer { + impl Clone for ProjectServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -7367,7 +6726,7 @@ pub mod object_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -7377,250 +6736,164 @@ pub mod object_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for ObjectServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.ObjectService"; + impl tonic::server::NamedService for ProjectServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.ProjectService"; } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateDatasetRequest { - /// dataset name +pub struct CreateEndpointRequest { + /// Endpoint name #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, - #[prost(string, tag = "10")] - pub title: ::prost::alloc::string::String, - /// Description - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// dataset specific labels / hooks - #[prost(message, repeated, tag = "3")] - pub key_values: ::prost::alloc::vec::Vec, - /// Internal / External relations (URLs / IDs from external sources) - #[prost(message, repeated, tag = "4")] - pub relations: ::prost::alloc::vec::Vec, - /// DataClass - #[prost(enumeration = "super::super::models::v2::DataClass", tag = "5")] - pub data_class: i32, - #[prost(string, optional, tag = "8")] - pub metadata_license_tag: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "9")] - pub default_data_license_tag: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "11")] - pub authors: ::prost::alloc::vec::Vec, - /// Parent_id MUST be dataset - #[prost(oneof = "create_dataset_request::Parent", tags = "6, 7")] - pub parent: ::core::option::Option, -} -/// Nested message and enum types in `CreateDatasetRequest`. -pub mod create_dataset_request { - /// Parent_id MUST be dataset - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Parent { - #[prost(string, tag = "6")] - ProjectId(::prost::alloc::string::String), - #[prost(string, tag = "7")] - CollectionId(::prost::alloc::string::String), - } + /// Endpoint type + #[prost(enumeration = "super::super::models::v2::EndpointVariant", tag = "2")] + pub ep_variant: i32, + /// Is this endpoint public + #[prost(bool, tag = "3")] + pub is_public: bool, + /// required public_key + #[prost(string, tag = "4")] + pub pubkey: ::prost::alloc::string::String, + /// List of EndpointHostConfigs + #[prost(message, repeated, tag = "5")] + pub host_configs: ::prost::alloc::vec::Vec< + super::super::models::v2::EndpointHostConfig, + >, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateDatasetResponse { - /// The new dataset_id +pub struct CreateEndpointResponse { + /// Overview of the created endpoint #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, + pub endpoint: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDatasetRequest { - /// Requested id - #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, -} +pub struct FullSyncEndpointRequest {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDatasetResponse { - /// Overview of the requested dataset - #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, +pub struct FullSyncEndpointResponse { + #[prost(oneof = "full_sync_endpoint_response::Target", tags = "1, 2, 3")] + pub target: ::core::option::Option, } -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDatasetsRequest { - #[prost(string, repeated, tag = "1")] - pub dataset_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +/// Nested message and enum types in `FullSyncEndpointResponse`. +pub mod full_sync_endpoint_response { + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Target { + #[prost(message, tag = "1")] + GenericResource(super::super::super::models::v2::GenericResource), + #[prost(message, tag = "2")] + User(super::super::super::models::v2::User), + #[prost(message, tag = "3")] + Pubkey(super::super::super::models::v2::Pubkey), + } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDatasetsResponse { - /// List of dataset overviews - #[prost(message, repeated, tag = "1")] - pub datasets: ::prost::alloc::vec::Vec, +pub struct GetEndpointRequest { + /// Either endpoint_name or id + #[prost(oneof = "get_endpoint_request::Endpoint", tags = "1, 2")] + pub endpoint: ::core::option::Option, } -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteDatasetRequest { - #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, +/// Nested message and enum types in `GetEndpointRequest`. +pub mod get_endpoint_request { + /// Either endpoint_name or id + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Endpoint { + /// The name of the endpoint + #[prost(string, tag = "1")] + EndpointName(::prost::alloc::string::String), + /// Id of the endpoint + #[prost(string, tag = "2")] + EndpointId(::prost::alloc::string::String), + } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteDatasetResponse {} +pub struct GetEndpointResponse { + /// Overview of the requested endpoint + #[prost(message, optional, tag = "1")] + pub endpoint: ::core::option::Option, +} +/// Requests all endpoints #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetNameRequest { - #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, -} +pub struct GetEndpointsRequest {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetNameResponse { - #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, +pub struct GetEndpointsResponse { + /// List of endpoints + #[prost(message, repeated, tag = "1")] + pub endpoints: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetDescriptionRequest { +pub struct DeleteEndpointRequest { + /// Endpoint_id to delete #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, + pub endpoint_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetDescriptionResponse { - #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, -} +pub struct DeleteEndpointResponse {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetKeyValuesRequest { - #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub add_key_values: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub remove_key_values: ::prost::alloc::vec::Vec, -} +pub struct GetDefaultEndpointRequest {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetKeyValuesResponse { +pub struct GetDefaultEndpointResponse { + /// Default endpoint of the server instance #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, + pub endpoint: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetDataClassRequest { +pub struct SetEndpointStatusRequest { #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::DataClass", tag = "2")] - pub data_class: i32, + pub endpoint_id: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::ComponentStatus", tag = "2")] + pub status: i32, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetDataClassResponse { +pub struct SetEndpointStatusResponse { #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotDatasetRequest { - #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotDatasetResponse { - /// This dataset will be returned via an Persistent Identifier! Updates will be impossible - #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetLicensesRequest { - #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub metadata_license_tag: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub default_data_license_tag: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetLicensesResponse { - #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetTitleRequest { - #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub title: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetTitleResponse { - #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetAuthorsRequest { - #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub add_authors: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub remove_authors: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetAuthorsResponse { - #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, + pub endpoint: ::core::option::Option, } /// Generated client implementations. -pub mod dataset_service_client { +pub mod endpoint_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// DatasetService + /// EndpointService /// - /// Contains all methods that get/create or update Dataset and associated resources + /// Status: BETA + /// + /// Contains all methods that get/create or update Endpoint (Dataproxies) and associated resources #[derive(Debug, Clone)] - pub struct DatasetServiceClient { + pub struct EndpointServiceClient { inner: tonic::client::Grpc, } - impl DatasetServiceClient { + impl EndpointServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -7631,7 +6904,7 @@ pub mod dataset_service_client { Ok(Self::new(conn)) } } - impl DatasetServiceClient + impl EndpointServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -7649,7 +6922,7 @@ pub mod dataset_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> DatasetServiceClient> + ) -> EndpointServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -7663,7 +6936,7 @@ pub mod dataset_service_client { http::Request, >>::Error: Into + Send + Sync, { - DatasetServiceClient::new(InterceptedService::new(inner, interceptor)) + EndpointServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -7696,16 +6969,17 @@ pub mod dataset_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// CreateNewDataset + /// CreateEndpoint /// /// Status: BETA /// - /// creates a new Dataset - pub async fn create_dataset( + /// Registers a new Endpoint (Aruna DataProxy) to the server + /// requires admin permissions + pub async fn create_endpoint( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -7719,28 +6993,28 @@ pub mod dataset_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/CreateDataset", + "/aruna.api.storage.services.v2.EndpointService/CreateEndpoint", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "CreateDataset", + "aruna.api.storage.services.v2.EndpointService", + "CreateEndpoint", ), ); self.inner.unary(req, path, codec).await } - /// GetDataset + /// FullSyncEndpoint /// /// Status: BETA /// - /// Request a specific dataset by ID - pub async fn get_dataset( + /// Requests a full sync of all endpoint related data + pub async fn full_sync_endpoint( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response>, tonic::Status, > { self.inner @@ -7754,63 +7028,28 @@ pub mod dataset_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/GetDataset", + "/aruna.api.storage.services.v2.EndpointService/FullSyncEndpoint", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "GetDataset", + "aruna.api.storage.services.v2.EndpointService", + "FullSyncEndpoint", ), ); - self.inner.unary(req, path, codec).await + self.inner.server_streaming(req, path, codec).await } - /// GetDatasets + /// SetEndpointStatus /// /// Status: BETA /// - /// Queries multiple datasets by ID - pub async fn get_datasets( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/GetDatasets", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "GetDatasets", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeleteDataset - /// - /// Status: STABLE - /// - /// This request deletes the dataset. - pub async fn delete_dataset( + /// This request sets the status of a specific Endpoint + pub async fn set_endpoint_status( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -7824,28 +7063,28 @@ pub mod dataset_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/DeleteDataset", + "/aruna.api.storage.services.v2.EndpointService/SetEndpointStatus", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "DeleteDataset", + "aruna.api.storage.services.v2.EndpointService", + "SetEndpointStatus", ), ); self.inner.unary(req, path, codec).await } - /// UpdateDatasetName + /// GetEndpoint /// /// Status: BETA /// - /// Updates the dataset name. Caveat! Will rename the "s3 bucket" for data proxies! - pub async fn update_dataset_name( + /// Gets an specific endpoint by ID or Name + pub async fn get_endpoint( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -7859,28 +7098,28 @@ pub mod dataset_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetName", + "/aruna.api.storage.services.v2.EndpointService/GetEndpoint", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "UpdateDatasetName", + "aruna.api.storage.services.v2.EndpointService", + "GetEndpoint", ), ); self.inner.unary(req, path, codec).await } - /// UpdateDatasetDescription + /// GetEndpoints /// /// Status: BETA /// - /// Updates the dataset description. - pub async fn update_dataset_description( + /// Gets all available endpoints + pub async fn get_endpoints( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -7894,28 +7133,29 @@ pub mod dataset_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetDescription", + "/aruna.api.storage.services.v2.EndpointService/GetEndpoints", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "UpdateDatasetDescription", + "aruna.api.storage.services.v2.EndpointService", + "GetEndpoints", ), ); self.inner.unary(req, path, codec).await } - /// UpdateDatasetKeyValues + /// DeleteEndpoint /// /// Status: BETA /// - /// Updates the dataset key values. - pub async fn update_dataset_key_values( + /// Deletes a specific endpoint by id + /// This needs admin permissions + pub async fn delete_endpoint( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -7929,28 +7169,29 @@ pub mod dataset_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetKeyValues", + "/aruna.api.storage.services.v2.EndpointService/DeleteEndpoint", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "UpdateDatasetKeyValues", + "aruna.api.storage.services.v2.EndpointService", + "DeleteEndpoint", ), ); self.inner.unary(req, path, codec).await } - /// UpdateDatasetDataClass + /// GetDefaultEndpoint /// /// Status: BETA /// - /// Updates the dataset name. All (meta) data will be overwritten. - pub async fn update_dataset_data_class( + /// This request returns the default endpoint for the current aruna_server + /// It may produce different results depending on the used server + pub async fn get_default_endpoint( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -7964,317 +7205,131 @@ pub mod dataset_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetDataClass", + "/aruna.api.storage.services.v2.EndpointService/GetDefaultEndpoint", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "UpdateDatasetDataClass", + "aruna.api.storage.services.v2.EndpointService", + "GetDefaultEndpoint", ), ); self.inner.unary(req, path, codec).await } - /// SnapshotDatasetRequest + } +} +/// Generated server implementations. +pub mod endpoint_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with EndpointServiceServer. + #[async_trait] + pub trait EndpointService: Send + Sync + 'static { + /// CreateEndpoint /// /// Status: BETA /// - /// Archives the full dataset, rendering all downstream relations immutable - pub async fn snapshot_dataset( - &mut self, - request: impl tonic::IntoRequest, + /// Registers a new Endpoint (Aruna DataProxy) to the server + /// requires admin permissions + async fn create_endpoint( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/SnapshotDataset", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "SnapshotDataset", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateLicenses - /// - /// Status: BETA - /// - /// Updates the dataset metadata license and/or default data license. - pub async fn update_dataset_licenses( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetLicenses", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "UpdateDatasetLicenses", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateTitle - /// - /// Status: ALPHA - /// - /// Updates the datasets metadata title. - pub async fn update_dataset_title( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetTitle", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "UpdateDatasetTitle", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateAuthors - /// - /// Status: ALPHA - /// - /// Updates the datasets metadata title. - pub async fn update_dataset_authors( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetAuthors", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "UpdateDatasetAuthors", - ), - ); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod dataset_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with DatasetServiceServer. - #[async_trait] - pub trait DatasetService: Send + Sync + 'static { - /// CreateNewDataset - /// - /// Status: BETA - /// - /// creates a new Dataset - async fn create_dataset( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetDataset - /// - /// Status: BETA - /// - /// Request a specific dataset by ID - async fn get_dataset( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetDatasets + /// Server streaming response type for the FullSyncEndpoint method. + type FullSyncEndpointStream: tonic::codegen::tokio_stream::Stream< + Item = std::result::Result< + super::FullSyncEndpointResponse, + tonic::Status, + >, + > + + Send + + 'static; + /// FullSyncEndpoint /// /// Status: BETA /// - /// Queries multiple datasets by ID - async fn get_datasets( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteDataset - /// - /// Status: STABLE - /// - /// This request deletes the dataset. - async fn delete_dataset( + /// Requests a full sync of all endpoint related data + async fn full_sync_endpoint( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateDatasetName + /// SetEndpointStatus /// /// Status: BETA /// - /// Updates the dataset name. Caveat! Will rename the "s3 bucket" for data proxies! - async fn update_dataset_name( + /// This request sets the status of a specific Endpoint + async fn set_endpoint_status( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateDatasetDescription + /// GetEndpoint /// /// Status: BETA /// - /// Updates the dataset description. - async fn update_dataset_description( + /// Gets an specific endpoint by ID or Name + async fn get_endpoint( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateDatasetKeyValues + /// GetEndpoints /// /// Status: BETA /// - /// Updates the dataset key values. - async fn update_dataset_key_values( + /// Gets all available endpoints + async fn get_endpoints( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateDatasetDataClass + /// DeleteEndpoint /// /// Status: BETA /// - /// Updates the dataset name. All (meta) data will be overwritten. - async fn update_dataset_data_class( + /// Deletes a specific endpoint by id + /// This needs admin permissions + async fn delete_endpoint( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// SnapshotDatasetRequest + /// GetDefaultEndpoint /// /// Status: BETA /// - /// Archives the full dataset, rendering all downstream relations immutable - async fn snapshot_dataset( + /// This request returns the default endpoint for the current aruna_server + /// It may produce different results depending on the used server + async fn get_default_endpoint( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateLicenses - /// - /// Status: BETA - /// - /// Updates the dataset metadata license and/or default data license. - async fn update_dataset_licenses( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateTitle - /// - /// Status: ALPHA - /// - /// Updates the datasets metadata title. - async fn update_dataset_title( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateAuthors - /// - /// Status: ALPHA - /// - /// Updates the datasets metadata title. - async fn update_dataset_authors( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// DatasetService + /// EndpointService /// - /// Contains all methods that get/create or update Dataset and associated resources + /// Status: BETA + /// + /// Contains all methods that get/create or update Endpoint (Dataproxies) and associated resources #[derive(Debug)] - pub struct DatasetServiceServer { + pub struct EndpointServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -8282,7 +7337,7 @@ pub mod dataset_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl DatasetServiceServer { + impl EndpointServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -8334,9 +7389,9 @@ pub mod dataset_service_server { self } } - impl tonic::codegen::Service> for DatasetServiceServer + impl tonic::codegen::Service> for EndpointServiceServer where - T: DatasetService, + T: EndpointService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -8352,25 +7407,26 @@ pub mod dataset_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.DatasetService/CreateDataset" => { + "/aruna.api.storage.services.v2.EndpointService/CreateEndpoint" => { #[allow(non_camel_case_types)] - struct CreateDatasetSvc(pub Arc); + struct CreateEndpointSvc(pub Arc); impl< - T: DatasetService, - > tonic::server::UnaryService - for CreateDatasetSvc { - type Response = super::CreateDatasetResponse; + T: EndpointService, + > tonic::server::UnaryService + for CreateEndpointSvc { + type Response = super::CreateEndpointResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_dataset(&inner, request).await + ::create_endpoint(&inner, request) + .await }; Box::pin(fut) } @@ -8382,7 +7438,7 @@ pub mod dataset_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateDatasetSvc(inner); + let method = CreateEndpointSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -8398,25 +7454,28 @@ pub mod dataset_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DatasetService/GetDataset" => { + "/aruna.api.storage.services.v2.EndpointService/FullSyncEndpoint" => { #[allow(non_camel_case_types)] - struct GetDatasetSvc(pub Arc); + struct FullSyncEndpointSvc(pub Arc); impl< - T: DatasetService, - > tonic::server::UnaryService - for GetDatasetSvc { - type Response = super::GetDatasetResponse; + T: EndpointService, + > tonic::server::ServerStreamingService< + super::FullSyncEndpointRequest, + > for FullSyncEndpointSvc { + type Response = super::FullSyncEndpointResponse; + type ResponseStream = T::FullSyncEndpointStream; type Future = BoxFuture< - tonic::Response, + tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_dataset(&inner, request).await + ::full_sync_endpoint(&inner, request) + .await }; Box::pin(fut) } @@ -8428,7 +7487,7 @@ pub mod dataset_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetDatasetSvc(inner); + let method = FullSyncEndpointSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -8439,30 +7498,31 @@ pub mod dataset_service_server { max_decoding_message_size, max_encoding_message_size, ); - let res = grpc.unary(method, req).await; + let res = grpc.server_streaming(method, req).await; Ok(res) }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DatasetService/GetDatasets" => { + "/aruna.api.storage.services.v2.EndpointService/SetEndpointStatus" => { #[allow(non_camel_case_types)] - struct GetDatasetsSvc(pub Arc); + struct SetEndpointStatusSvc(pub Arc); impl< - T: DatasetService, - > tonic::server::UnaryService - for GetDatasetsSvc { - type Response = super::GetDatasetsResponse; + T: EndpointService, + > tonic::server::UnaryService + for SetEndpointStatusSvc { + type Response = super::SetEndpointStatusResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_datasets(&inner, request).await + ::set_endpoint_status(&inner, request) + .await }; Box::pin(fut) } @@ -8474,7 +7534,7 @@ pub mod dataset_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetDatasetsSvc(inner); + let method = SetEndpointStatusSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -8490,25 +7550,25 @@ pub mod dataset_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DatasetService/DeleteDataset" => { + "/aruna.api.storage.services.v2.EndpointService/GetEndpoint" => { #[allow(non_camel_case_types)] - struct DeleteDatasetSvc(pub Arc); + struct GetEndpointSvc(pub Arc); impl< - T: DatasetService, - > tonic::server::UnaryService - for DeleteDatasetSvc { - type Response = super::DeleteDatasetResponse; + T: EndpointService, + > tonic::server::UnaryService + for GetEndpointSvc { + type Response = super::GetEndpointResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_dataset(&inner, request).await + ::get_endpoint(&inner, request).await }; Box::pin(fut) } @@ -8520,7 +7580,7 @@ pub mod dataset_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteDatasetSvc(inner); + let method = GetEndpointSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -8536,26 +7596,25 @@ pub mod dataset_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetName" => { + "/aruna.api.storage.services.v2.EndpointService/GetEndpoints" => { #[allow(non_camel_case_types)] - struct UpdateDatasetNameSvc(pub Arc); + struct GetEndpointsSvc(pub Arc); impl< - T: DatasetService, - > tonic::server::UnaryService - for UpdateDatasetNameSvc { - type Response = super::UpdateDatasetNameResponse; + T: EndpointService, + > tonic::server::UnaryService + for GetEndpointsSvc { + type Response = super::GetEndpointsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_dataset_name(&inner, request) - .await + ::get_endpoints(&inner, request).await }; Box::pin(fut) } @@ -8567,7 +7626,7 @@ pub mod dataset_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateDatasetNameSvc(inner); + let method = GetEndpointsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -8583,30 +7642,25 @@ pub mod dataset_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetDescription" => { + "/aruna.api.storage.services.v2.EndpointService/DeleteEndpoint" => { #[allow(non_camel_case_types)] - struct UpdateDatasetDescriptionSvc(pub Arc); + struct DeleteEndpointSvc(pub Arc); impl< - T: DatasetService, - > tonic::server::UnaryService - for UpdateDatasetDescriptionSvc { - type Response = super::UpdateDatasetDescriptionResponse; + T: EndpointService, + > tonic::server::UnaryService + for DeleteEndpointSvc { + type Response = super::DeleteEndpointResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::UpdateDatasetDescriptionRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_dataset_description( - &inner, - request, - ) + ::delete_endpoint(&inner, request) .await }; Box::pin(fut) @@ -8619,7 +7673,7 @@ pub mod dataset_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateDatasetDescriptionSvc(inner); + let method = DeleteEndpointSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -8635,25 +7689,25 @@ pub mod dataset_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetKeyValues" => { + "/aruna.api.storage.services.v2.EndpointService/GetDefaultEndpoint" => { #[allow(non_camel_case_types)] - struct UpdateDatasetKeyValuesSvc(pub Arc); + struct GetDefaultEndpointSvc(pub Arc); impl< - T: DatasetService, - > tonic::server::UnaryService - for UpdateDatasetKeyValuesSvc { - type Response = super::UpdateDatasetKeyValuesResponse; + T: EndpointService, + > tonic::server::UnaryService + for GetDefaultEndpointSvc { + type Response = super::GetDefaultEndpointResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_dataset_key_values( + ::get_default_endpoint( &inner, request, ) @@ -8669,7 +7723,7 @@ pub mod dataset_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateDatasetKeyValuesSvc(inner); + let method = GetDefaultEndpointSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -8685,266 +7739,22 @@ pub mod dataset_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetDataClass" => { - #[allow(non_camel_case_types)] - struct UpdateDatasetDataClassSvc(pub Arc); - impl< - T: DatasetService, - > tonic::server::UnaryService - for UpdateDatasetDataClassSvc { - type Response = super::UpdateDatasetDataClassResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::update_dataset_data_class( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = UpdateDatasetDataClassSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.DatasetService/SnapshotDataset" => { - #[allow(non_camel_case_types)] - struct SnapshotDatasetSvc(pub Arc); - impl< - T: DatasetService, - > tonic::server::UnaryService - for SnapshotDatasetSvc { - type Response = super::SnapshotDatasetResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::snapshot_dataset(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = SnapshotDatasetSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetLicenses" => { - #[allow(non_camel_case_types)] - struct UpdateDatasetLicensesSvc(pub Arc); - impl< - T: DatasetService, - > tonic::server::UnaryService - for UpdateDatasetLicensesSvc { - type Response = super::UpdateDatasetLicensesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::update_dataset_licenses( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = UpdateDatasetLicensesSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetTitle" => { - #[allow(non_camel_case_types)] - struct UpdateDatasetTitleSvc(pub Arc); - impl< - T: DatasetService, - > tonic::server::UnaryService - for UpdateDatasetTitleSvc { - type Response = super::UpdateDatasetTitleResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::update_dataset_title(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = UpdateDatasetTitleSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetAuthors" => { - #[allow(non_camel_case_types)] - struct UpdateDatasetAuthorsSvc(pub Arc); - impl< - T: DatasetService, - > tonic::server::UnaryService - for UpdateDatasetAuthorsSvc { - type Response = super::UpdateDatasetAuthorsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::update_dataset_authors( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = UpdateDatasetAuthorsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) } } } } - impl Clone for DatasetServiceServer { + impl Clone for EndpointServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -8956,7 +7766,7 @@ pub mod dataset_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -8966,95 +7776,117 @@ pub mod dataset_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for DatasetServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.DatasetService"; + impl tonic::server::NamedService for EndpointServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.EndpointService"; } } -/// CreateLicenseRequest -/// -/// Request object for CreateLicense #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateLicenseRequest { - /// CC-BY-SA-4.0 +pub struct UserPermission { #[prost(string, tag = "1")] - pub tag: ::prost::alloc::string::String, - /// Creative Commons Attribution-ShareAlike 4.0 International + pub user_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub text: ::prost::alloc::string::String, - /// url is optional - /// - /// - #[prost(string, tag = "4")] - pub url: ::prost::alloc::string::String, + pub user_name: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "3")] + pub permission_level: i32, } -/// CreateLicenseResponse -/// -/// Response object for CreateLicense #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateLicenseResponse { - /// CC-BY-SA-4.0 +pub struct ResourceAuthorization { #[prost(string, tag = "1")] - pub tag: ::prost::alloc::string::String, + pub resource_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub user_permission: ::prost::alloc::vec::Vec, } -/// GetLicenseRequest -/// -/// Request object for GetLicense #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetLicenseRequest { - /// 1234567890abcdef +pub struct CreateAuthorizationRequest { #[prost(string, tag = "1")] - pub tag: ::prost::alloc::string::String, -} -/// GetLicenseResponse -/// -/// Response object for GetLicense -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetLicenseResponse { - #[prost(message, optional, tag = "1")] - pub license: ::core::option::Option, + pub resource_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub user_id: ::prost::alloc::string::String, + /// Can also include "deny" + #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "3")] + pub permission_level: i32, } -/// ListLicensesRequest -/// -/// Request object for ListLicense #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListLicensesRequest {} -/// ListLicenseResponse -/// -/// Response object for ListLicense +pub struct CreateAuthorizationResponse { + #[prost(string, tag = "1")] + pub resource_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub user_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub user_name: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "4")] + pub permission_level: i32, +} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListLicensesResponse { +pub struct GetAuthorizationsRequest { + #[prost(string, tag = "1")] + pub resource_id: ::prost::alloc::string::String, + #[prost(bool, tag = "2")] + pub recursive: bool, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAuthorizationsResponse { #[prost(message, repeated, tag = "1")] - pub licenses: ::prost::alloc::vec::Vec, + pub authorizations: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteAuthorizationRequest { + #[prost(string, tag = "1")] + pub resource_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub user_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteAuthorizationResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateAuthorizationRequest { + #[prost(string, tag = "1")] + pub resource_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub user_id: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "3")] + pub permission_level: i32, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateAuthorizationResponse { + #[prost(message, optional, tag = "1")] + pub user_permission: ::core::option::Option, } /// Generated client implementations. -pub mod license_service_client { +pub mod authorization_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// LicenseService + /// AuthorizationService /// /// Status: BETA /// - /// Contains all methods to add, get or list (custom) licenses + /// Contains all methods to edit and change user authorization #[derive(Debug, Clone)] - pub struct LicenseServiceClient { + pub struct AuthorizationServiceClient { inner: tonic::client::Grpc, } - impl LicenseServiceClient { + impl AuthorizationServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -9065,7 +7897,7 @@ pub mod license_service_client { Ok(Self::new(conn)) } } - impl LicenseServiceClient + impl AuthorizationServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -9083,7 +7915,7 @@ pub mod license_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> LicenseServiceClient> + ) -> AuthorizationServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -9097,7 +7929,7 @@ pub mod license_service_client { http::Request, >>::Error: Into + Send + Sync, { - LicenseServiceClient::new(InterceptedService::new(inner, interceptor)) + AuthorizationServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -9130,16 +7962,17 @@ pub mod license_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// CreateLicense + /// CreateAuthorization /// /// Status: BETA /// - /// This creates a new license - pub async fn create_license( + /// This creates a user-specific attribute that handles permission for a + /// specific resource + pub async fn create_authorization( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9153,28 +7986,28 @@ pub mod license_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.LicenseService/CreateLicense", + "/aruna.api.storage.services.v2.AuthorizationService/CreateAuthorization", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.LicenseService", - "CreateLicense", + "aruna.api.storage.services.v2.AuthorizationService", + "CreateAuthorization", ), ); self.inner.unary(req, path, codec).await } - /// GetLicense + /// GetAuthorization /// /// Status: BETA /// - /// This returns the license for a given tag - pub async fn get_license( + /// This gets resource specific user authorizations + pub async fn get_authorizations( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9188,28 +8021,29 @@ pub mod license_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.LicenseService/GetLicense", + "/aruna.api.storage.services.v2.AuthorizationService/GetAuthorizations", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.LicenseService", - "GetLicense", + "aruna.api.storage.services.v2.AuthorizationService", + "GetAuthorizations", ), ); self.inner.unary(req, path, codec).await } - /// ListLicenses + /// DeleteAuthorization /// /// Status: BETA /// - /// This returns a list of all licenses - pub async fn list_licenses( + /// This deletes a user-specific attribute that handles permission for a + /// specific resource + pub async fn delete_authorization( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9223,14 +8057,50 @@ pub mod license_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.LicenseService/ListLicenses", + "/aruna.api.storage.services.v2.AuthorizationService/DeleteAuthorization", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.LicenseService", - "ListLicenses", + "aruna.api.storage.services.v2.AuthorizationService", + "DeleteAuthorization", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateAuthorization + /// + /// Status: BETA + /// + /// This creates a user-specific attribute that handles permission for a + /// specific resource + pub async fn update_authorization( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.AuthorizationService/UpdateAuthorization", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.AuthorizationService", + "UpdateAuthorization", ), ); self.inner.unary(req, path, codec).await @@ -9238,56 +8108,71 @@ pub mod license_service_client { } } /// Generated server implementations. -pub mod license_service_server { +pub mod authorization_service_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with LicenseServiceServer. + /// Generated trait containing gRPC methods that should be implemented for use with AuthorizationServiceServer. #[async_trait] - pub trait LicenseService: Send + Sync + 'static { - /// CreateLicense + pub trait AuthorizationService: Send + Sync + 'static { + /// CreateAuthorization /// /// Status: BETA /// - /// This creates a new license - async fn create_license( + /// This creates a user-specific attribute that handles permission for a + /// specific resource + async fn create_authorization( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetLicense + /// GetAuthorization /// /// Status: BETA /// - /// This returns the license for a given tag - async fn get_license( + /// This gets resource specific user authorizations + async fn get_authorizations( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ListLicenses + /// DeleteAuthorization /// /// Status: BETA /// - /// This returns a list of all licenses - async fn list_licenses( + /// This deletes a user-specific attribute that handles permission for a + /// specific resource + async fn delete_authorization( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, + tonic::Status, + >; + /// UpdateAuthorization + /// + /// Status: BETA + /// + /// This creates a user-specific attribute that handles permission for a + /// specific resource + async fn update_authorization( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, tonic::Status, >; } - /// LicenseService + /// AuthorizationService /// /// Status: BETA /// - /// Contains all methods to add, get or list (custom) licenses + /// Contains all methods to edit and change user authorization #[derive(Debug)] - pub struct LicenseServiceServer { + pub struct AuthorizationServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -9295,7 +8180,7 @@ pub mod license_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl LicenseServiceServer { + impl AuthorizationServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -9347,9 +8232,10 @@ pub mod license_service_server { self } } - impl tonic::codegen::Service> for LicenseServiceServer + impl tonic::codegen::Service> + for AuthorizationServiceServer where - T: LicenseService, + T: AuthorizationService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -9365,25 +8251,29 @@ pub mod license_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.LicenseService/CreateLicense" => { + "/aruna.api.storage.services.v2.AuthorizationService/CreateAuthorization" => { #[allow(non_camel_case_types)] - struct CreateLicenseSvc(pub Arc); + struct CreateAuthorizationSvc(pub Arc); impl< - T: LicenseService, - > tonic::server::UnaryService - for CreateLicenseSvc { - type Response = super::CreateLicenseResponse; + T: AuthorizationService, + > tonic::server::UnaryService + for CreateAuthorizationSvc { + type Response = super::CreateAuthorizationResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_license(&inner, request).await + ::create_authorization( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -9395,7 +8285,7 @@ pub mod license_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateLicenseSvc(inner); + let method = CreateAuthorizationSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -9411,25 +8301,29 @@ pub mod license_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.LicenseService/GetLicense" => { + "/aruna.api.storage.services.v2.AuthorizationService/GetAuthorizations" => { #[allow(non_camel_case_types)] - struct GetLicenseSvc(pub Arc); + struct GetAuthorizationsSvc(pub Arc); impl< - T: LicenseService, - > tonic::server::UnaryService - for GetLicenseSvc { - type Response = super::GetLicenseResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, + T: AuthorizationService, + > tonic::server::UnaryService + for GetAuthorizationsSvc { + type Response = super::GetAuthorizationsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_license(&inner, request).await + ::get_authorizations( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -9441,7 +8335,7 @@ pub mod license_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetLicenseSvc(inner); + let method = GetAuthorizationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -9457,25 +8351,29 @@ pub mod license_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.LicenseService/ListLicenses" => { + "/aruna.api.storage.services.v2.AuthorizationService/DeleteAuthorization" => { #[allow(non_camel_case_types)] - struct ListLicensesSvc(pub Arc); + struct DeleteAuthorizationSvc(pub Arc); impl< - T: LicenseService, - > tonic::server::UnaryService - for ListLicensesSvc { - type Response = super::ListLicensesResponse; + T: AuthorizationService, + > tonic::server::UnaryService + for DeleteAuthorizationSvc { + type Response = super::DeleteAuthorizationResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::list_licenses(&inner, request).await + ::delete_authorization( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -9487,7 +8385,57 @@ pub mod license_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ListLicensesSvc(inner); + let method = DeleteAuthorizationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.AuthorizationService/UpdateAuthorization" => { + #[allow(non_camel_case_types)] + struct UpdateAuthorizationSvc(pub Arc); + impl< + T: AuthorizationService, + > tonic::server::UnaryService + for UpdateAuthorizationSvc { + type Response = super::UpdateAuthorizationResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_authorization( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateAuthorizationSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -9518,7 +8466,7 @@ pub mod license_service_server { } } } - impl Clone for LicenseServiceServer { + impl Clone for AuthorizationServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -9530,7 +8478,7 @@ pub mod license_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -9540,164 +8488,291 @@ pub mod license_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for LicenseServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.LicenseService"; + impl tonic::server::NamedService + for AuthorizationServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.AuthorizationService"; } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateWorkspaceTemplateRequest { - /// The user id of the template owner (will be automatically added as "admin" to each associated workspace) +pub struct CreateServiceAccountRequest { #[prost(string, tag = "1")] - pub owner_id: ::prost::alloc::string::String, - /// Short prefix for each workspace_project (will be prepended by a random id) example: test-i12ashj9g2 - #[prost(string, tag = "2")] - pub prefix: ::prost::alloc::string::String, - /// The name of the workspace template - #[prost(string, tag = "3")] pub name: ::prost::alloc::string::String, - /// Hooks that are added to created workspaces - #[prost(string, repeated, tag = "5")] - pub hook_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Description of the workspace - #[prost(string, tag = "6")] - pub description: ::prost::alloc::string::String, - /// Endpoint ids that are used for this template - #[prost(string, repeated, tag = "7")] - pub endpoint_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Rule ids that are enforced on workspace-level - #[prost(string, repeated, tag = "8")] - pub rules: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, tag = "2")] + pub project_id: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "3")] + pub permission_level: i32, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateWorkspaceTemplateResponse { +pub struct ServiceAccount { #[prost(string, tag = "1")] - pub template_id: ::prost::alloc::string::String, + pub svc_account_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub permission: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetWorkspaceTemplateRequest { +pub struct CreateServiceAccountResponse { + #[prost(message, optional, tag = "1")] + pub service_account: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateServiceAccountTokenRequest { #[prost(string, tag = "1")] - pub template_id: ::prost::alloc::string::String, + pub svc_account_id: ::prost::alloc::string::String, + /// Token permissions + #[prost(message, optional, tag = "2")] + pub permission: ::core::option::Option, + /// (optional) Token name + #[prost(string, tag = "3")] + pub name: ::prost::alloc::string::String, + /// (optional) Token expiry + #[prost(message, optional, tag = "4")] + pub expires_at: ::core::option::Option<::prost_wkt_types::Timestamp>, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetWorkspaceTemplateResponse { +pub struct CreateServiceAccountTokenResponse { + /// This contains only the token description #[prost(message, optional, tag = "1")] - pub workspace: ::core::option::Option, + pub token: ::core::option::Option, + /// This is the actual secret API token + #[prost(string, tag = "2")] + pub token_secret: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteWorkspaceTemplateRequest { +pub struct GetServiceAccountTokenRequest { #[prost(string, tag = "1")] - pub template_id: ::prost::alloc::string::String, + pub svc_account_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub token_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteWorkspaceTemplateResponse {} +pub struct GetServiceAccountTokenResponse { + /// This contains only the token description + #[prost(message, optional, tag = "1")] + pub token: ::core::option::Option, +} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListOwnedWorkspaceTemplatesRequest {} +pub struct GetServiceAccountTokensRequest { + #[prost(string, tag = "1")] + pub svc_account_id: ::prost::alloc::string::String, +} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListOwnedWorkspaceTemplatesResponse { +pub struct GetServiceAccountTokensResponse { + /// This contains only the token description #[prost(message, repeated, tag = "1")] - pub workspaces: ::prost::alloc::vec::Vec, + pub tokens: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct WorkspaceInfo { +pub struct DeleteServiceAccountTokenRequest { #[prost(string, tag = "1")] - pub workspace_id: ::prost::alloc::string::String, + pub svc_account_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub description: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub owner: ::prost::alloc::string::String, - #[prost(string, tag = "5")] - pub prefix: ::prost::alloc::string::String, - #[prost(string, tag = "6")] - pub hook_ids: ::prost::alloc::string::String, - #[prost(string, tag = "7")] - pub endpoint_ids: ::prost::alloc::string::String, + pub token_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateWorkspaceRequest { - /// Workspace template id +pub struct DeleteServiceAccountTokenResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteServiceAccountTokensRequest { #[prost(string, tag = "1")] - pub workspace_template: ::prost::alloc::string::String, - /// Description of this workspace instance - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, + pub svc_account_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateWorkspaceResponse { +pub struct DeleteServiceAccountTokensResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteServiceAccountRequest { #[prost(string, tag = "1")] - pub workspace_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub token: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub access_key: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub secret_key: ::prost::alloc::string::String, + pub svc_account_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteWorkspaceRequest { +pub struct DeleteServiceAccountResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateS3CredentialsSvcAccountRequest { #[prost(string, tag = "1")] - pub workspace_id: ::prost::alloc::string::String, + pub svc_account_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteWorkspaceResponse {} +pub struct CreateS3CredentialsSvcAccountResponse { + #[prost(string, tag = "1")] + pub s3_access_key: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub s3_secret_key: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub s3_endpoint_url: ::prost::alloc::string::String, +} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClaimWorkspaceRequest { - /// This can only be called by an registered user, - /// that is in possesion of the workspace_id and workspace token - /// It will remove the service account and claim all references "as" the user. +pub struct GetS3CredentialsSvcAccountRequest { + /// If called as admin, an id must be provided #[prost(string, tag = "1")] - pub workspace_id: ::prost::alloc::string::String, + pub svc_account_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] - pub token: ::prost::alloc::string::String, + pub endpoint_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClaimWorkspaceResponse {} -/// Generated client implementations. -pub mod workspace_service_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] +pub struct GetS3CredentialsSvcAccountResponse { + #[prost(string, tag = "1")] + pub s3_access_key: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub s3_secret_key: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub s3_endpoint_url: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteS3CredentialsSvcAccountRequest { + #[prost(string, tag = "1")] + pub svc_account_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteS3CredentialsSvcAccountResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateDataproxyTokenSvcAccountRequest { + /// Needs to be provided by project admins + #[prost(string, tag = "1")] + pub svc_account_id: ::prost::alloc::string::String, + /// optional context to limit the scope + #[prost(message, optional, tag = "3")] + pub context: ::core::option::Option, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateDataproxyTokenSvcAccountResponse { + #[prost(string, tag = "1")] + pub token: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddPubkeySvcAccountRequest { + #[prost(string, tag = "1")] + pub svc_account_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub public_key: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddPubkeySvcAccountResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddTrustedEndpointsSvcAccountRequest { + #[prost(string, tag = "1")] + pub svc_account_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddTrustedEndpointsSvcAccountResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RemoveTrustedEndpointsSvcAccountRequest { + #[prost(string, tag = "1")] + pub svc_account_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RemoveTrustedEndpointsSvcAccountResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddDataProxyAttributeSvcAccountRequest { + #[prost(string, tag = "1")] + pub svc_account_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub attribute: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddDataProxyAttributeSvcAccountResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RemoveDataProxyAttributeSvcAccountRequest { + #[prost(string, tag = "1")] + pub svc_account_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub dataproxy_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub attribute_name: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RemoveDataProxyAttributeSvcAccountResponse {} +/// Generated client implementations. +pub mod service_account_service_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// WorkspaceService + /// ServiceAccountService /// /// Status: BETA /// - /// Service to manage anonymous "scratch" projects / workspaces + /// Service that contains CRUD operations for service_accounts. + /// Service accounts are project specific accounts that can be used for automation. #[derive(Debug, Clone)] - pub struct WorkspaceServiceClient { + pub struct ServiceAccountServiceClient { inner: tonic::client::Grpc, } - impl WorkspaceServiceClient { + impl ServiceAccountServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -9708,7 +8783,7 @@ pub mod workspace_service_client { Ok(Self::new(conn)) } } - impl WorkspaceServiceClient + impl ServiceAccountServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -9726,7 +8801,7 @@ pub mod workspace_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> WorkspaceServiceClient> + ) -> ServiceAccountServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -9740,7 +8815,7 @@ pub mod workspace_service_client { http::Request, >>::Error: Into + Send + Sync, { - WorkspaceServiceClient::new(InterceptedService::new(inner, interceptor)) + ServiceAccountServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -9773,16 +8848,18 @@ pub mod workspace_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// CreatesNewWorkspaceTemplate + /// CreateServiceAccount /// - /// Status: ALPHA + /// Status: BETA /// - /// This will create a new template for workspaces (admin only) - pub async fn create_workspace_template( + /// Creates a service account for a given project + /// If the service account has permissions for the global Admin project + /// it will be a global service account that can interact with any resource + pub async fn create_service_account( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9796,28 +8873,30 @@ pub mod workspace_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.WorkspaceService/CreateWorkspaceTemplate", + "/aruna.api.storage.services.v2.ServiceAccountService/CreateServiceAccount", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.WorkspaceService", - "CreateWorkspaceTemplate", + "aruna.api.storage.services.v2.ServiceAccountService", + "CreateServiceAccount", ), ); self.inner.unary(req, path, codec).await } - /// GetWorkspaceTemplatesById + /// CreateServiceAccountToken /// - /// Status: ALPHA + /// Status: BETA /// - /// Gets workspace template by id - pub async fn get_workspace_template( + /// Creates a token for a service account + /// Each service account can only have one permission -> The token will have the same permission as the + /// service account or a subset of it. + pub async fn create_service_account_token( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9831,28 +8910,29 @@ pub mod workspace_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.WorkspaceService/GetWorkspaceTemplate", + "/aruna.api.storage.services.v2.ServiceAccountService/CreateServiceAccountToken", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.WorkspaceService", - "GetWorkspaceTemplate", + "aruna.api.storage.services.v2.ServiceAccountService", + "CreateServiceAccountToken", ), ); self.inner.unary(req, path, codec).await } - /// ListOwnedWorkspaceTemplates + /// GetServiceAccountToken /// - /// Status: ALPHA + /// Status: BETA /// - /// Lists owned workspace templates - pub async fn list_owned_workspace_templates( + /// This requests the overall information about a specifc service account token (by id) + /// it will not contain the token itself. + pub async fn get_service_account_token( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9866,28 +8946,29 @@ pub mod workspace_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.WorkspaceService/ListOwnedWorkspaceTemplates", + "/aruna.api.storage.services.v2.ServiceAccountService/GetServiceAccountToken", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.WorkspaceService", - "ListOwnedWorkspaceTemplates", + "aruna.api.storage.services.v2.ServiceAccountService", + "GetServiceAccountToken", ), ); self.inner.unary(req, path, codec).await } - /// DeleteWorkspaceTemplates + /// GetServiceAccountTokens /// - /// Status: ALPHA + /// Status: BETA /// - /// Deletes specified workspace templates - pub async fn delete_workspace_template( + /// This requests the overall information about all service account tokens + /// it will not contain the token itself. + pub async fn get_service_account_tokens( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9901,28 +8982,28 @@ pub mod workspace_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.WorkspaceService/DeleteWorkspaceTemplate", + "/aruna.api.storage.services.v2.ServiceAccountService/GetServiceAccountTokens", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.WorkspaceService", - "DeleteWorkspaceTemplate", + "aruna.api.storage.services.v2.ServiceAccountService", + "GetServiceAccountTokens", ), ); self.inner.unary(req, path, codec).await } - /// CreateWorkspace + /// DeleteServiceAccountToken /// - /// Status: ALPHA + /// Status: BETA /// - /// Create a personal anonymous workspace - pub async fn create_workspace( + /// Deletes one service account token by ID + pub async fn delete_service_account_token( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9936,28 +9017,28 @@ pub mod workspace_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.WorkspaceService/CreateWorkspace", + "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccountToken", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.WorkspaceService", - "CreateWorkspace", + "aruna.api.storage.services.v2.ServiceAccountService", + "DeleteServiceAccountToken", ), ); self.inner.unary(req, path, codec).await } - /// DeleteWorkspace + /// DeleteServiceAccountTokens /// - /// Status: ALPHA + /// Status: BETA /// - /// Delete a workspace - pub async fn delete_workspace( + /// Deletes all service account tokens + pub async fn delete_service_account_tokens( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9971,28 +9052,28 @@ pub mod workspace_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.WorkspaceService/DeleteWorkspace", + "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccountTokens", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.WorkspaceService", - "DeleteWorkspace", + "aruna.api.storage.services.v2.ServiceAccountService", + "DeleteServiceAccountTokens", ), ); self.inner.unary(req, path, codec).await } - /// DeleteWorkspace + /// DeleteServiceAccount /// - /// Status: ALPHA + /// Status: BETA /// - /// Claims an anonymous workspace, and transfers the owner to a regular user account. - pub async fn claim_workspace( + /// Deletes a service account (by id) + pub async fn delete_service_account( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -10006,2954 +9087,658 @@ pub mod workspace_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.WorkspaceService/ClaimWorkspace", + "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccount", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.WorkspaceService", - "ClaimWorkspace", + "aruna.api.storage.services.v2.ServiceAccountService", + "DeleteServiceAccount", ), ); self.inner.unary(req, path, codec).await } - } -} -/// Generated server implementations. -pub mod workspace_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with WorkspaceServiceServer. - #[async_trait] - pub trait WorkspaceService: Send + Sync + 'static { - /// CreatesNewWorkspaceTemplate + /// CreateS3CredentialsSvcAccount /// /// Status: ALPHA /// - /// This will create a new template for workspaces (admin only) - async fn create_workspace_template( - &self, - request: tonic::Request, + /// Creates or updates S3 credentials for a specific SvcAccount and data_proxy + pub async fn create_s3_credentials_svc_account( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// GetWorkspaceTemplatesById + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ServiceAccountService/CreateS3CredentialsSvcAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ServiceAccountService", + "CreateS3CredentialsSvcAccount", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetS3CredentialsSvcAccount /// - /// Status: ALPHA + /// Status: ALPHA /// - /// Gets workspace template by id - async fn get_workspace_template( - &self, - request: tonic::Request, + /// Gets S3 credentials for a specific svc_account and data_proxy + pub async fn get_s3_credentials_svc_account( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// ListOwnedWorkspaceTemplates + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ServiceAccountService/GetS3CredentialsSvcAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ServiceAccountService", + "GetS3CredentialsSvcAccount", + ), + ); + self.inner.unary(req, path, codec).await + } + /// DeleteS3CredentialsSvcAccount /// - /// Status: ALPHA + /// Status: ALPHA /// - /// Lists owned workspace templates - async fn list_owned_workspace_templates( - &self, - request: tonic::Request, + /// Revokes existing S3 credentials for a specific user and data_proxy + pub async fn delete_s3_credentials_svc_account( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// DeleteWorkspaceTemplates + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ServiceAccountService/DeleteS3CredentialsSvcAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ServiceAccountService", + "DeleteS3CredentialsSvcAccount", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetDataproxyToken /// - /// Status: ALPHA + /// Status: ALPHA /// - /// Deletes specified workspace templates - async fn delete_workspace_template( - &self, - request: tonic::Request, + /// Gets token for a specific SvcAccount and data_proxy + pub async fn create_dataproxy_token_svc_account( + &mut self, + request: impl tonic::IntoRequest< + super::CreateDataproxyTokenSvcAccountRequest, + >, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// CreateWorkspace + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ServiceAccountService/CreateDataproxyTokenSvcAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ServiceAccountService", + "CreateDataproxyTokenSvcAccount", + ), + ); + self.inner.unary(req, path, codec).await + } + /// AddPubkeySvcAccount /// /// Status: ALPHA /// - /// Create a personal anonymous workspace - async fn create_workspace( - &self, - request: tonic::Request, + /// Adds an ED25519 public key for the SvcAccount + pub async fn add_pubkey_svc_account( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// DeleteWorkspace + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ServiceAccountService/AddPubkeySvcAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ServiceAccountService", + "AddPubkeySvcAccount", + ), + ); + self.inner.unary(req, path, codec).await + } + /// AddTrustedEndpointsSvcAccount /// /// Status: ALPHA /// - /// Delete a workspace - async fn delete_workspace( - &self, - request: tonic::Request, + /// Adds an endpoint to the trusted endpoints list of the SvcAccount + pub async fn add_trusted_endpoints_svc_account( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// DeleteWorkspace + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ServiceAccountService/AddTrustedEndpointsSvcAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ServiceAccountService", + "AddTrustedEndpointsSvcAccount", + ), + ); + self.inner.unary(req, path, codec).await + } + /// RemoveTrustedEndpointsSvcAccount /// /// Status: ALPHA /// - /// Claims an anonymous workspace, and transfers the owner to a regular user account. - async fn claim_workspace( - &self, - request: tonic::Request, + /// Removes an endpoint from the trusted endpoints list of the SvcAccount + pub async fn remove_trusted_endpoints_svc_account( + &mut self, + request: impl tonic::IntoRequest< + super::RemoveTrustedEndpointsSvcAccountRequest, + >, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - } - /// WorkspaceService - /// - /// Status: BETA - /// - /// Service to manage anonymous "scratch" projects / workspaces - #[derive(Debug)] - pub struct WorkspaceServiceServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl WorkspaceServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ServiceAccountService/RemoveTrustedEndpointsSvcAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ServiceAccountService", + "RemoveTrustedEndpointsSvcAccount", + ), + ); + self.inner.unary(req, path, codec).await } - /// Limits the maximum size of a decoded message. + /// AddDataProxyAttributeSvcAccount /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. + /// Status: ALPHA /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self + /// Adds an data proxy specific attribute to the SvcAccount + pub async fn add_data_proxy_attribute_svc_account( + &mut self, + request: impl tonic::IntoRequest< + super::AddDataProxyAttributeSvcAccountRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ServiceAccountService/AddDataProxyAttributeSvcAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ServiceAccountService", + "AddDataProxyAttributeSvcAccount", + ), + ); + self.inner.unary(req, path, codec).await } - } - impl tonic::codegen::Service> for WorkspaceServiceServer - where - T: WorkspaceService, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( + /// RemoveDataProxyAttributeSvcAccount + /// + /// Status: ALPHA + /// + /// Removes an data proxy specific attribute from the SvcAccount + pub async fn remove_data_proxy_attribute_svc_account( &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) + request: impl tonic::IntoRequest< + super::RemoveDataProxyAttributeSvcAccountRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ServiceAccountService/RemoveDataProxyAttributeSvcAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ServiceAccountService", + "RemoveDataProxyAttributeSvcAccount", + ), + ); + self.inner.unary(req, path, codec).await } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/aruna.api.storage.services.v2.WorkspaceService/CreateWorkspaceTemplate" => { - #[allow(non_camel_case_types)] - struct CreateWorkspaceTemplateSvc(pub Arc); - impl< - T: WorkspaceService, - > tonic::server::UnaryService - for CreateWorkspaceTemplateSvc { - type Response = super::CreateWorkspaceTemplateResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::CreateWorkspaceTemplateRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::create_workspace_template( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = CreateWorkspaceTemplateSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.WorkspaceService/GetWorkspaceTemplate" => { - #[allow(non_camel_case_types)] - struct GetWorkspaceTemplateSvc(pub Arc); - impl< - T: WorkspaceService, - > tonic::server::UnaryService - for GetWorkspaceTemplateSvc { - type Response = super::GetWorkspaceTemplateResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_workspace_template( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetWorkspaceTemplateSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.WorkspaceService/ListOwnedWorkspaceTemplates" => { - #[allow(non_camel_case_types)] - struct ListOwnedWorkspaceTemplatesSvc( - pub Arc, - ); - impl< - T: WorkspaceService, - > tonic::server::UnaryService< - super::ListOwnedWorkspaceTemplatesRequest, - > for ListOwnedWorkspaceTemplatesSvc { - type Response = super::ListOwnedWorkspaceTemplatesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::ListOwnedWorkspaceTemplatesRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::list_owned_workspace_templates( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = ListOwnedWorkspaceTemplatesSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.WorkspaceService/DeleteWorkspaceTemplate" => { - #[allow(non_camel_case_types)] - struct DeleteWorkspaceTemplateSvc(pub Arc); - impl< - T: WorkspaceService, - > tonic::server::UnaryService - for DeleteWorkspaceTemplateSvc { - type Response = super::DeleteWorkspaceTemplateResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::DeleteWorkspaceTemplateRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::delete_workspace_template( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = DeleteWorkspaceTemplateSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.WorkspaceService/CreateWorkspace" => { - #[allow(non_camel_case_types)] - struct CreateWorkspaceSvc(pub Arc); - impl< - T: WorkspaceService, - > tonic::server::UnaryService - for CreateWorkspaceSvc { - type Response = super::CreateWorkspaceResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::create_workspace(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = CreateWorkspaceSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.WorkspaceService/DeleteWorkspace" => { - #[allow(non_camel_case_types)] - struct DeleteWorkspaceSvc(pub Arc); - impl< - T: WorkspaceService, - > tonic::server::UnaryService - for DeleteWorkspaceSvc { - type Response = super::DeleteWorkspaceResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::delete_workspace(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = DeleteWorkspaceSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.WorkspaceService/ClaimWorkspace" => { - #[allow(non_camel_case_types)] - struct ClaimWorkspaceSvc(pub Arc); - impl< - T: WorkspaceService, - > tonic::server::UnaryService - for ClaimWorkspaceSvc { - type Response = super::ClaimWorkspaceResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::claim_workspace(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = ClaimWorkspaceSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for WorkspaceServiceServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for WorkspaceServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.WorkspaceService"; - } -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RegisterUserRequest { - /// user_displayname - #[prost(string, tag = "1")] - pub display_name: ::prost::alloc::string::String, - /// Mail address (optional) - #[prost(string, tag = "2")] - pub email: ::prost::alloc::string::String, - /// Project hint description string (optional) - #[prost(string, tag = "3")] - pub project: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RegisterUserResponse { - /// Created user id - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateApiTokenRequest { - /// Token name - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// Personal or resource specific - #[prost(message, optional, tag = "2")] - pub permission: ::core::option::Option, - /// Token expiry - #[prost(message, optional, tag = "3")] - pub expires_at: ::core::option::Option<::prost_wkt_types::Timestamp>, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateApiTokenResponse { - /// This contains only the token description - #[prost(message, optional, tag = "1")] - pub token: ::core::option::Option, - /// This is the actual secret token - /// Attention, this can not be recreated and needs to be stored securely - /// New tokens will always contain a new secret - #[prost(string, tag = "2")] - pub token_secret: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetApiTokenRequest { - /// The token id - #[prost(string, tag = "1")] - pub token_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetApiTokenResponse { - /// List of API tokens - #[prost(message, optional, tag = "1")] - pub token: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetApiTokensRequest {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetApiTokensResponse { - /// List of API tokens with redacted actual token - #[prost(message, repeated, tag = "1")] - pub tokens: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteApiTokenRequest { - /// The token_id - #[prost(string, tag = "1")] - pub token_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteApiTokenResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteApiTokensRequest { - /// This request invalidates all tokens of a specific user - /// usually the user_id is specified via the provided oidc or aruna token - /// This user_id can be used by admins to invalidate all tokens of a specific - /// user - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteApiTokensResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetUserRequest { - /// Optional user_id - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetUserResponse { - /// User info - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetUserRedactedRequest { - /// Optional user_id - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetUserRedactedResponse { - /// User info - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateUserDisplayNameRequest { - /// New display name - #[prost(string, tag = "1")] - pub new_display_name: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateUserDisplayNameResponse { - /// Updated user info - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ActivateUserRequest { - /// User to activate - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ActivateUserResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetNotActivatedUsersRequest {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetNotActivatedUsersResponse { - /// List of users that are not yet activated - #[prost(message, repeated, tag = "1")] - pub users: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAllUsersRequest {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAllUsersResponse { - #[prost(message, repeated, tag = "1")] - pub user: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeactivateUserRequest { - /// User to activate - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeactivateUserResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateUserEmailRequest { - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, - /// If new email is empty == unsubscribe - #[prost(string, tag = "2")] - pub new_email: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateUserEmailResponse { - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateS3CredentialsUserTokenRequest { - #[prost(string, tag = "1")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateS3CredentialsUserTokenResponse { - #[prost(string, tag = "1")] - pub s3_access_key: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub s3_secret_key: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub s3_endpoint_url: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetS3CredentialsUserTokenRequest { - #[prost(string, tag = "1")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetS3CredentialsUserTokenResponse { - #[prost(string, tag = "1")] - pub s3_access_key: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub s3_secret_key: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub s3_endpoint_url: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteS3CredentialsUserTokenRequest { - #[prost(string, tag = "1")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteS3CredentialsUserResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDataproxyTokenUserRequest { - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub context: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDataproxyTokenUserResponse { - #[prost(string, tag = "1")] - pub token: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetPersonalNotificationsRequest {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetPersonalNotificationsResponse { - #[prost(message, repeated, tag = "1")] - pub notifications: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AcknowledgePersonalNotificationsRequest { - #[prost(string, repeated, tag = "1")] - pub notification_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AcknowledgePersonalNotificationsResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Reference { - #[prost(enumeration = "ReferenceType", tag = "1")] - pub ref_type: i32, - /// "User A" | file.txt - #[prost(string, tag = "2")] - pub ref_name: ::prost::alloc::string::String, - /// 0123AAA123AAA (id) - #[prost(string, tag = "3")] - pub ref_value: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PersonalNotification { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - #[prost(enumeration = "PersonalNotificationVariant", tag = "2")] - pub variant: i32, - /// User A has requested access for resource B - #[prost(string, tag = "3")] - pub message: ::prost::alloc::string::String, - /// References to resource in the "message" - #[prost(message, repeated, tag = "4")] - pub refs: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddOidcProviderRequest { - #[prost(string, tag = "1")] - pub new_access_token: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddOidcProviderResponse { - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveOidcProviderRequest { - #[prost(string, tag = "1")] - pub provider_url: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveOidcProviderResponse { - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddPubkeyUserRequest { - #[prost(string, tag = "1")] - pub public_key: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddPubkeyUserResponse { - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddTrustedEndpointsUserRequest { - #[prost(string, tag = "1")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddTrustedEndpointsUserResponse { - /// Here would be the place to add conditions - /// why the request was denied - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveTrustedEndpointsUserRequest { - #[prost(string, tag = "1")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveTrustedEndpointsUserResponse { - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddDataProxyAttributeUserRequest { - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub attribute: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddDataProxyAttributeUserResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveDataProxyAttributeUserRequest { - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub dataproxy_id: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub attribute_name: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveDataProxyAttributeUserResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ReferenceType { - Unspecified = 0, - User = 1, - Resource = 2, -} -impl ReferenceType { - /// 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 { - ReferenceType::Unspecified => "REFERENCE_TYPE_UNSPECIFIED", - ReferenceType::User => "REFERENCE_TYPE_USER", - ReferenceType::Resource => "REFERENCE_TYPE_RESOURCE", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "REFERENCE_TYPE_UNSPECIFIED" => Some(Self::Unspecified), - "REFERENCE_TYPE_USER" => Some(Self::User), - "REFERENCE_TYPE_RESOURCE" => Some(Self::Resource), - _ => None, - } - } -} -#[derive(serde::Deserialize, serde::Serialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum PersonalNotificationVariant { - Unspecified = 0, - AccessRequested = 1, - PermissionGranted = 2, - PermissionRevoked = 3, - PermissionUpdated = 4, - Announcement = 5, -} -impl PersonalNotificationVariant { - /// 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 { - PersonalNotificationVariant::Unspecified => { - "PERSONAL_NOTIFICATION_VARIANT_UNSPECIFIED" - } - PersonalNotificationVariant::AccessRequested => { - "PERSONAL_NOTIFICATION_VARIANT_ACCESS_REQUESTED" - } - PersonalNotificationVariant::PermissionGranted => { - "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_GRANTED" - } - PersonalNotificationVariant::PermissionRevoked => { - "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_REVOKED" - } - PersonalNotificationVariant::PermissionUpdated => { - "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_UPDATED" - } - PersonalNotificationVariant::Announcement => { - "PERSONAL_NOTIFICATION_VARIANT_ANNOUNCEMENT" - } - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "PERSONAL_NOTIFICATION_VARIANT_UNSPECIFIED" => Some(Self::Unspecified), - "PERSONAL_NOTIFICATION_VARIANT_ACCESS_REQUESTED" => { - Some(Self::AccessRequested) - } - "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_GRANTED" => { - Some(Self::PermissionGranted) - } - "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_REVOKED" => { - Some(Self::PermissionRevoked) - } - "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_UPDATED" => { - Some(Self::PermissionUpdated) - } - "PERSONAL_NOTIFICATION_VARIANT_ANNOUNCEMENT" => Some(Self::Announcement), - _ => None, - } - } -} -/// Generated client implementations. -pub mod user_service_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// UserService - /// - /// Status: BETA - /// - /// Contains all CRUD methods for users and associated resource - #[derive(Debug, Clone)] - pub struct UserServiceClient { - inner: tonic::client::Grpc, - } - impl UserServiceClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl UserServiceClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> UserServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - UserServiceClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// RegisterUser - /// - /// Status: BETA - /// - /// This request should be called when a new user logs in for the first time - pub async fn register_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/RegisterUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "RegisterUser", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeActivateUser - /// - /// Status: BETA - /// - /// This deactivates a specific user (Admin request) - pub async fn deactivate_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/DeactivateUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "DeactivateUser", - ), - ); - self.inner.unary(req, path, codec).await - } - /// ActivateUser - /// - /// Status: BETA - /// - /// This activates a specific user (Admin request) - pub async fn activate_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/ActivateUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "ActivateUser", - ), - ); - self.inner.unary(req, path, codec).await - } - /// CreateAPIToken - /// - /// Status: BETA - /// - /// Creates an API token to authenticate - pub async fn create_api_token( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/CreateAPIToken", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "CreateAPIToken", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetAPIToken - /// - /// Status: BETA - /// - /// Returns one API token by id - pub async fn get_api_token( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/GetAPIToken", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "GetAPIToken", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetAPITokens - /// - /// Status: STABLE - /// - /// Returns a list of API tokens for a specific user - pub async fn get_api_tokens( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/GetAPITokens", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "GetAPITokens", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeleteAPIToken - /// - /// Status: STABLE - /// - /// Deletes the specified API Token - pub async fn delete_api_token( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/DeleteAPIToken", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "DeleteAPIToken", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeleteAPITokens - /// - /// Status: BETA - /// - /// Deletes the specified API Token - pub async fn delete_api_tokens( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/DeleteAPITokens", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "DeleteAPITokens", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetUserRequest - /// - /// Status: STABLE - /// - /// This is a request that returns the user information of the - /// current user or if invoked by an admin from another user - pub async fn get_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/GetUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "GetUser", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetUserRequestRedacted - /// - /// Status: STABLE - /// - /// This is a request that returns the user information of the - /// current user or if invoked by an admin from another user - /// Redacts personal information like name or email - pub async fn get_user_redacted( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/GetUserRedacted", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "GetUserRedacted", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateUserDisplayName - /// - /// Status: STABLE - /// - /// Updates the Displayname for the user (Personal only) - pub async fn update_user_display_name( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/UpdateUserDisplayName", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "UpdateUserDisplayName", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateUserDisplayName - /// - /// Status: ALPHA - /// - /// Updates the email for the user (Personal only) - pub async fn update_user_email( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/UpdateUserEmail", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "UpdateUserEmail", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetNotActivatedUsers - /// - /// Status: STABLE - /// - /// Get all not activated users (Admin only) - pub async fn get_not_activated_users( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/GetNotActivatedUsers", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "GetNotActivatedUsers", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetAllUsers - /// - /// Status: ALPHA - /// - /// Get all users including permissions (Admin only) - pub async fn get_all_users( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/GetAllUsers", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "GetAllUsers", - ), - ); - self.inner.unary(req, path, codec).await - } - /// CreateS3CredentialsUserToken - /// - /// Status: ALPHA - /// - /// Creates or updates S3 credentials for a specific user and data_proxy - pub async fn create_s3_credentials_user_token( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/CreateS3CredentialsUserToken", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "CreateS3CredentialsUserToken", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetS3CredentialsUserToken - /// - /// Status: ALPHA - /// - /// Gets S3 credentials for a specific token and data_proxy - pub async fn get_s3_credentials_user_token( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/GetS3CredentialsUserToken", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "GetS3CredentialsUserToken", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeleteS3CredentialsUserToken - /// - /// Status: ALPHA - /// - /// Revokes existing S3 credentials for a specific user and data_proxy - pub async fn delete_s3_credentials_user_token( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/DeleteS3CredentialsUserToken", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "DeleteS3CredentialsUserToken", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetDataproxyToken - /// - /// Status: ALPHA - /// - /// Gets token for a specific user and data_proxy - pub async fn get_dataproxy_token_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/GetDataproxyTokenUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "GetDataproxyTokenUser", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetPersonalNotifications - /// - /// Status: ALPHA - /// - /// Fetches personal notifications - pub async fn get_personal_notifications( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/GetPersonalNotifications", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "GetPersonalNotifications", - ), - ); - self.inner.unary(req, path, codec).await - } - /// AcknowledgePersonalNotifications - /// - /// Status: ALPHA - /// - /// Acknowledges personal notifications - pub async fn acknowledge_personal_notifications( - &mut self, - request: impl tonic::IntoRequest< - super::AcknowledgePersonalNotificationsRequest, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/AcknowledgePersonalNotifications", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "AcknowledgePersonalNotifications", - ), - ); - self.inner.unary(req, path, codec).await - } - /// AddOidcProvider - /// - /// Status: BETA - /// - /// Add alternative oidc login method for user - pub async fn add_oidc_provider( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/AddOidcProvider", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "AddOidcProvider", - ), - ); - self.inner.unary(req, path, codec).await - } - /// RemoveOidcProvider - /// - /// Status: BETA - /// - /// Remove alternative oidc login method from user - /// (Only works if user has more than one oidc provider) - pub async fn remove_oidc_provider( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/RemoveOidcProvider", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "RemoveOidcProvider", - ), - ); - self.inner.unary(req, path, codec).await - } - /// AddPubkeyUser - /// - /// Status: ALPHA - /// - /// Adds an ED25519 public key for the user - pub async fn add_pubkey_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/AddPubkeyUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "AddPubkeyUser", - ), - ); - self.inner.unary(req, path, codec).await - } - /// AddTrustedEndpointsUser - /// - /// Status: ALPHA - /// - /// Adds an endpoint to the trusted endpoints list of the user - pub async fn add_trusted_endpoints_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/AddTrustedEndpointsUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "AddTrustedEndpointsUser", - ), - ); - self.inner.unary(req, path, codec).await - } - /// RemoveTrustedEndpointsUser - /// - /// Status: ALPHA - /// - /// Removes an endpoint from the trusted endpoints list of the user - pub async fn remove_trusted_endpoints_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/RemoveTrustedEndpointsUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "RemoveTrustedEndpointsUser", - ), - ); - self.inner.unary(req, path, codec).await - } - /// AddDataProxyAttributeUser - /// - /// Status: ALPHA - /// - /// Adds an data proxy specific attribute to the user - pub async fn add_data_proxy_attribute_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/AddDataProxyAttributeUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "AddDataProxyAttributeUser", - ), - ); - self.inner.unary(req, path, codec).await - } - /// RemoveDataProxyAttributeUser - /// - /// Status: ALPHA - /// - /// Removes an data proxy specific attribute from the user - pub async fn remove_data_proxy_attribute_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/RemoveDataProxyAttributeUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "RemoveDataProxyAttributeUser", - ), - ); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod user_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with UserServiceServer. - #[async_trait] - pub trait UserService: Send + Sync + 'static { - /// RegisterUser - /// - /// Status: BETA - /// - /// This request should be called when a new user logs in for the first time - async fn register_user( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeActivateUser - /// - /// Status: BETA - /// - /// This deactivates a specific user (Admin request) - async fn deactivate_user( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// ActivateUser - /// - /// Status: BETA - /// - /// This activates a specific user (Admin request) - async fn activate_user( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// CreateAPIToken - /// - /// Status: BETA - /// - /// Creates an API token to authenticate - async fn create_api_token( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetAPIToken - /// - /// Status: BETA - /// - /// Returns one API token by id - async fn get_api_token( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetAPITokens - /// - /// Status: STABLE - /// - /// Returns a list of API tokens for a specific user - async fn get_api_tokens( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteAPIToken - /// - /// Status: STABLE - /// - /// Deletes the specified API Token - async fn delete_api_token( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteAPITokens - /// - /// Status: BETA - /// - /// Deletes the specified API Token - async fn delete_api_tokens( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetUserRequest - /// - /// Status: STABLE - /// - /// This is a request that returns the user information of the - /// current user or if invoked by an admin from another user - async fn get_user( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// GetUserRequestRedacted - /// - /// Status: STABLE - /// - /// This is a request that returns the user information of the - /// current user or if invoked by an admin from another user - /// Redacts personal information like name or email - async fn get_user_redacted( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateUserDisplayName - /// - /// Status: STABLE - /// - /// Updates the Displayname for the user (Personal only) - async fn update_user_display_name( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateUserDisplayName - /// - /// Status: ALPHA - /// - /// Updates the email for the user (Personal only) - async fn update_user_email( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetNotActivatedUsers - /// - /// Status: STABLE - /// - /// Get all not activated users (Admin only) - async fn get_not_activated_users( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetAllUsers - /// - /// Status: ALPHA - /// - /// Get all users including permissions (Admin only) - async fn get_all_users( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// CreateS3CredentialsUserToken - /// - /// Status: ALPHA - /// - /// Creates or updates S3 credentials for a specific user and data_proxy - async fn create_s3_credentials_user_token( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetS3CredentialsUserToken - /// - /// Status: ALPHA - /// - /// Gets S3 credentials for a specific token and data_proxy - async fn get_s3_credentials_user_token( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteS3CredentialsUserToken - /// - /// Status: ALPHA - /// - /// Revokes existing S3 credentials for a specific user and data_proxy - async fn delete_s3_credentials_user_token( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetDataproxyToken - /// - /// Status: ALPHA - /// - /// Gets token for a specific user and data_proxy - async fn get_dataproxy_token_user( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetPersonalNotifications - /// - /// Status: ALPHA - /// - /// Fetches personal notifications - async fn get_personal_notifications( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AcknowledgePersonalNotifications - /// - /// Status: ALPHA - /// - /// Acknowledges personal notifications - async fn acknowledge_personal_notifications( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AddOidcProvider - /// - /// Status: BETA - /// - /// Add alternative oidc login method for user - async fn add_oidc_provider( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// RemoveOidcProvider - /// - /// Status: BETA - /// - /// Remove alternative oidc login method from user - /// (Only works if user has more than one oidc provider) - async fn remove_oidc_provider( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AddPubkeyUser - /// - /// Status: ALPHA - /// - /// Adds an ED25519 public key for the user - async fn add_pubkey_user( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AddTrustedEndpointsUser - /// - /// Status: ALPHA - /// - /// Adds an endpoint to the trusted endpoints list of the user - async fn add_trusted_endpoints_user( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// RemoveTrustedEndpointsUser - /// - /// Status: ALPHA - /// - /// Removes an endpoint from the trusted endpoints list of the user - async fn remove_trusted_endpoints_user( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AddDataProxyAttributeUser - /// - /// Status: ALPHA - /// - /// Adds an data proxy specific attribute to the user - async fn add_data_proxy_attribute_user( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// RemoveDataProxyAttributeUser - /// - /// Status: ALPHA - /// - /// Removes an data proxy specific attribute from the user - async fn remove_data_proxy_attribute_user( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// UserService - /// - /// Status: BETA - /// - /// Contains all CRUD methods for users and associated resource - #[derive(Debug)] - pub struct UserServiceServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl UserServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for UserServiceServer - where - T: UserService, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/aruna.api.storage.services.v2.UserService/RegisterUser" => { - #[allow(non_camel_case_types)] - struct RegisterUserSvc(pub Arc); - impl< - T: UserService, - > tonic::server::UnaryService - for RegisterUserSvc { - type Response = super::RegisterUserResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::register_user(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = RegisterUserSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.UserService/DeactivateUser" => { - #[allow(non_camel_case_types)] - struct DeactivateUserSvc(pub Arc); - impl< - T: UserService, - > tonic::server::UnaryService - for DeactivateUserSvc { - type Response = super::DeactivateUserResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::deactivate_user(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = DeactivateUserSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.UserService/ActivateUser" => { - #[allow(non_camel_case_types)] - struct ActivateUserSvc(pub Arc); - impl< - T: UserService, - > tonic::server::UnaryService - for ActivateUserSvc { - type Response = super::ActivateUserResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::activate_user(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = ActivateUserSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.UserService/CreateAPIToken" => { - #[allow(non_camel_case_types)] - struct CreateAPITokenSvc(pub Arc); - impl< - T: UserService, - > tonic::server::UnaryService - for CreateAPITokenSvc { - type Response = super::CreateApiTokenResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::create_api_token(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = CreateAPITokenSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.UserService/GetAPIToken" => { - #[allow(non_camel_case_types)] - struct GetAPITokenSvc(pub Arc); - impl< - T: UserService, - > tonic::server::UnaryService - for GetAPITokenSvc { - type Response = super::GetApiTokenResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_api_token(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetAPITokenSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.UserService/GetAPITokens" => { - #[allow(non_camel_case_types)] - struct GetAPITokensSvc(pub Arc); - impl< - T: UserService, - > tonic::server::UnaryService - for GetAPITokensSvc { - type Response = super::GetApiTokensResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_api_tokens(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetAPITokensSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.UserService/DeleteAPIToken" => { - #[allow(non_camel_case_types)] - struct DeleteAPITokenSvc(pub Arc); - impl< - T: UserService, - > tonic::server::UnaryService - for DeleteAPITokenSvc { - type Response = super::DeleteApiTokenResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::delete_api_token(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = DeleteAPITokenSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.UserService/DeleteAPITokens" => { - #[allow(non_camel_case_types)] - struct DeleteAPITokensSvc(pub Arc); - impl< - T: UserService, - > tonic::server::UnaryService - for DeleteAPITokensSvc { - type Response = super::DeleteApiTokensResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::delete_api_tokens(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = DeleteAPITokensSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.UserService/GetUser" => { + } +} +/// Generated server implementations. +pub mod service_account_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with ServiceAccountServiceServer. + #[async_trait] + pub trait ServiceAccountService: Send + Sync + 'static { + /// CreateServiceAccount + /// + /// Status: BETA + /// + /// Creates a service account for a given project + /// If the service account has permissions for the global Admin project + /// it will be a global service account that can interact with any resource + async fn create_service_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// CreateServiceAccountToken + /// + /// Status: BETA + /// + /// Creates a token for a service account + /// Each service account can only have one permission -> The token will have the same permission as the + /// service account or a subset of it. + async fn create_service_account_token( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetServiceAccountToken + /// + /// Status: BETA + /// + /// This requests the overall information about a specifc service account token (by id) + /// it will not contain the token itself. + async fn get_service_account_token( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetServiceAccountTokens + /// + /// Status: BETA + /// + /// This requests the overall information about all service account tokens + /// it will not contain the token itself. + async fn get_service_account_tokens( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteServiceAccountToken + /// + /// Status: BETA + /// + /// Deletes one service account token by ID + async fn delete_service_account_token( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteServiceAccountTokens + /// + /// Status: BETA + /// + /// Deletes all service account tokens + async fn delete_service_account_tokens( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteServiceAccount + /// + /// Status: BETA + /// + /// Deletes a service account (by id) + async fn delete_service_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// CreateS3CredentialsSvcAccount + /// + /// Status: ALPHA + /// + /// Creates or updates S3 credentials for a specific SvcAccount and data_proxy + async fn create_s3_credentials_svc_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetS3CredentialsSvcAccount + /// + /// Status: ALPHA + /// + /// Gets S3 credentials for a specific svc_account and data_proxy + async fn get_s3_credentials_svc_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteS3CredentialsSvcAccount + /// + /// Status: ALPHA + /// + /// Revokes existing S3 credentials for a specific user and data_proxy + async fn delete_s3_credentials_svc_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetDataproxyToken + /// + /// Status: ALPHA + /// + /// Gets token for a specific SvcAccount and data_proxy + async fn create_dataproxy_token_svc_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// AddPubkeySvcAccount + /// + /// Status: ALPHA + /// + /// Adds an ED25519 public key for the SvcAccount + async fn add_pubkey_svc_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// AddTrustedEndpointsSvcAccount + /// + /// Status: ALPHA + /// + /// Adds an endpoint to the trusted endpoints list of the SvcAccount + async fn add_trusted_endpoints_svc_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// RemoveTrustedEndpointsSvcAccount + /// + /// Status: ALPHA + /// + /// Removes an endpoint from the trusted endpoints list of the SvcAccount + async fn remove_trusted_endpoints_svc_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// AddDataProxyAttributeSvcAccount + /// + /// Status: ALPHA + /// + /// Adds an data proxy specific attribute to the SvcAccount + async fn add_data_proxy_attribute_svc_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// RemoveDataProxyAttributeSvcAccount + /// + /// Status: ALPHA + /// + /// Removes an data proxy specific attribute from the SvcAccount + async fn remove_data_proxy_attribute_svc_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// ServiceAccountService + /// + /// Status: BETA + /// + /// Service that contains CRUD operations for service_accounts. + /// Service accounts are project specific accounts that can be used for automation. + #[derive(Debug)] + pub struct ServiceAccountServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl ServiceAccountServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> + for ServiceAccountServiceServer + where + T: ServiceAccountService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/aruna.api.storage.services.v2.ServiceAccountService/CreateServiceAccount" => { #[allow(non_camel_case_types)] - struct GetUserSvc(pub Arc); + struct CreateServiceAccountSvc(pub Arc); impl< - T: UserService, - > tonic::server::UnaryService - for GetUserSvc { - type Response = super::GetUserResponse; + T: ServiceAccountService, + > tonic::server::UnaryService + for CreateServiceAccountSvc { + type Response = super::CreateServiceAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_user(&inner, request).await + ::create_service_account( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -12965,7 +9750,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetUserSvc(inner); + let method = CreateServiceAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -12981,25 +9766,34 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/GetUserRedacted" => { + "/aruna.api.storage.services.v2.ServiceAccountService/CreateServiceAccountToken" => { #[allow(non_camel_case_types)] - struct GetUserRedactedSvc(pub Arc); + struct CreateServiceAccountTokenSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for GetUserRedactedSvc { - type Response = super::GetUserRedactedResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::CreateServiceAccountTokenRequest, + > for CreateServiceAccountTokenSvc { + type Response = super::CreateServiceAccountTokenResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::CreateServiceAccountTokenRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_user_redacted(&inner, request).await + ::create_service_account_token( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -13011,7 +9805,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetUserRedactedSvc(inner); + let method = CreateServiceAccountTokenSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13027,25 +9821,27 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/UpdateUserDisplayName" => { + "/aruna.api.storage.services.v2.ServiceAccountService/GetServiceAccountToken" => { #[allow(non_camel_case_types)] - struct UpdateUserDisplayNameSvc(pub Arc); + struct GetServiceAccountTokenSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for UpdateUserDisplayNameSvc { - type Response = super::UpdateUserDisplayNameResponse; + T: ServiceAccountService, + > tonic::server::UnaryService + for GetServiceAccountTokenSvc { + type Response = super::GetServiceAccountTokenResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_user_display_name( + ::get_service_account_token( &inner, request, ) @@ -13061,7 +9857,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateUserDisplayNameSvc(inner); + let method = GetServiceAccountTokenSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13077,25 +9873,33 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/UpdateUserEmail" => { + "/aruna.api.storage.services.v2.ServiceAccountService/GetServiceAccountTokens" => { #[allow(non_camel_case_types)] - struct UpdateUserEmailSvc(pub Arc); + struct GetServiceAccountTokensSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for UpdateUserEmailSvc { - type Response = super::UpdateUserEmailResponse; + T: ServiceAccountService, + > tonic::server::UnaryService + for GetServiceAccountTokensSvc { + type Response = super::GetServiceAccountTokensResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::GetServiceAccountTokensRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_user_email(&inner, request).await + ::get_service_account_tokens( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -13107,7 +9911,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateUserEmailSvc(inner); + let method = GetServiceAccountTokensSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13123,25 +9927,33 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/GetNotActivatedUsers" => { + "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccountToken" => { #[allow(non_camel_case_types)] - struct GetNotActivatedUsersSvc(pub Arc); + struct DeleteServiceAccountTokenSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for GetNotActivatedUsersSvc { - type Response = super::GetNotActivatedUsersResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::DeleteServiceAccountTokenRequest, + > for DeleteServiceAccountTokenSvc { + type Response = super::DeleteServiceAccountTokenResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::DeleteServiceAccountTokenRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_not_activated_users(&inner, request) + ::delete_service_account_token( + &inner, + request, + ) .await }; Box::pin(fut) @@ -13154,7 +9966,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetNotActivatedUsersSvc(inner); + let method = DeleteServiceAccountTokenSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13170,25 +9982,34 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/GetAllUsers" => { + "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccountTokens" => { #[allow(non_camel_case_types)] - struct GetAllUsersSvc(pub Arc); + struct DeleteServiceAccountTokensSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for GetAllUsersSvc { - type Response = super::GetAllUsersResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::DeleteServiceAccountTokensRequest, + > for DeleteServiceAccountTokensSvc { + type Response = super::DeleteServiceAccountTokensResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::DeleteServiceAccountTokensRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_all_users(&inner, request).await + ::delete_service_account_tokens( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -13200,7 +10021,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetAllUsersSvc(inner); + let method = DeleteServiceAccountTokensSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13216,28 +10037,25 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/CreateS3CredentialsUserToken" => { + "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccount" => { #[allow(non_camel_case_types)] - struct CreateS3CredentialsUserTokenSvc(pub Arc); + struct DeleteServiceAccountSvc(pub Arc); impl< - T: UserService, - > tonic::server::UnaryService< - super::CreateS3CredentialsUserTokenRequest, - > for CreateS3CredentialsUserTokenSvc { - type Response = super::CreateS3CredentialsUserTokenResponse; + T: ServiceAccountService, + > tonic::server::UnaryService + for DeleteServiceAccountSvc { + type Response = super::DeleteServiceAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::CreateS3CredentialsUserTokenRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_s3_credentials_user_token( + ::delete_service_account( &inner, request, ) @@ -13253,7 +10071,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateS3CredentialsUserTokenSvc(inner); + let method = DeleteServiceAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13269,15 +10087,17 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/GetS3CredentialsUserToken" => { + "/aruna.api.storage.services.v2.ServiceAccountService/CreateS3CredentialsSvcAccount" => { #[allow(non_camel_case_types)] - struct GetS3CredentialsUserTokenSvc(pub Arc); + struct CreateS3CredentialsSvcAccountSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService< - super::GetS3CredentialsUserTokenRequest, - > for GetS3CredentialsUserTokenSvc { - type Response = super::GetS3CredentialsUserTokenResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::CreateS3CredentialsSvcAccountRequest, + > for CreateS3CredentialsSvcAccountSvc { + type Response = super::CreateS3CredentialsSvcAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -13285,12 +10105,12 @@ pub mod user_service_server { fn call( &mut self, request: tonic::Request< - super::GetS3CredentialsUserTokenRequest, + super::CreateS3CredentialsSvcAccountRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_s3_credentials_user_token( + ::create_s3_credentials_svc_account( &inner, request, ) @@ -13306,7 +10126,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetS3CredentialsUserTokenSvc(inner); + let method = CreateS3CredentialsSvcAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13322,15 +10142,17 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/DeleteS3CredentialsUserToken" => { + "/aruna.api.storage.services.v2.ServiceAccountService/GetS3CredentialsSvcAccount" => { #[allow(non_camel_case_types)] - struct DeleteS3CredentialsUserTokenSvc(pub Arc); + struct GetS3CredentialsSvcAccountSvc( + pub Arc, + ); impl< - T: UserService, + T: ServiceAccountService, > tonic::server::UnaryService< - super::DeleteS3CredentialsUserTokenRequest, - > for DeleteS3CredentialsUserTokenSvc { - type Response = super::DeleteS3CredentialsUserResponse; + super::GetS3CredentialsSvcAccountRequest, + > for GetS3CredentialsSvcAccountSvc { + type Response = super::GetS3CredentialsSvcAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -13338,12 +10160,12 @@ pub mod user_service_server { fn call( &mut self, request: tonic::Request< - super::DeleteS3CredentialsUserTokenRequest, + super::GetS3CredentialsSvcAccountRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_s3_credentials_user_token( + ::get_s3_credentials_svc_account( &inner, request, ) @@ -13359,7 +10181,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteS3CredentialsUserTokenSvc(inner); + let method = GetS3CredentialsSvcAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13375,25 +10197,30 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/GetDataproxyTokenUser" => { + "/aruna.api.storage.services.v2.ServiceAccountService/DeleteS3CredentialsSvcAccount" => { #[allow(non_camel_case_types)] - struct GetDataproxyTokenUserSvc(pub Arc); + struct DeleteS3CredentialsSvcAccountSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for GetDataproxyTokenUserSvc { - type Response = super::GetDataproxyTokenUserResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::DeleteS3CredentialsSvcAccountRequest, + > for DeleteS3CredentialsSvcAccountSvc { + type Response = super::DeleteS3CredentialsSvcAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::DeleteS3CredentialsSvcAccountRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_dataproxy_token_user( + ::delete_s3_credentials_svc_account( &inner, request, ) @@ -13409,7 +10236,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetDataproxyTokenUserSvc(inner); + let method = DeleteS3CredentialsSvcAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13425,14 +10252,17 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/GetPersonalNotifications" => { + "/aruna.api.storage.services.v2.ServiceAccountService/CreateDataproxyTokenSvcAccount" => { #[allow(non_camel_case_types)] - struct GetPersonalNotificationsSvc(pub Arc); + struct CreateDataproxyTokenSvcAccountSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for GetPersonalNotificationsSvc { - type Response = super::GetPersonalNotificationsResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::CreateDataproxyTokenSvcAccountRequest, + > for CreateDataproxyTokenSvcAccountSvc { + type Response = super::CreateDataproxyTokenSvcAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -13440,12 +10270,12 @@ pub mod user_service_server { fn call( &mut self, request: tonic::Request< - super::GetPersonalNotificationsRequest, + super::CreateDataproxyTokenSvcAccountRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_personal_notifications( + ::create_dataproxy_token_svc_account( &inner, request, ) @@ -13461,7 +10291,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetPersonalNotificationsSvc(inner); + let method = CreateDataproxyTokenSvcAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13477,30 +10307,25 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/AcknowledgePersonalNotifications" => { + "/aruna.api.storage.services.v2.ServiceAccountService/AddPubkeySvcAccount" => { #[allow(non_camel_case_types)] - struct AcknowledgePersonalNotificationsSvc( - pub Arc, - ); + struct AddPubkeySvcAccountSvc(pub Arc); impl< - T: UserService, - > tonic::server::UnaryService< - super::AcknowledgePersonalNotificationsRequest, - > for AcknowledgePersonalNotificationsSvc { - type Response = super::AcknowledgePersonalNotificationsResponse; + T: ServiceAccountService, + > tonic::server::UnaryService + for AddPubkeySvcAccountSvc { + type Response = super::AddPubkeySvcAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::AcknowledgePersonalNotificationsRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::acknowledge_personal_notifications( + ::add_pubkey_svc_account( &inner, request, ) @@ -13516,7 +10341,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = AcknowledgePersonalNotificationsSvc(inner); + let method = AddPubkeySvcAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13532,25 +10357,34 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/AddOidcProvider" => { + "/aruna.api.storage.services.v2.ServiceAccountService/AddTrustedEndpointsSvcAccount" => { #[allow(non_camel_case_types)] - struct AddOidcProviderSvc(pub Arc); + struct AddTrustedEndpointsSvcAccountSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for AddOidcProviderSvc { - type Response = super::AddOidcProviderResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::AddTrustedEndpointsSvcAccountRequest, + > for AddTrustedEndpointsSvcAccountSvc { + type Response = super::AddTrustedEndpointsSvcAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::AddTrustedEndpointsSvcAccountRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::add_oidc_provider(&inner, request).await + ::add_trusted_endpoints_svc_account( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -13562,7 +10396,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = AddOidcProviderSvc(inner); + let method = AddTrustedEndpointsSvcAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13578,25 +10412,33 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/RemoveOidcProvider" => { + "/aruna.api.storage.services.v2.ServiceAccountService/RemoveTrustedEndpointsSvcAccount" => { #[allow(non_camel_case_types)] - struct RemoveOidcProviderSvc(pub Arc); + struct RemoveTrustedEndpointsSvcAccountSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for RemoveOidcProviderSvc { - type Response = super::RemoveOidcProviderResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::RemoveTrustedEndpointsSvcAccountRequest, + > for RemoveTrustedEndpointsSvcAccountSvc { + type Response = super::RemoveTrustedEndpointsSvcAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::RemoveTrustedEndpointsSvcAccountRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::remove_oidc_provider(&inner, request) + ::remove_trusted_endpoints_svc_account( + &inner, + request, + ) .await }; Box::pin(fut) @@ -13609,7 +10451,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = RemoveOidcProviderSvc(inner); + let method = RemoveTrustedEndpointsSvcAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13625,25 +10467,34 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/AddPubkeyUser" => { + "/aruna.api.storage.services.v2.ServiceAccountService/AddDataProxyAttributeSvcAccount" => { #[allow(non_camel_case_types)] - struct AddPubkeyUserSvc(pub Arc); + struct AddDataProxyAttributeSvcAccountSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for AddPubkeyUserSvc { - type Response = super::AddPubkeyUserResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::AddDataProxyAttributeSvcAccountRequest, + > for AddDataProxyAttributeSvcAccountSvc { + type Response = super::AddDataProxyAttributeSvcAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::AddDataProxyAttributeSvcAccountRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::add_pubkey_user(&inner, request).await + ::add_data_proxy_attribute_svc_account( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -13655,7 +10506,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = AddPubkeyUserSvc(inner); + let method = AddDataProxyAttributeSvcAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13671,14 +10522,19 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/AddTrustedEndpointsUser" => { + "/aruna.api.storage.services.v2.ServiceAccountService/RemoveDataProxyAttributeSvcAccount" => { #[allow(non_camel_case_types)] - struct AddTrustedEndpointsUserSvc(pub Arc); + struct RemoveDataProxyAttributeSvcAccountSvc< + T: ServiceAccountService, + >( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for AddTrustedEndpointsUserSvc { - type Response = super::AddTrustedEndpointsUserResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::RemoveDataProxyAttributeSvcAccountRequest, + > for RemoveDataProxyAttributeSvcAccountSvc { + type Response = super::RemoveDataProxyAttributeSvcAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -13686,12 +10542,12 @@ pub mod user_service_server { fn call( &mut self, request: tonic::Request< - super::AddTrustedEndpointsUserRequest, + super::RemoveDataProxyAttributeSvcAccountRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::add_trusted_endpoints_user( + ::remove_data_proxy_attribute_svc_account( &inner, request, ) @@ -13707,7 +10563,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = AddTrustedEndpointsUserSvc(inner); + let method = RemoveDataProxyAttributeSvcAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13723,32 +10579,462 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/RemoveTrustedEndpointsUser" => { + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for ServiceAccountServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService + for ServiceAccountServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.ServiceAccountService"; + } +} +/// CreateLicenseRequest +/// +/// Request object for CreateLicense +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateLicenseRequest { + /// CC-BY-SA-4.0 + #[prost(string, tag = "1")] + pub tag: ::prost::alloc::string::String, + /// Creative Commons Attribution-ShareAlike 4.0 International + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub text: ::prost::alloc::string::String, + /// url is optional + /// + /// + #[prost(string, tag = "4")] + pub url: ::prost::alloc::string::String, +} +/// CreateLicenseResponse +/// +/// Response object for CreateLicense +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateLicenseResponse { + /// CC-BY-SA-4.0 + #[prost(string, tag = "1")] + pub tag: ::prost::alloc::string::String, +} +/// GetLicenseRequest +/// +/// Request object for GetLicense +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetLicenseRequest { + /// 1234567890abcdef + #[prost(string, tag = "1")] + pub tag: ::prost::alloc::string::String, +} +/// GetLicenseResponse +/// +/// Response object for GetLicense +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetLicenseResponse { + #[prost(message, optional, tag = "1")] + pub license: ::core::option::Option, +} +/// ListLicensesRequest +/// +/// Request object for ListLicense +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListLicensesRequest {} +/// ListLicenseResponse +/// +/// Response object for ListLicense +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListLicensesResponse { + #[prost(message, repeated, tag = "1")] + pub licenses: ::prost::alloc::vec::Vec, +} +/// Generated client implementations. +pub mod license_service_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /// LicenseService + /// + /// Status: BETA + /// + /// Contains all methods to add, get or list (custom) licenses + #[derive(Debug, Clone)] + pub struct LicenseServiceClient { + inner: tonic::client::Grpc, + } + impl LicenseServiceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl LicenseServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> LicenseServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + LicenseServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// CreateLicense + /// + /// Status: BETA + /// + /// This creates a new license + pub async fn create_license( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.LicenseService/CreateLicense", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.LicenseService", + "CreateLicense", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetLicense + /// + /// Status: BETA + /// + /// This returns the license for a given tag + pub async fn get_license( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.LicenseService/GetLicense", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.LicenseService", + "GetLicense", + ), + ); + self.inner.unary(req, path, codec).await + } + /// ListLicenses + /// + /// Status: BETA + /// + /// This returns a list of all licenses + pub async fn list_licenses( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.LicenseService/ListLicenses", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.LicenseService", + "ListLicenses", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod license_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with LicenseServiceServer. + #[async_trait] + pub trait LicenseService: Send + Sync + 'static { + /// CreateLicense + /// + /// Status: BETA + /// + /// This creates a new license + async fn create_license( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetLicense + /// + /// Status: BETA + /// + /// This returns the license for a given tag + async fn get_license( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// ListLicenses + /// + /// Status: BETA + /// + /// This returns a list of all licenses + async fn list_licenses( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// LicenseService + /// + /// Status: BETA + /// + /// Contains all methods to add, get or list (custom) licenses + #[derive(Debug)] + pub struct LicenseServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl LicenseServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for LicenseServiceServer + where + T: LicenseService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/aruna.api.storage.services.v2.LicenseService/CreateLicense" => { #[allow(non_camel_case_types)] - struct RemoveTrustedEndpointsUserSvc(pub Arc); + struct CreateLicenseSvc(pub Arc); impl< - T: UserService, - > tonic::server::UnaryService< - super::RemoveTrustedEndpointsUserRequest, - > for RemoveTrustedEndpointsUserSvc { - type Response = super::RemoveTrustedEndpointsUserResponse; + T: LicenseService, + > tonic::server::UnaryService + for CreateLicenseSvc { + type Response = super::CreateLicenseResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::RemoveTrustedEndpointsUserRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::remove_trusted_endpoints_user( - &inner, - request, - ) - .await + ::create_license(&inner, request).await }; Box::pin(fut) } @@ -13760,7 +11046,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = RemoveTrustedEndpointsUserSvc(inner); + let method = CreateLicenseSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13776,32 +11062,25 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/AddDataProxyAttributeUser" => { + "/aruna.api.storage.services.v2.LicenseService/GetLicense" => { #[allow(non_camel_case_types)] - struct AddDataProxyAttributeUserSvc(pub Arc); + struct GetLicenseSvc(pub Arc); impl< - T: UserService, - > tonic::server::UnaryService< - super::AddDataProxyAttributeUserRequest, - > for AddDataProxyAttributeUserSvc { - type Response = super::AddDataProxyAttributeUserResponse; + T: LicenseService, + > tonic::server::UnaryService + for GetLicenseSvc { + type Response = super::GetLicenseResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::AddDataProxyAttributeUserRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::add_data_proxy_attribute_user( - &inner, - request, - ) - .await + ::get_license(&inner, request).await }; Box::pin(fut) } @@ -13813,7 +11092,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = AddDataProxyAttributeUserSvc(inner); + let method = GetLicenseSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13829,32 +11108,25 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/RemoveDataProxyAttributeUser" => { + "/aruna.api.storage.services.v2.LicenseService/ListLicenses" => { #[allow(non_camel_case_types)] - struct RemoveDataProxyAttributeUserSvc(pub Arc); + struct ListLicensesSvc(pub Arc); impl< - T: UserService, - > tonic::server::UnaryService< - super::RemoveDataProxyAttributeUserRequest, - > for RemoveDataProxyAttributeUserSvc { - type Response = super::RemoveDataProxyAttributeUserResponse; + T: LicenseService, + > tonic::server::UnaryService + for ListLicensesSvc { + type Response = super::ListLicensesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::RemoveDataProxyAttributeUserRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::remove_data_proxy_attribute_user( - &inner, - request, - ) - .await + ::list_licenses(&inner, request).await }; Box::pin(fut) } @@ -13866,7 +11138,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = RemoveDataProxyAttributeUserSvc(inner); + let method = ListLicensesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13897,7 +11169,7 @@ pub mod user_service_server { } } } - impl Clone for UserServiceServer { + impl Clone for LicenseServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -13909,7 +11181,7 @@ pub mod user_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -13919,335 +11191,1263 @@ pub mod user_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for UserServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.UserService"; + impl tonic::server::NamedService for LicenseServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.LicenseService"; } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateCollectionRequest { - /// collection name +pub struct RegisterUserRequest { + /// user_displayname + #[prost(string, tag = "1")] + pub display_name: ::prost::alloc::string::String, + /// Mail address (optional) + #[prost(string, tag = "2")] + pub email: ::prost::alloc::string::String, + /// Project hint description string (optional) + #[prost(string, tag = "3")] + pub project: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RegisterUserResponse { + /// Created user id + #[prost(string, tag = "1")] + pub user_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateApiTokenRequest { + /// Token name + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// Personal or resource specific + #[prost(message, optional, tag = "2")] + pub permission: ::core::option::Option, + /// Token expiry + #[prost(message, optional, tag = "3")] + pub expires_at: ::core::option::Option<::prost_wkt_types::Timestamp>, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateApiTokenResponse { + /// This contains only the token description + #[prost(message, optional, tag = "1")] + pub token: ::core::option::Option, + /// This is the actual secret token + /// Attention, this can not be recreated and needs to be stored securely + /// New tokens will always contain a new secret + #[prost(string, tag = "2")] + pub token_secret: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetApiTokenRequest { + /// The token id #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(string, tag = "9")] - pub title: ::prost::alloc::string::String, - /// description - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// collection specific labels / hooks - #[prost(message, repeated, tag = "3")] - pub key_values: ::prost::alloc::vec::Vec, - /// Internal /External relations (URLs / IDs from external sources) - #[prost(message, repeated, tag = "4")] - pub relations: ::prost::alloc::vec::Vec, - /// DataClass - #[prost(enumeration = "super::super::models::v2::DataClass", tag = "5")] - pub data_class: i32, - #[prost(string, optional, tag = "7")] - pub metadata_license_tag: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "8")] - pub default_data_license_tag: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "10")] - pub authors: ::prost::alloc::vec::Vec, - /// Parent_id MUST be project - #[prost(oneof = "create_collection_request::Parent", tags = "6")] - pub parent: ::core::option::Option, + pub token_id: ::prost::alloc::string::String, } -/// Nested message and enum types in `CreateCollectionRequest`. -pub mod create_collection_request { - /// Parent_id MUST be project - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Parent { - #[prost(string, tag = "6")] - ProjectId(::prost::alloc::string::String), - } +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetApiTokenResponse { + /// List of API tokens + #[prost(message, optional, tag = "1")] + pub token: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateCollectionResponse { - /// The new collection_id +pub struct GetApiTokensRequest {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetApiTokensResponse { + /// List of API tokens with redacted actual token + #[prost(message, repeated, tag = "1")] + pub tokens: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteApiTokenRequest { + /// The token_id + #[prost(string, tag = "1")] + pub token_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteApiTokenResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteApiTokensRequest { + /// This request invalidates all tokens of a specific user + /// usually the user_id is specified via the provided oidc or aruna token + /// This user_id can be used by admins to invalidate all tokens of a specific + /// user + #[prost(string, tag = "1")] + pub user_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteApiTokensResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetUserRequest { + /// Optional user_id + #[prost(string, tag = "1")] + pub user_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetUserResponse { + /// User info #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, + pub user: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetCollectionRequest { - /// Requested id +pub struct GetUserRedactedRequest { + /// Optional user_id #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, + pub user_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetCollectionResponse { - /// Overview of the requested collection +pub struct GetUserRedactedResponse { + /// User info #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, + pub user: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateUserDisplayNameRequest { + /// New display name + #[prost(string, tag = "1")] + pub new_display_name: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateUserDisplayNameResponse { + /// Updated user info + #[prost(message, optional, tag = "1")] + pub user: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ActivateUserRequest { + /// User to activate + #[prost(string, tag = "1")] + pub user_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ActivateUserResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetNotActivatedUsersRequest {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetNotActivatedUsersResponse { + /// List of users that are not yet activated + #[prost(message, repeated, tag = "1")] + pub users: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAllUsersRequest {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAllUsersResponse { + #[prost(message, repeated, tag = "1")] + pub user: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeactivateUserRequest { + /// User to activate + #[prost(string, tag = "1")] + pub user_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeactivateUserResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateUserEmailRequest { + #[prost(string, tag = "1")] + pub user_id: ::prost::alloc::string::String, + /// If new email is empty == unsubscribe + #[prost(string, tag = "2")] + pub new_email: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateUserEmailResponse { + #[prost(message, optional, tag = "1")] + pub user: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateS3CredentialsUserTokenRequest { + #[prost(string, tag = "1")] + pub endpoint_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateS3CredentialsUserTokenResponse { + #[prost(string, tag = "1")] + pub s3_access_key: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub s3_secret_key: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub s3_endpoint_url: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetS3CredentialsUserTokenRequest { + #[prost(string, tag = "1")] + pub endpoint_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetS3CredentialsUserTokenResponse { + #[prost(string, tag = "1")] + pub s3_access_key: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub s3_secret_key: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub s3_endpoint_url: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteS3CredentialsUserTokenRequest { + #[prost(string, tag = "1")] + pub endpoint_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteS3CredentialsUserResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetDataproxyTokenUserRequest { + #[prost(string, tag = "1")] + pub user_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub context: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetDataproxyTokenUserResponse { + #[prost(string, tag = "1")] + pub token: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetCollectionsRequest { - #[prost(string, repeated, tag = "1")] - pub collection_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} +pub struct GetPersonalNotificationsRequest {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetCollectionsResponse { - /// List of collection overviews +pub struct GetPersonalNotificationsResponse { #[prost(message, repeated, tag = "1")] - pub collections: ::prost::alloc::vec::Vec, + pub notifications: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteCollectionRequest { - #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, +pub struct AcknowledgePersonalNotificationsRequest { + #[prost(string, repeated, tag = "1")] + pub notification_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteCollectionResponse {} +pub struct AcknowledgePersonalNotificationsResponse {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionNameRequest { - #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, +pub struct Reference { + #[prost(enumeration = "ReferenceType", tag = "1")] + pub ref_type: i32, + /// "User A" | file.txt #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, + pub ref_name: ::prost::alloc::string::String, + /// 0123AAA123AAA (id) + #[prost(string, tag = "3")] + pub ref_value: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionNameResponse { - #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, +pub struct PersonalNotification { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + #[prost(enumeration = "PersonalNotificationVariant", tag = "2")] + pub variant: i32, + /// User A has requested access for resource B + #[prost(string, tag = "3")] + pub message: ::prost::alloc::string::String, + /// References to resource in the "message" + #[prost(message, repeated, tag = "4")] + pub refs: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionDescriptionRequest { +pub struct AddOidcProviderRequest { #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, + pub new_access_token: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionDescriptionResponse { +pub struct AddOidcProviderResponse { #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, + pub user: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionKeyValuesRequest { +pub struct RemoveOidcProviderRequest { #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub add_key_values: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub remove_key_values: ::prost::alloc::vec::Vec, + pub provider_url: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionKeyValuesResponse { +pub struct RemoveOidcProviderResponse { #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, + pub user: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionDataClassRequest { +pub struct AddPubkeyUserRequest { #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::DataClass", tag = "2")] - pub data_class: i32, + pub public_key: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionDataClassResponse { +pub struct AddPubkeyUserResponse { #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, + pub user: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotCollectionRequest { +pub struct AddTrustedEndpointsUserRequest { #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, + pub endpoint_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotCollectionResponse { - /// This collection will be returned via an Persistent Identifier! Updates will be impossible +pub struct AddTrustedEndpointsUserResponse { + /// Here would be the place to add conditions + /// why the request was denied #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, + pub user: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionLicensesRequest { +pub struct RemoveTrustedEndpointsUserRequest { #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub metadata_license_tag: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub default_data_license_tag: ::prost::alloc::string::String, + pub endpoint_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionLicensesResponse { +pub struct RemoveTrustedEndpointsUserResponse { #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, + pub user: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionTitleRequest { +pub struct AddDataProxyAttributeUserRequest { #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub title: ::prost::alloc::string::String, + pub user_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub attribute: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionTitleResponse { - #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, -} +pub struct AddDataProxyAttributeUserResponse {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionAuthorsRequest { +pub struct RemoveDataProxyAttributeUserRequest { #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub add_authors: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub remove_authors: ::prost::alloc::vec::Vec, + pub user_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub dataproxy_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub attribute_name: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionAuthorsResponse { - #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, +pub struct RemoveDataProxyAttributeUserResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ReferenceType { + Unspecified = 0, + User = 1, + Resource = 2, +} +impl ReferenceType { + /// 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 { + ReferenceType::Unspecified => "REFERENCE_TYPE_UNSPECIFIED", + ReferenceType::User => "REFERENCE_TYPE_USER", + ReferenceType::Resource => "REFERENCE_TYPE_RESOURCE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "REFERENCE_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "REFERENCE_TYPE_USER" => Some(Self::User), + "REFERENCE_TYPE_RESOURCE" => Some(Self::Resource), + _ => None, + } + } +} +#[derive(serde::Deserialize, serde::Serialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum PersonalNotificationVariant { + Unspecified = 0, + AccessRequested = 1, + PermissionGranted = 2, + PermissionRevoked = 3, + PermissionUpdated = 4, + Announcement = 5, +} +impl PersonalNotificationVariant { + /// 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 { + PersonalNotificationVariant::Unspecified => { + "PERSONAL_NOTIFICATION_VARIANT_UNSPECIFIED" + } + PersonalNotificationVariant::AccessRequested => { + "PERSONAL_NOTIFICATION_VARIANT_ACCESS_REQUESTED" + } + PersonalNotificationVariant::PermissionGranted => { + "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_GRANTED" + } + PersonalNotificationVariant::PermissionRevoked => { + "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_REVOKED" + } + PersonalNotificationVariant::PermissionUpdated => { + "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_UPDATED" + } + PersonalNotificationVariant::Announcement => { + "PERSONAL_NOTIFICATION_VARIANT_ANNOUNCEMENT" + } + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PERSONAL_NOTIFICATION_VARIANT_UNSPECIFIED" => Some(Self::Unspecified), + "PERSONAL_NOTIFICATION_VARIANT_ACCESS_REQUESTED" => { + Some(Self::AccessRequested) + } + "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_GRANTED" => { + Some(Self::PermissionGranted) + } + "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_REVOKED" => { + Some(Self::PermissionRevoked) + } + "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_UPDATED" => { + Some(Self::PermissionUpdated) + } + "PERSONAL_NOTIFICATION_VARIANT_ANNOUNCEMENT" => Some(Self::Announcement), + _ => None, + } + } } /// Generated client implementations. -pub mod collection_service_client { +pub mod user_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// CollectionService + /// UserService /// /// Status: BETA /// - /// Contains all methods that get/create or update Collection and associated resources + /// Contains all CRUD methods for users and associated resource #[derive(Debug, Clone)] - pub struct CollectionServiceClient { + pub struct UserServiceClient { inner: tonic::client::Grpc, } - impl CollectionServiceClient { + impl UserServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where D: TryInto, D::Error: Into, { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl UserServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> UserServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + UserServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// RegisterUser + /// + /// Status: BETA + /// + /// This request should be called when a new user logs in for the first time + pub async fn register_user( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/RegisterUser", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "RegisterUser", + ), + ); + self.inner.unary(req, path, codec).await + } + /// DeActivateUser + /// + /// Status: BETA + /// + /// This deactivates a specific user (Admin request) + pub async fn deactivate_user( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/DeactivateUser", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "DeactivateUser", + ), + ); + self.inner.unary(req, path, codec).await + } + /// ActivateUser + /// + /// Status: BETA + /// + /// This activates a specific user (Admin request) + pub async fn activate_user( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/ActivateUser", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "ActivateUser", + ), + ); + self.inner.unary(req, path, codec).await + } + /// CreateAPIToken + /// + /// Status: BETA + /// + /// Creates an API token to authenticate + pub async fn create_api_token( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/CreateAPIToken", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "CreateAPIToken", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetAPIToken + /// + /// Status: BETA + /// + /// Returns one API token by id + pub async fn get_api_token( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/GetAPIToken", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "GetAPIToken", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetAPITokens + /// + /// Status: STABLE + /// + /// Returns a list of API tokens for a specific user + pub async fn get_api_tokens( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/GetAPITokens", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "GetAPITokens", + ), + ); + self.inner.unary(req, path, codec).await + } + /// DeleteAPIToken + /// + /// Status: STABLE + /// + /// Deletes the specified API Token + pub async fn delete_api_token( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/DeleteAPIToken", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "DeleteAPIToken", + ), + ); + self.inner.unary(req, path, codec).await } - } - impl CollectionServiceClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } + /// DeleteAPITokens + /// + /// Status: BETA + /// + /// Deletes the specified API Token + pub async fn delete_api_tokens( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/DeleteAPITokens", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "DeleteAPITokens", + ), + ); + self.inner.unary(req, path, codec).await } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } + /// GetUserRequest + /// + /// Status: STABLE + /// + /// This is a request that returns the user information of the + /// current user or if invoked by an admin from another user + pub async fn get_user( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/GetUser", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "GetUser", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetUserRequestRedacted + /// + /// Status: STABLE + /// + /// This is a request that returns the user information of the + /// current user or if invoked by an admin from another user + /// Redacts personal information like name or email + pub async fn get_user_redacted( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/GetUserRedacted", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "GetUserRedacted", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateUserDisplayName + /// + /// Status: STABLE + /// + /// Updates the Displayname for the user (Personal only) + pub async fn update_user_display_name( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/UpdateUserDisplayName", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "UpdateUserDisplayName", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateUserDisplayName + /// + /// Status: ALPHA + /// + /// Updates the email for the user (Personal only) + pub async fn update_user_email( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/UpdateUserEmail", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "UpdateUserEmail", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetNotActivatedUsers + /// + /// Status: STABLE + /// + /// Get all not activated users (Admin only) + pub async fn get_not_activated_users( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/GetNotActivatedUsers", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "GetNotActivatedUsers", + ), + ); + self.inner.unary(req, path, codec).await } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> CollectionServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - CollectionServiceClient::new(InterceptedService::new(inner, interceptor)) + /// GetAllUsers + /// + /// Status: ALPHA + /// + /// Get all users including permissions (Admin only) + pub async fn get_all_users( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/GetAllUsers", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "GetAllUsers", + ), + ); + self.inner.unary(req, path, codec).await } - /// Compress requests with the given encoding. + /// CreateS3CredentialsUserToken /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self + /// Status: ALPHA + /// + /// Creates or updates S3 credentials for a specific user and data_proxy + pub async fn create_s3_credentials_user_token( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/CreateS3CredentialsUserToken", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "CreateS3CredentialsUserToken", + ), + ); + self.inner.unary(req, path, codec).await } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self + /// GetS3CredentialsUserToken + /// + /// Status: ALPHA + /// + /// Gets S3 credentials for a specific token and data_proxy + pub async fn get_s3_credentials_user_token( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/GetS3CredentialsUserToken", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "GetS3CredentialsUserToken", + ), + ); + self.inner.unary(req, path, codec).await } - /// Limits the maximum size of a decoded message. + /// DeleteS3CredentialsUserToken /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self + /// Status: ALPHA + /// + /// Revokes existing S3 credentials for a specific user and data_proxy + pub async fn delete_s3_credentials_user_token( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/DeleteS3CredentialsUserToken", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "DeleteS3CredentialsUserToken", + ), + ); + self.inner.unary(req, path, codec).await } - /// Limits the maximum size of an encoded message. + /// GetDataproxyToken /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self + /// Status: ALPHA + /// + /// Gets token for a specific user and data_proxy + pub async fn get_dataproxy_token_user( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/GetDataproxyTokenUser", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "GetDataproxyTokenUser", + ), + ); + self.inner.unary(req, path, codec).await } - /// CreateNewCollection + /// GetPersonalNotifications /// - /// Status: BETA + /// Status: ALPHA /// - /// creates a new Collection - pub async fn create_collection( + /// Fetches personal notifications + pub async fn get_personal_notifications( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -14261,28 +12461,30 @@ pub mod collection_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/CreateCollection", + "/aruna.api.storage.services.v2.UserService/GetPersonalNotifications", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "CreateCollection", + "aruna.api.storage.services.v2.UserService", + "GetPersonalNotifications", ), ); self.inner.unary(req, path, codec).await } - /// GetCollection + /// AcknowledgePersonalNotifications /// - /// Status: BETA + /// Status: ALPHA /// - /// Request a specific collection by ID - pub async fn get_collection( + /// Acknowledges personal notifications + pub async fn acknowledge_personal_notifications( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest< + super::AcknowledgePersonalNotificationsRequest, + >, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -14296,28 +12498,28 @@ pub mod collection_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/GetCollection", + "/aruna.api.storage.services.v2.UserService/AcknowledgePersonalNotifications", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "GetCollection", + "aruna.api.storage.services.v2.UserService", + "AcknowledgePersonalNotifications", ), ); self.inner.unary(req, path, codec).await } - /// GetCollections + /// AddOidcProvider /// /// Status: BETA /// - /// Queries multiple collections by ID - pub async fn get_collections( + /// Add alternative oidc login method for user + pub async fn add_oidc_provider( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -14331,28 +12533,29 @@ pub mod collection_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/GetCollections", + "/aruna.api.storage.services.v2.UserService/AddOidcProvider", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "GetCollections", + "aruna.api.storage.services.v2.UserService", + "AddOidcProvider", ), ); self.inner.unary(req, path, codec).await } - /// DeleteCollection + /// RemoveOidcProvider /// - /// Status: STABLE + /// Status: BETA /// - /// This request deletes the collection. - pub async fn delete_collection( + /// Remove alternative oidc login method from user + /// (Only works if user has more than one oidc provider) + pub async fn remove_oidc_provider( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -14366,28 +12569,28 @@ pub mod collection_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/DeleteCollection", + "/aruna.api.storage.services.v2.UserService/RemoveOidcProvider", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "DeleteCollection", + "aruna.api.storage.services.v2.UserService", + "RemoveOidcProvider", ), ); self.inner.unary(req, path, codec).await } - /// UpdateCollectionName + /// AddPubkeyUser /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the collection name. Caveat! Will rename the "s3 bucket" for data proxies! - pub async fn update_collection_name( + /// Adds an ED25519 public key for the user + pub async fn add_pubkey_user( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -14401,28 +12604,28 @@ pub mod collection_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionName", + "/aruna.api.storage.services.v2.UserService/AddPubkeyUser", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "UpdateCollectionName", + "aruna.api.storage.services.v2.UserService", + "AddPubkeyUser", ), ); self.inner.unary(req, path, codec).await } - /// UpdateCollectionDescription + /// AddTrustedEndpointsUser /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the collection description. - pub async fn update_collection_description( + /// Adds an endpoint to the trusted endpoints list of the user + pub async fn add_trusted_endpoints_user( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -14436,28 +12639,28 @@ pub mod collection_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionDescription", + "/aruna.api.storage.services.v2.UserService/AddTrustedEndpointsUser", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "UpdateCollectionDescription", + "aruna.api.storage.services.v2.UserService", + "AddTrustedEndpointsUser", ), ); self.inner.unary(req, path, codec).await } - /// UpdateCollectionKeyValues + /// RemoveTrustedEndpointsUser /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the collection key values. - pub async fn update_collection_key_values( + /// Removes an endpoint from the trusted endpoints list of the user + pub async fn remove_trusted_endpoints_user( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -14471,28 +12674,28 @@ pub mod collection_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionKeyValues", + "/aruna.api.storage.services.v2.UserService/RemoveTrustedEndpointsUser", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "UpdateCollectionKeyValues", + "aruna.api.storage.services.v2.UserService", + "RemoveTrustedEndpointsUser", ), ); self.inner.unary(req, path, codec).await } - /// UpdateCollectionDataClass + /// AddDataProxyAttributeUser /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the collection name. All (meta) data will be overwritten. - pub async fn update_collection_data_class( + /// Adds an data proxy specific attribute to the user + pub async fn add_data_proxy_attribute_user( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -14506,28 +12709,28 @@ pub mod collection_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionDataClass", + "/aruna.api.storage.services.v2.UserService/AddDataProxyAttributeUser", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "UpdateCollectionDataClass", + "aruna.api.storage.services.v2.UserService", + "AddDataProxyAttributeUser", ), ); self.inner.unary(req, path, codec).await } - /// SnapshotCollectionRequest + /// RemoveDataProxyAttributeUser /// - /// Status: BETA + /// Status: ALPHA /// - /// Archives the full collection, rendering all downstream relations immutable - pub async fn snapshot_collection( + /// Removes an data proxy specific attribute from the user + pub async fn remove_data_proxy_attribute_user( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -14541,284 +12744,360 @@ pub mod collection_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/SnapshotCollection", + "/aruna.api.storage.services.v2.UserService/RemoveDataProxyAttributeUser", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "SnapshotCollection", + "aruna.api.storage.services.v2.UserService", + "RemoveDataProxyAttributeUser", ), ); self.inner.unary(req, path, codec).await } - /// UpdateLicenses + } +} +/// Generated server implementations. +pub mod user_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with UserServiceServer. + #[async_trait] + pub trait UserService: Send + Sync + 'static { + /// RegisterUser + /// + /// Status: BETA + /// + /// This request should be called when a new user logs in for the first time + async fn register_user( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeActivateUser + /// + /// Status: BETA + /// + /// This deactivates a specific user (Admin request) + async fn deactivate_user( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// ActivateUser + /// + /// Status: BETA + /// + /// This activates a specific user (Admin request) + async fn activate_user( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// CreateAPIToken + /// + /// Status: BETA + /// + /// Creates an API token to authenticate + async fn create_api_token( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetAPIToken + /// + /// Status: BETA + /// + /// Returns one API token by id + async fn get_api_token( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetAPITokens + /// + /// Status: STABLE + /// + /// Returns a list of API tokens for a specific user + async fn get_api_tokens( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteAPIToken + /// + /// Status: STABLE + /// + /// Deletes the specified API Token + async fn delete_api_token( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteAPITokens + /// + /// Status: BETA + /// + /// Deletes the specified API Token + async fn delete_api_tokens( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetUserRequest + /// + /// Status: STABLE + /// + /// This is a request that returns the user information of the + /// current user or if invoked by an admin from another user + async fn get_user( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// GetUserRequestRedacted + /// + /// Status: STABLE + /// + /// This is a request that returns the user information of the + /// current user or if invoked by an admin from another user + /// Redacts personal information like name or email + async fn get_user_redacted( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateUserDisplayName + /// + /// Status: STABLE + /// + /// Updates the Displayname for the user (Personal only) + async fn update_user_display_name( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateUserDisplayName /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the collections metadata license and/or default data license. - pub async fn update_collection_licenses( - &mut self, - request: impl tonic::IntoRequest, + /// Updates the email for the user (Personal only) + async fn update_user_email( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionLicenses", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "UpdateCollectionLicenses", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateTitle + >; + /// GetNotActivatedUsers + /// + /// Status: STABLE + /// + /// Get all not activated users (Admin only) + async fn get_not_activated_users( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetAllUsers /// /// Status: ALPHA /// - /// Updates the collections metadata title. - pub async fn update_collection_title( - &mut self, - request: impl tonic::IntoRequest, + /// Get all users including permissions (Admin only) + async fn get_all_users( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionTitle", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "UpdateCollectionTitle", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateAuthors + >; + /// CreateS3CredentialsUserToken /// /// Status: ALPHA /// - /// Updates the collections metadata title. - pub async fn update_collection_authors( - &mut self, - request: impl tonic::IntoRequest, + /// Creates or updates S3 credentials for a specific user and data_proxy + async fn create_s3_credentials_user_token( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionAuthors", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "UpdateCollectionAuthors", - ), - ); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod collection_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with CollectionServiceServer. - #[async_trait] - pub trait CollectionService: Send + Sync + 'static { - /// CreateNewCollection + >; + /// GetS3CredentialsUserToken /// - /// Status: BETA + /// Status: ALPHA /// - /// creates a new Collection - async fn create_collection( + /// Gets S3 credentials for a specific token and data_proxy + async fn get_s3_credentials_user_token( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetCollection + /// DeleteS3CredentialsUserToken /// - /// Status: BETA + /// Status: ALPHA /// - /// Request a specific collection by ID - async fn get_collection( + /// Revokes existing S3 credentials for a specific user and data_proxy + async fn delete_s3_credentials_user_token( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetCollections + /// GetDataproxyToken /// - /// Status: BETA + /// Status: ALPHA /// - /// Queries multiple collections by ID - async fn get_collections( + /// Gets token for a specific user and data_proxy + async fn get_dataproxy_token_user( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// DeleteCollection + /// GetPersonalNotifications /// - /// Status: STABLE + /// Status: ALPHA /// - /// This request deletes the collection. - async fn delete_collection( + /// Fetches personal notifications + async fn get_personal_notifications( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateCollectionName + /// AcknowledgePersonalNotifications /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the collection name. Caveat! Will rename the "s3 bucket" for data proxies! - async fn update_collection_name( + /// Acknowledges personal notifications + async fn acknowledge_personal_notifications( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateCollectionDescription + /// AddOidcProvider /// /// Status: BETA /// - /// Updates the collection description. - async fn update_collection_description( + /// Add alternative oidc login method for user + async fn add_oidc_provider( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateCollectionKeyValues + /// RemoveOidcProvider /// /// Status: BETA /// - /// Updates the collection key values. - async fn update_collection_key_values( + /// Remove alternative oidc login method from user + /// (Only works if user has more than one oidc provider) + async fn remove_oidc_provider( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateCollectionDataClass + /// AddPubkeyUser /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the collection name. All (meta) data will be overwritten. - async fn update_collection_data_class( + /// Adds an ED25519 public key for the user + async fn add_pubkey_user( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// SnapshotCollectionRequest + /// AddTrustedEndpointsUser /// - /// Status: BETA + /// Status: ALPHA /// - /// Archives the full collection, rendering all downstream relations immutable - async fn snapshot_collection( + /// Adds an endpoint to the trusted endpoints list of the user + async fn add_trusted_endpoints_user( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateLicenses + /// RemoveTrustedEndpointsUser /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the collections metadata license and/or default data license. - async fn update_collection_licenses( + /// Removes an endpoint from the trusted endpoints list of the user + async fn remove_trusted_endpoints_user( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateTitle + /// AddDataProxyAttributeUser /// /// Status: ALPHA /// - /// Updates the collections metadata title. - async fn update_collection_title( + /// Adds an data proxy specific attribute to the user + async fn add_data_proxy_attribute_user( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateAuthors + /// RemoveDataProxyAttributeUser /// /// Status: ALPHA /// - /// Updates the collections metadata title. - async fn update_collection_authors( + /// Removes an data proxy specific attribute from the user + async fn remove_data_proxy_attribute_user( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// CollectionService + /// UserService /// /// Status: BETA /// - /// Contains all methods that get/create or update Collection and associated resources + /// Contains all CRUD methods for users and associated resource #[derive(Debug)] - pub struct CollectionServiceServer { + pub struct UserServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -14826,7 +13105,7 @@ pub mod collection_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl CollectionServiceServer { + impl UserServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -14878,9 +13157,9 @@ pub mod collection_service_server { self } } - impl tonic::codegen::Service> for CollectionServiceServer + impl tonic::codegen::Service> for UserServiceServer where - T: CollectionService, + T: UserService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -14896,25 +13175,581 @@ pub mod collection_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.CollectionService/CreateCollection" => { + "/aruna.api.storage.services.v2.UserService/RegisterUser" => { + #[allow(non_camel_case_types)] + struct RegisterUserSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for RegisterUserSvc { + type Response = super::RegisterUserResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::register_user(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RegisterUserSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/DeactivateUser" => { + #[allow(non_camel_case_types)] + struct DeactivateUserSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for DeactivateUserSvc { + type Response = super::DeactivateUserResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::deactivate_user(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeactivateUserSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/ActivateUser" => { + #[allow(non_camel_case_types)] + struct ActivateUserSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for ActivateUserSvc { + type Response = super::ActivateUserResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::activate_user(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ActivateUserSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/CreateAPIToken" => { + #[allow(non_camel_case_types)] + struct CreateAPITokenSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for CreateAPITokenSvc { + type Response = super::CreateApiTokenResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::create_api_token(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateAPITokenSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/GetAPIToken" => { + #[allow(non_camel_case_types)] + struct GetAPITokenSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for GetAPITokenSvc { + type Response = super::GetApiTokenResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_api_token(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetAPITokenSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/GetAPITokens" => { + #[allow(non_camel_case_types)] + struct GetAPITokensSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for GetAPITokensSvc { + type Response = super::GetApiTokensResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_api_tokens(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetAPITokensSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/DeleteAPIToken" => { + #[allow(non_camel_case_types)] + struct DeleteAPITokenSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for DeleteAPITokenSvc { + type Response = super::DeleteApiTokenResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_api_token(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteAPITokenSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/DeleteAPITokens" => { + #[allow(non_camel_case_types)] + struct DeleteAPITokensSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for DeleteAPITokensSvc { + type Response = super::DeleteApiTokensResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_api_tokens(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteAPITokensSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/GetUser" => { + #[allow(non_camel_case_types)] + struct GetUserSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for GetUserSvc { + type Response = super::GetUserResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_user(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetUserSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/GetUserRedacted" => { + #[allow(non_camel_case_types)] + struct GetUserRedactedSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for GetUserRedactedSvc { + type Response = super::GetUserRedactedResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_user_redacted(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetUserRedactedSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/UpdateUserDisplayName" => { + #[allow(non_camel_case_types)] + struct UpdateUserDisplayNameSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for UpdateUserDisplayNameSvc { + type Response = super::UpdateUserDisplayNameResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_user_display_name( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateUserDisplayNameSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/UpdateUserEmail" => { #[allow(non_camel_case_types)] - struct CreateCollectionSvc(pub Arc); + struct UpdateUserEmailSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService - for CreateCollectionSvc { - type Response = super::CreateCollectionResponse; + T: UserService, + > tonic::server::UnaryService + for UpdateUserEmailSvc { + type Response = super::UpdateUserEmailResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_collection(&inner, request) + ::update_user_email(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateUserEmailSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/GetNotActivatedUsers" => { + #[allow(non_camel_case_types)] + struct GetNotActivatedUsersSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for GetNotActivatedUsersSvc { + type Response = super::GetNotActivatedUsersResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_not_activated_users(&inner, request) .await }; Box::pin(fut) @@ -14927,7 +13762,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateCollectionSvc(inner); + let method = GetNotActivatedUsersSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -14943,25 +13778,183 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/GetCollection" => { + "/aruna.api.storage.services.v2.UserService/GetAllUsers" => { #[allow(non_camel_case_types)] - struct GetCollectionSvc(pub Arc); + struct GetAllUsersSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService - for GetCollectionSvc { - type Response = super::GetCollectionResponse; + T: UserService, + > tonic::server::UnaryService + for GetAllUsersSvc { + type Response = super::GetAllUsersResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_all_users(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetAllUsersSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/CreateS3CredentialsUserToken" => { + #[allow(non_camel_case_types)] + struct CreateS3CredentialsUserTokenSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService< + super::CreateS3CredentialsUserTokenRequest, + > for CreateS3CredentialsUserTokenSvc { + type Response = super::CreateS3CredentialsUserTokenResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::CreateS3CredentialsUserTokenRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::create_s3_credentials_user_token( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateS3CredentialsUserTokenSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/GetS3CredentialsUserToken" => { + #[allow(non_camel_case_types)] + struct GetS3CredentialsUserTokenSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService< + super::GetS3CredentialsUserTokenRequest, + > for GetS3CredentialsUserTokenSvc { + type Response = super::GetS3CredentialsUserTokenResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::GetS3CredentialsUserTokenRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_s3_credentials_user_token( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetS3CredentialsUserTokenSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/DeleteS3CredentialsUserToken" => { + #[allow(non_camel_case_types)] + struct DeleteS3CredentialsUserTokenSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService< + super::DeleteS3CredentialsUserTokenRequest, + > for DeleteS3CredentialsUserTokenSvc { + type Response = super::DeleteS3CredentialsUserResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::DeleteS3CredentialsUserTokenRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_collection(&inner, request) + ::delete_s3_credentials_user_token( + &inner, + request, + ) .await }; Box::pin(fut) @@ -14974,7 +13967,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetCollectionSvc(inner); + let method = DeleteS3CredentialsUserTokenSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -14990,25 +13983,28 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/GetCollections" => { + "/aruna.api.storage.services.v2.UserService/GetDataproxyTokenUser" => { #[allow(non_camel_case_types)] - struct GetCollectionsSvc(pub Arc); + struct GetDataproxyTokenUserSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService - for GetCollectionsSvc { - type Response = super::GetCollectionsResponse; + T: UserService, + > tonic::server::UnaryService + for GetDataproxyTokenUserSvc { + type Response = super::GetDataproxyTokenUserResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_collections(&inner, request) + ::get_dataproxy_token_user( + &inner, + request, + ) .await }; Box::pin(fut) @@ -15021,7 +14017,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetCollectionsSvc(inner); + let method = GetDataproxyTokenUserSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15037,25 +14033,30 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/DeleteCollection" => { + "/aruna.api.storage.services.v2.UserService/GetPersonalNotifications" => { #[allow(non_camel_case_types)] - struct DeleteCollectionSvc(pub Arc); + struct GetPersonalNotificationsSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService - for DeleteCollectionSvc { - type Response = super::DeleteCollectionResponse; + T: UserService, + > tonic::server::UnaryService + for GetPersonalNotificationsSvc { + type Response = super::GetPersonalNotificationsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::GetPersonalNotificationsRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_collection(&inner, request) + ::get_personal_notifications( + &inner, + request, + ) .await }; Box::pin(fut) @@ -15068,7 +14069,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteCollectionSvc(inner); + let method = GetPersonalNotificationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15084,25 +14085,30 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionName" => { + "/aruna.api.storage.services.v2.UserService/AcknowledgePersonalNotifications" => { #[allow(non_camel_case_types)] - struct UpdateCollectionNameSvc(pub Arc); + struct AcknowledgePersonalNotificationsSvc( + pub Arc, + ); impl< - T: CollectionService, - > tonic::server::UnaryService - for UpdateCollectionNameSvc { - type Response = super::UpdateCollectionNameResponse; + T: UserService, + > tonic::server::UnaryService< + super::AcknowledgePersonalNotificationsRequest, + > for AcknowledgePersonalNotificationsSvc { + type Response = super::AcknowledgePersonalNotificationsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::AcknowledgePersonalNotificationsRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_collection_name( + ::acknowledge_personal_notifications( &inner, request, ) @@ -15118,7 +14124,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateCollectionNameSvc(inner); + let method = AcknowledgePersonalNotificationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15134,34 +14140,25 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionDescription" => { + "/aruna.api.storage.services.v2.UserService/AddOidcProvider" => { #[allow(non_camel_case_types)] - struct UpdateCollectionDescriptionSvc( - pub Arc, - ); + struct AddOidcProviderSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService< - super::UpdateCollectionDescriptionRequest, - > for UpdateCollectionDescriptionSvc { - type Response = super::UpdateCollectionDescriptionResponse; + T: UserService, + > tonic::server::UnaryService + for AddOidcProviderSvc { + type Response = super::AddOidcProviderResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::UpdateCollectionDescriptionRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_collection_description( - &inner, - request, - ) - .await + ::add_oidc_provider(&inner, request).await }; Box::pin(fut) } @@ -15173,7 +14170,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateCollectionDescriptionSvc(inner); + let method = AddOidcProviderSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15189,33 +14186,25 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionKeyValues" => { + "/aruna.api.storage.services.v2.UserService/RemoveOidcProvider" => { #[allow(non_camel_case_types)] - struct UpdateCollectionKeyValuesSvc( - pub Arc, - ); + struct RemoveOidcProviderSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService< - super::UpdateCollectionKeyValuesRequest, - > for UpdateCollectionKeyValuesSvc { - type Response = super::UpdateCollectionKeyValuesResponse; + T: UserService, + > tonic::server::UnaryService + for RemoveOidcProviderSvc { + type Response = super::RemoveOidcProviderResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::UpdateCollectionKeyValuesRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_collection_key_values( - &inner, - request, - ) + ::remove_oidc_provider(&inner, request) .await }; Box::pin(fut) @@ -15228,7 +14217,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateCollectionKeyValuesSvc(inner); + let method = RemoveOidcProviderSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15244,34 +14233,25 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionDataClass" => { + "/aruna.api.storage.services.v2.UserService/AddPubkeyUser" => { #[allow(non_camel_case_types)] - struct UpdateCollectionDataClassSvc( - pub Arc, - ); + struct AddPubkeyUserSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService< - super::UpdateCollectionDataClassRequest, - > for UpdateCollectionDataClassSvc { - type Response = super::UpdateCollectionDataClassResponse; + T: UserService, + > tonic::server::UnaryService + for AddPubkeyUserSvc { + type Response = super::AddPubkeyUserResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::UpdateCollectionDataClassRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_collection_data_class( - &inner, - request, - ) - .await + ::add_pubkey_user(&inner, request).await }; Box::pin(fut) } @@ -15283,7 +14263,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateCollectionDataClassSvc(inner); + let method = AddPubkeyUserSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15299,25 +14279,27 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/SnapshotCollection" => { + "/aruna.api.storage.services.v2.UserService/AddTrustedEndpointsUser" => { #[allow(non_camel_case_types)] - struct SnapshotCollectionSvc(pub Arc); + struct AddTrustedEndpointsUserSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService - for SnapshotCollectionSvc { - type Response = super::SnapshotCollectionResponse; + T: UserService, + > tonic::server::UnaryService + for AddTrustedEndpointsUserSvc { + type Response = super::AddTrustedEndpointsUserResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::AddTrustedEndpointsUserRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::snapshot_collection( + ::add_trusted_endpoints_user( &inner, request, ) @@ -15333,7 +14315,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = SnapshotCollectionSvc(inner); + let method = AddTrustedEndpointsUserSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15349,14 +14331,15 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionLicenses" => { + "/aruna.api.storage.services.v2.UserService/RemoveTrustedEndpointsUser" => { #[allow(non_camel_case_types)] - struct UpdateCollectionLicensesSvc(pub Arc); + struct RemoveTrustedEndpointsUserSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService - for UpdateCollectionLicensesSvc { - type Response = super::UpdateCollectionLicensesResponse; + T: UserService, + > tonic::server::UnaryService< + super::RemoveTrustedEndpointsUserRequest, + > for RemoveTrustedEndpointsUserSvc { + type Response = super::RemoveTrustedEndpointsUserResponse; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -15364,12 +14347,12 @@ pub mod collection_service_server { fn call( &mut self, request: tonic::Request< - super::UpdateCollectionLicensesRequest, + super::RemoveTrustedEndpointsUserRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_collection_licenses( + ::remove_trusted_endpoints_user( &inner, request, ) @@ -15385,7 +14368,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateCollectionLicensesSvc(inner); + let method = RemoveTrustedEndpointsUserSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15401,25 +14384,28 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionTitle" => { + "/aruna.api.storage.services.v2.UserService/AddDataProxyAttributeUser" => { #[allow(non_camel_case_types)] - struct UpdateCollectionTitleSvc(pub Arc); + struct AddDataProxyAttributeUserSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService - for UpdateCollectionTitleSvc { - type Response = super::UpdateCollectionTitleResponse; + T: UserService, + > tonic::server::UnaryService< + super::AddDataProxyAttributeUserRequest, + > for AddDataProxyAttributeUserSvc { + type Response = super::AddDataProxyAttributeUserResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::AddDataProxyAttributeUserRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_collection_title( + ::add_data_proxy_attribute_user( &inner, request, ) @@ -15435,7 +14421,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateCollectionTitleSvc(inner); + let method = AddDataProxyAttributeUserSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15451,14 +14437,15 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionAuthors" => { + "/aruna.api.storage.services.v2.UserService/RemoveDataProxyAttributeUser" => { #[allow(non_camel_case_types)] - struct UpdateCollectionAuthorsSvc(pub Arc); + struct RemoveDataProxyAttributeUserSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService - for UpdateCollectionAuthorsSvc { - type Response = super::UpdateCollectionAuthorsResponse; + T: UserService, + > tonic::server::UnaryService< + super::RemoveDataProxyAttributeUserRequest, + > for RemoveDataProxyAttributeUserSvc { + type Response = super::RemoveDataProxyAttributeUserResponse; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -15466,12 +14453,12 @@ pub mod collection_service_server { fn call( &mut self, request: tonic::Request< - super::UpdateCollectionAuthorsRequest, + super::RemoveDataProxyAttributeUserRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_collection_authors( + ::remove_data_proxy_attribute_user( &inner, request, ) @@ -15487,7 +14474,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateCollectionAuthorsSvc(inner); + let method = RemoveDataProxyAttributeUserSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15518,7 +14505,7 @@ pub mod collection_service_server { } } } - impl Clone for CollectionServiceServer { + impl Clone for UserServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -15530,150 +14517,413 @@ pub mod collection_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for UserServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.UserService"; + } +} +/// Models +/// These are the models for the above described requests and responses. +/// gRPC best practises advice each Request and Response message in a RPC to be +/// called {rpc_name}Request and {rpc_name}Response. +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateObjectRequest { + /// collection name + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// title + #[prost(string, tag = "12")] + pub title: ::prost::alloc::string::String, + /// description + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// collection specific labels / hooks + #[prost(message, repeated, tag = "3")] + pub key_values: ::prost::alloc::vec::Vec, + /// Internal / External relations (URLs / IDs from external sources) + #[prost(message, repeated, tag = "4")] + pub relations: ::prost::alloc::vec::Vec, + /// DataClass + #[prost(enumeration = "super::super::models::v2::DataClass", tag = "5")] + pub data_class: i32, + #[prost(message, repeated, tag = "9")] + pub hashes: ::prost::alloc::vec::Vec, + #[prost(string, tag = "10")] + pub metadata_license_tag: ::prost::alloc::string::String, + #[prost(string, tag = "11")] + pub data_license_tag: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "13")] + pub authors: ::prost::alloc::vec::Vec, + /// Parent can be one of all other resources + #[prost(oneof = "create_object_request::Parent", tags = "6, 7, 8")] + pub parent: ::core::option::Option, +} +/// Nested message and enum types in `CreateObjectRequest`. +pub mod create_object_request { + /// Parent can be one of all other resources + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Parent { + #[prost(string, tag = "6")] + ProjectId(::prost::alloc::string::String), + #[prost(string, tag = "7")] + CollectionId(::prost::alloc::string::String), + #[prost(string, tag = "8")] + DatasetId(::prost::alloc::string::String), + } +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateObjectResponse { + #[prost(message, optional, tag = "1")] + pub object: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetUploadUrlRequest { + /// ObjectId + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, + /// Is this a multipart upload? + #[prost(bool, tag = "2")] + pub multipart: bool, + /// (optional) if multi was initialized + #[prost(int32, tag = "3")] + pub part_number: i32, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetUploadUrlResponse { + /// URL + #[prost(string, tag = "1")] + pub url: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetDownloadUrlRequest { + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetDownloadUrlResponse { + /// URL + #[prost(string, tag = "1")] + pub url: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CompletedPart { + /// Multipart identifier + #[prost(string, tag = "1")] + pub etag: ::prost::alloc::string::String, + /// Part number + #[prost(int64, tag = "2")] + pub part: i64, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FinishObjectStagingRequest { + /// ObjectId + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, + /// Final content len + #[prost(int64, tag = "2")] + pub content_len: i64, + /// Hash of the uploaded data - used to verify the data integrity. + /// This supports multiple hashing algorithms. + #[prost(message, repeated, tag = "3")] + pub hashes: ::prost::alloc::vec::Vec, + /// If the upload was multipart, this is the list of parts that were uploaded. + /// Should be empty if the upload was not multipart. + /// (optional) + #[prost(message, repeated, tag = "4")] + pub completed_parts: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FinishObjectStagingResponse { + /// (new) Object overview + #[prost(message, optional, tag = "1")] + pub object: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateObjectRequest { + /// Existing object ID + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, + /// object name + #[prost(string, optional, tag = "2")] + pub name: ::core::option::Option<::prost::alloc::string::String>, + /// object description + #[prost(string, optional, tag = "3")] + pub description: ::core::option::Option<::prost::alloc::string::String>, + /// key_values to add + #[prost(message, repeated, tag = "4")] + pub add_key_values: ::prost::alloc::vec::Vec, + /// key_values to remove + #[prost(message, repeated, tag = "5")] + pub remove_key_values: ::prost::alloc::vec::Vec, + /// New DataClass + #[prost(enumeration = "super::super::models::v2::DataClass", tag = "7")] + pub data_class: i32, + #[prost(message, repeated, tag = "12")] + pub hashes: ::prost::alloc::vec::Vec, + /// Force new object revision + #[prost(bool, tag = "13")] + pub force_revision: bool, + #[prost(string, optional, tag = "14")] + pub metadata_license_tag: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag = "15")] + pub data_license_tag: ::core::option::Option<::prost::alloc::string::String>, + /// Parent can be one of all other resources + #[prost(oneof = "update_object_request::Parent", tags = "8, 9, 10")] + pub parent: ::core::option::Option, +} +/// Nested message and enum types in `UpdateObjectRequest`. +pub mod update_object_request { + /// Parent can be one of all other resources + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Parent { + #[prost(string, tag = "8")] + ProjectId(::prost::alloc::string::String), + #[prost(string, tag = "9")] + CollectionId(::prost::alloc::string::String), + #[prost(string, tag = "10")] + DatasetId(::prost::alloc::string::String), } - impl tonic::server::NamedService - for CollectionServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.CollectionService"; +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateObjectResponse { + #[prost(message, optional, tag = "1")] + pub object: ::core::option::Option, + #[prost(bool, tag = "2")] + pub new_revision: bool, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CloneObjectRequest { + /// ObjectId + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, + /// + #[prost(oneof = "clone_object_request::Parent", tags = "2, 3, 4")] + pub parent: ::core::option::Option, +} +/// Nested message and enum types in `CloneObjectRequest`. +pub mod clone_object_request { + /// + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Parent { + #[prost(string, tag = "2")] + ProjectId(::prost::alloc::string::String), + #[prost(string, tag = "3")] + CollectionId(::prost::alloc::string::String), + #[prost(string, tag = "4")] + DatasetId(::prost::alloc::string::String), } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ReplicateProjectDataRequest { - #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, +pub struct CloneObjectResponse { + /// This describes the new object. + #[prost(message, optional, tag = "1")] + pub object: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteObjectRequest { + /// ObjectId + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, + /// Delete including revisions + #[prost(bool, tag = "2")] + pub with_revisions: bool, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteObjectResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetObjectRequest { + /// Object Id + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetObjectResponse { + #[prost(message, optional, tag = "1")] + pub object: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetObjectsRequest { + /// Object ids + #[prost(string, repeated, tag = "1")] + pub object_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ReplicateProjectDataResponse { - #[prost(enumeration = "super::super::models::v2::ReplicationStatus", tag = "1")] - pub status: i32, +pub struct GetObjectsResponse { + /// A List of objects + #[prost(message, repeated, tag = "1")] + pub objects: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct PartialReplicateDataRequest { - #[prost(string, tag = "4")] - pub endpoint_id: ::prost::alloc::string::String, - #[prost(oneof = "partial_replicate_data_request::DataVariant", tags = "1, 2, 3")] - pub data_variant: ::core::option::Option< - partial_replicate_data_request::DataVariant, - >, -} -/// Nested message and enum types in `PartialReplicateDataRequest`. -pub mod partial_replicate_data_request { - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum DataVariant { - #[prost(string, tag = "1")] - CollectionId(::prost::alloc::string::String), - #[prost(string, tag = "2")] - DatasetId(::prost::alloc::string::String), - #[prost(string, tag = "3")] - ObjectId(::prost::alloc::string::String), - } +pub struct GetObjectRevisionsRequest { + /// Object id + #[prost(string, tag = "2")] + pub object_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct PartialReplicateDataResponse { - #[prost(enumeration = "super::super::models::v2::ReplicationStatus", tag = "1")] - pub status: i32, +pub struct GetObjectRevisionsResponse { + /// List of objects + #[prost(message, repeated, tag = "1")] + pub objects: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateReplicationStatusRequest { +pub struct GetLatestObjectRevisionRequest { + /// Object id #[prost(string, tag = "1")] pub object_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::ReplicationStatus", tag = "3")] - pub status: i32, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateReplicationStatusResponse {} +pub struct GetLatestObjectRevisionResponse { + /// The object with the latest revision + #[prost(message, optional, tag = "1")] + pub object: ::core::option::Option, +} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetReplicationStatusRequest { +pub struct GetObjectEndpointsRequest { + /// Collection id #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, + pub collection_id: ::prost::alloc::string::String, + /// Object id #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, + pub object_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetReplicationStatusResponse { - #[prost(message, repeated, tag = "1")] - pub infos: ::prost::alloc::vec::Vec, +pub struct UpdateObjectTitleRequest { + /// Object id + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, + /// New title + #[prost(string, tag = "2")] + pub title: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ReplicationInfo { - #[prost(message, optional, tag = "5")] - pub endpoint_info: ::core::option::Option, - #[prost(oneof = "replication_info::Resource", tags = "1, 2, 3, 4")] - pub resource: ::core::option::Option, +pub struct UpdateObjectTitleResponse { + /// The updated object + #[prost(message, optional, tag = "1")] + pub object: ::core::option::Option, } -/// Nested message and enum types in `ReplicationInfo`. -pub mod replication_info { - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Resource { - #[prost(string, tag = "1")] - ProjectId(::prost::alloc::string::String), - #[prost(string, tag = "2")] - CollectionId(::prost::alloc::string::String), - #[prost(string, tag = "3")] - DatasetId(::prost::alloc::string::String), - #[prost(string, tag = "4")] - ObjectId(::prost::alloc::string::String), - } +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateObjectAuthorsRequest { + /// Object id + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, + /// Add authors + #[prost(message, repeated, tag = "2")] + pub add_authors: ::prost::alloc::vec::Vec, + /// Remove authors + #[prost(message, repeated, tag = "3")] + pub remove_authors: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteReplicationRequest { +pub struct UpdateObjectAuthorsResponse { + /// The updated object + #[prost(message, optional, tag = "1")] + pub object: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SetObjectHashesRequest { + /// Object id #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, + pub object_id: ::prost::alloc::string::String, + /// Hashes + #[prost(message, repeated, tag = "2")] + pub hashes: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteReplicationResponse {} +pub struct SetObjectHashesResponse { + /// The updated object (possibly with error status) + #[prost(message, optional, tag = "1")] + pub object: ::core::option::Option, +} /// Generated client implementations. -pub mod data_replication_service_client { +pub mod object_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// DataReplicationService - /// Endpoint specific methods for syncing data + /// ObjectService + /// + /// Status: BETA + /// + /// Contains all methods that get/create or update objects and associated resources #[derive(Debug, Clone)] - pub struct DataReplicationServiceClient { + pub struct ObjectServiceClient { inner: tonic::client::Grpc, } - impl DataReplicationServiceClient { + impl ObjectServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -15684,7 +14934,7 @@ pub mod data_replication_service_client { Ok(Self::new(conn)) } } - impl DataReplicationServiceClient + impl ObjectServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -15702,7 +14952,7 @@ pub mod data_replication_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> DataReplicationServiceClient> + ) -> ObjectServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -15716,51 +14966,271 @@ pub mod data_replication_service_client { http::Request, >>::Error: Into + Send + Sync, { - DataReplicationServiceClient::new( - InterceptedService::new(inner, interceptor), - ) + ObjectServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// CreateObject + /// + /// Status: BETA + /// + /// This creates a new object and puts it in a staging area. + /// Staging objects have an "INITIALIZING" status + /// and need to be finished either manually or by uploading data. + pub async fn create_object( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ObjectService/CreateObject", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ObjectService", + "CreateObject", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetUploadURL + /// + /// Status: BETA + /// + /// This is a proxy method that will call the apropriate method at dataproxy level + /// This method will return a (multi-part) url that can be used to upload a + /// file to S3. Part is a optional query parameter that can be used to upload a + /// part of the file / multipart upload. + pub async fn get_upload_url( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ObjectService/GetUploadURL", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ObjectService", + "GetUploadURL", + ), + ); + self.inner.unary(req, path, codec).await } - /// Compress requests with the given encoding. + /// GetDownloadUrl /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self + /// Status: BETA + /// + /// This is a proxy method that will call the apropriate method at dataproxy level + /// will return a url that can be used to download a file from S3. + pub async fn get_download_url( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ObjectService/GetDownloadURL", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ObjectService", + "GetDownloadURL", + ), + ); + self.inner.unary(req, path, codec).await } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self + /// FinishObjectStaging + /// + /// Status: BETA + /// + /// This method completes the staging of an object. + pub async fn finish_object_staging( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ObjectService/FinishObjectStaging", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ObjectService", + "FinishObjectStaging", + ), + ); + self.inner.unary(req, path, codec).await } - /// Limits the maximum size of a decoded message. + /// UpdateObject /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self + /// Status: BETA + /// + /// Objects are immutable! + /// Updating an object will create a new revision for the object + /// This method will put the new revision in a staging area. + /// Staged objects will get a separate staging id and need to be finished + /// before they can be used. + pub async fn update_object( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ObjectService/UpdateObject", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ObjectService", + "UpdateObject", + ), + ); + self.inner.unary(req, path, codec).await } - /// Limits the maximum size of an encoded message. + /// CloneObject /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self + /// Status: BETA + /// + /// This method clones an object and creates a copy in the same collection. + /// This copy has a new id and revision and will not receive any updates from + /// the original object. + pub async fn clone_object( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ObjectService/CloneObject", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ObjectService", + "CloneObject", + ), + ); + self.inner.unary(req, path, codec).await } - /// ReplicateProjectData + /// DeleteObject /// - /// Status: ALPHA + /// Status: BETA /// - /// Replicates the (full) project data from one endpoint to another - pub async fn replicate_project_data( + /// Deletes the object with the complete revision history. + pub async fn delete_object( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -15774,28 +15244,31 @@ pub mod data_replication_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DataReplicationService/ReplicateProjectData", + "/aruna.api.storage.services.v2.ObjectService/DeleteObject", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DataReplicationService", - "ReplicateProjectData", + "aruna.api.storage.services.v2.ObjectService", + "DeleteObject", ), ); self.inner.unary(req, path, codec).await } - /// PartialReplicateData + /// GetObject /// - /// Status: ALPHA + /// Status: BETA /// - /// Partial replicate data between endpoints - pub async fn partial_replicate_data( + /// gets a specific Object by ID that is associated to the + /// current collection By default only the latest revision of an object will be + /// returned Specify a revision_number to select an older revision With the + /// optional with_url boolean a download link can automatically be requested + pub async fn get_object( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -15809,28 +15282,63 @@ pub mod data_replication_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DataReplicationService/PartialReplicateData", + "/aruna.api.storage.services.v2.ObjectService/GetObject", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DataReplicationService", - "PartialReplicateData", + "aruna.api.storage.services.v2.ObjectService", + "GetObject", ), ); self.inner.unary(req, path, codec).await } - /// UpdateReplicationStatus + /// GetObjects + /// + /// Status: BETA + /// + /// Get multiple objects by ID at once + pub async fn get_objects( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ObjectService/GetObjects", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ObjectService", + "GetObjects", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateTitle /// /// Status: ALPHA /// - /// Update the replication status of a project - pub async fn update_replication_status( + /// This method updates the title of an object + pub async fn update_object_title( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -15844,28 +15352,28 @@ pub mod data_replication_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DataReplicationService/UpdateReplicationStatus", + "/aruna.api.storage.services.v2.ObjectService/UpdateObjectTitle", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DataReplicationService", - "UpdateReplicationStatus", + "aruna.api.storage.services.v2.ObjectService", + "UpdateObjectTitle", ), ); self.inner.unary(req, path, codec).await } - /// GetReplicationStatus + /// UpdateAuthors /// /// Status: ALPHA /// - /// Get the replication status of a project - pub async fn get_replication_status( + /// This method updates the authors of an object + pub async fn update_object_authors( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -15879,28 +15387,30 @@ pub mod data_replication_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DataReplicationService/GetReplicationStatus", + "/aruna.api.storage.services.v2.ObjectService/UpdateObjectAuthors", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DataReplicationService", - "GetReplicationStatus", + "aruna.api.storage.services.v2.ObjectService", + "UpdateObjectAuthors", ), ); self.inner.unary(req, path, codec).await } - /// DeleteReplication + /// SetObjectHashes /// /// Status: ALPHA /// - /// Delete the replication status of a project - pub async fn delete_replication( + /// This method sets the object hashes if not already set + /// if a hash is already set, it will be compared to the new hash and + /// set the status to ERROR if they do not match + pub async fn set_object_hashes( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -15914,14 +15424,14 @@ pub mod data_replication_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DataReplicationService/DeleteReplication", + "/aruna.api.storage.services.v2.ObjectService/SetObjectHashes", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DataReplicationService", - "DeleteReplication", + "aruna.api.storage.services.v2.ObjectService", + "SetObjectHashes", ), ); self.inner.unary(req, path, codec).await @@ -15929,77 +15439,181 @@ pub mod data_replication_service_client { } } /// Generated server implementations. -pub mod data_replication_service_server { +pub mod object_service_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with DataReplicationServiceServer. + /// Generated trait containing gRPC methods that should be implemented for use with ObjectServiceServer. #[async_trait] - pub trait DataReplicationService: Send + Sync + 'static { - /// ReplicateProjectData + pub trait ObjectService: Send + Sync + 'static { + /// CreateObject /// - /// Status: ALPHA + /// Status: BETA /// - /// Replicates the (full) project data from one endpoint to another - async fn replicate_project_data( + /// This creates a new object and puts it in a staging area. + /// Staging objects have an "INITIALIZING" status + /// and need to be finished either manually or by uploading data. + async fn create_object( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// PartialReplicateData + /// GetUploadURL /// - /// Status: ALPHA + /// Status: BETA /// - /// Partial replicate data between endpoints - async fn partial_replicate_data( + /// This is a proxy method that will call the apropriate method at dataproxy level + /// This method will return a (multi-part) url that can be used to upload a + /// file to S3. Part is a optional query parameter that can be used to upload a + /// part of the file / multipart upload. + async fn get_upload_url( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateReplicationStatus + /// GetDownloadUrl + /// + /// Status: BETA + /// + /// This is a proxy method that will call the apropriate method at dataproxy level + /// will return a url that can be used to download a file from S3. + async fn get_download_url( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// FinishObjectStaging + /// + /// Status: BETA + /// + /// This method completes the staging of an object. + async fn finish_object_staging( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateObject + /// + /// Status: BETA + /// + /// Objects are immutable! + /// Updating an object will create a new revision for the object + /// This method will put the new revision in a staging area. + /// Staged objects will get a separate staging id and need to be finished + /// before they can be used. + async fn update_object( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// CloneObject + /// + /// Status: BETA + /// + /// This method clones an object and creates a copy in the same collection. + /// This copy has a new id and revision and will not receive any updates from + /// the original object. + async fn clone_object( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteObject + /// + /// Status: BETA + /// + /// Deletes the object with the complete revision history. + async fn delete_object( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetObject + /// + /// Status: BETA + /// + /// gets a specific Object by ID that is associated to the + /// current collection By default only the latest revision of an object will be + /// returned Specify a revision_number to select an older revision With the + /// optional with_url boolean a download link can automatically be requested + async fn get_object( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetObjects + /// + /// Status: BETA + /// + /// Get multiple objects by ID at once + async fn get_objects( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateTitle /// /// Status: ALPHA /// - /// Update the replication status of a project - async fn update_replication_status( + /// This method updates the title of an object + async fn update_object_title( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetReplicationStatus + /// UpdateAuthors /// /// Status: ALPHA /// - /// Get the replication status of a project - async fn get_replication_status( + /// This method updates the authors of an object + async fn update_object_authors( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// DeleteReplication + /// SetObjectHashes /// /// Status: ALPHA /// - /// Delete the replication status of a project - async fn delete_replication( + /// This method sets the object hashes if not already set + /// if a hash is already set, it will be compared to the new hash and + /// set the status to ERROR if they do not match + async fn set_object_hashes( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// DataReplicationService - /// Endpoint specific methods for syncing data + /// ObjectService + /// + /// Status: BETA + /// + /// Contains all methods that get/create or update objects and associated resources #[derive(Debug)] - pub struct DataReplicationServiceServer { + pub struct ObjectServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -16007,7 +15621,7 @@ pub mod data_replication_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl DataReplicationServiceServer { + impl ObjectServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -16059,10 +15673,9 @@ pub mod data_replication_service_server { self } } - impl tonic::codegen::Service> - for DataReplicationServiceServer + impl tonic::codegen::Service> for ObjectServiceServer where - T: DataReplicationService, + T: ObjectService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -16078,31 +15691,349 @@ pub mod data_replication_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.DataReplicationService/ReplicateProjectData" => { + "/aruna.api.storage.services.v2.ObjectService/CreateObject" => { + #[allow(non_camel_case_types)] + struct CreateObjectSvc(pub Arc); + impl< + T: ObjectService, + > tonic::server::UnaryService + for CreateObjectSvc { + type Response = super::CreateObjectResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::create_object(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateObjectSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.ObjectService/GetUploadURL" => { + #[allow(non_camel_case_types)] + struct GetUploadURLSvc(pub Arc); + impl< + T: ObjectService, + > tonic::server::UnaryService + for GetUploadURLSvc { + type Response = super::GetUploadUrlResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_upload_url(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetUploadURLSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.ObjectService/GetDownloadURL" => { + #[allow(non_camel_case_types)] + struct GetDownloadURLSvc(pub Arc); + impl< + T: ObjectService, + > tonic::server::UnaryService + for GetDownloadURLSvc { + type Response = super::GetDownloadUrlResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_download_url(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetDownloadURLSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.ObjectService/FinishObjectStaging" => { + #[allow(non_camel_case_types)] + struct FinishObjectStagingSvc(pub Arc); + impl< + T: ObjectService, + > tonic::server::UnaryService + for FinishObjectStagingSvc { + type Response = super::FinishObjectStagingResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::finish_object_staging(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = FinishObjectStagingSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.ObjectService/UpdateObject" => { + #[allow(non_camel_case_types)] + struct UpdateObjectSvc(pub Arc); + impl< + T: ObjectService, + > tonic::server::UnaryService + for UpdateObjectSvc { + type Response = super::UpdateObjectResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_object(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateObjectSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.ObjectService/CloneObject" => { + #[allow(non_camel_case_types)] + struct CloneObjectSvc(pub Arc); + impl< + T: ObjectService, + > tonic::server::UnaryService + for CloneObjectSvc { + type Response = super::CloneObjectResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::clone_object(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CloneObjectSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.ObjectService/DeleteObject" => { + #[allow(non_camel_case_types)] + struct DeleteObjectSvc(pub Arc); + impl< + T: ObjectService, + > tonic::server::UnaryService + for DeleteObjectSvc { + type Response = super::DeleteObjectResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_object(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteObjectSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.ObjectService/GetObject" => { #[allow(non_camel_case_types)] - struct ReplicateProjectDataSvc( - pub Arc, - ); + struct GetObjectSvc(pub Arc); impl< - T: DataReplicationService, - > tonic::server::UnaryService - for ReplicateProjectDataSvc { - type Response = super::ReplicateProjectDataResponse; + T: ObjectService, + > tonic::server::UnaryService + for GetObjectSvc { + type Response = super::GetObjectResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::replicate_project_data( - &inner, - request, - ) - .await + ::get_object(&inner, request).await }; Box::pin(fut) } @@ -16114,7 +16045,7 @@ pub mod data_replication_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ReplicateProjectDataSvc(inner); + let method = GetObjectSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -16130,31 +16061,25 @@ pub mod data_replication_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DataReplicationService/PartialReplicateData" => { + "/aruna.api.storage.services.v2.ObjectService/GetObjects" => { #[allow(non_camel_case_types)] - struct PartialReplicateDataSvc( - pub Arc, - ); + struct GetObjectsSvc(pub Arc); impl< - T: DataReplicationService, - > tonic::server::UnaryService - for PartialReplicateDataSvc { - type Response = super::PartialReplicateDataResponse; + T: ObjectService, + > tonic::server::UnaryService + for GetObjectsSvc { + type Response = super::GetObjectsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::partial_replicate_data( - &inner, - request, - ) - .await + ::get_objects(&inner, request).await }; Box::pin(fut) } @@ -16166,7 +16091,7 @@ pub mod data_replication_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = PartialReplicateDataSvc(inner); + let method = GetObjectsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -16182,32 +16107,25 @@ pub mod data_replication_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DataReplicationService/UpdateReplicationStatus" => { + "/aruna.api.storage.services.v2.ObjectService/UpdateObjectTitle" => { #[allow(non_camel_case_types)] - struct UpdateReplicationStatusSvc( - pub Arc, - ); + struct UpdateObjectTitleSvc(pub Arc); impl< - T: DataReplicationService, - > tonic::server::UnaryService - for UpdateReplicationStatusSvc { - type Response = super::UpdateReplicationStatusResponse; + T: ObjectService, + > tonic::server::UnaryService + for UpdateObjectTitleSvc { + type Response = super::UpdateObjectTitleResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::UpdateReplicationStatusRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_replication_status( - &inner, - request, - ) + ::update_object_title(&inner, request) .await }; Box::pin(fut) @@ -16220,7 +16138,7 @@ pub mod data_replication_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateReplicationStatusSvc(inner); + let method = UpdateObjectTitleSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -16236,30 +16154,25 @@ pub mod data_replication_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DataReplicationService/GetReplicationStatus" => { + "/aruna.api.storage.services.v2.ObjectService/UpdateObjectAuthors" => { #[allow(non_camel_case_types)] - struct GetReplicationStatusSvc( - pub Arc, - ); + struct UpdateObjectAuthorsSvc(pub Arc); impl< - T: DataReplicationService, - > tonic::server::UnaryService - for GetReplicationStatusSvc { - type Response = super::GetReplicationStatusResponse; + T: ObjectService, + > tonic::server::UnaryService + for UpdateObjectAuthorsSvc { + type Response = super::UpdateObjectAuthorsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_replication_status( - &inner, - request, - ) + ::update_object_authors(&inner, request) .await }; Box::pin(fut) @@ -16272,7 +16185,7 @@ pub mod data_replication_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetReplicationStatusSvc(inner); + let method = UpdateObjectAuthorsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -16288,28 +16201,25 @@ pub mod data_replication_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DataReplicationService/DeleteReplication" => { + "/aruna.api.storage.services.v2.ObjectService/SetObjectHashes" => { #[allow(non_camel_case_types)] - struct DeleteReplicationSvc(pub Arc); + struct SetObjectHashesSvc(pub Arc); impl< - T: DataReplicationService, - > tonic::server::UnaryService - for DeleteReplicationSvc { - type Response = super::DeleteReplicationResponse; + T: ObjectService, + > tonic::server::UnaryService + for SetObjectHashesSvc { + type Response = super::SetObjectHashesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_replication( - &inner, - request, - ) + ::set_object_hashes(&inner, request) .await }; Box::pin(fut) @@ -16322,7 +16232,7 @@ pub mod data_replication_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteReplicationSvc(inner); + let method = SetObjectHashesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -16353,7 +16263,7 @@ pub mod data_replication_service_server { } } } - impl Clone for DataReplicationServiceServer { + impl Clone for ObjectServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -16365,7 +16275,7 @@ pub mod data_replication_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -16375,102 +16285,164 @@ pub mod data_replication_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService - for DataReplicationServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.DataReplicationService"; + impl tonic::server::NamedService for ObjectServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.ObjectService"; } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ModifyRelationsRequest { +pub struct CreateWorkspaceTemplateRequest { + /// The user id of the template owner (will be automatically added as "admin" to each associated workspace) #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub add_relations: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub remove_relations: ::prost::alloc::vec::Vec, + pub owner_id: ::prost::alloc::string::String, + /// Short prefix for each workspace_project (will be prepended by a random id) example: test-i12ashj9g2 + #[prost(string, tag = "2")] + pub prefix: ::prost::alloc::string::String, + /// The name of the workspace template + #[prost(string, tag = "3")] + pub name: ::prost::alloc::string::String, + /// Hooks that are added to created workspaces + #[prost(string, repeated, tag = "5")] + pub hook_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Description of the workspace + #[prost(string, tag = "6")] + pub description: ::prost::alloc::string::String, + /// Endpoint ids that are used for this template + #[prost(string, repeated, tag = "7")] + pub endpoint_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Rule ids that are enforced on workspace-level + #[prost(string, repeated, tag = "8")] + pub rules: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ModifyRelationsResponse {} +pub struct CreateWorkspaceTemplateResponse { + #[prost(string, tag = "1")] + pub template_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetWorkspaceTemplateRequest { + #[prost(string, tag = "1")] + pub template_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetWorkspaceTemplateResponse { + #[prost(message, optional, tag = "1")] + pub workspace: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteWorkspaceTemplateRequest { + #[prost(string, tag = "1")] + pub template_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteWorkspaceTemplateResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListOwnedWorkspaceTemplatesRequest {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListOwnedWorkspaceTemplatesResponse { + #[prost(message, repeated, tag = "1")] + pub workspaces: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct WorkspaceInfo { + #[prost(string, tag = "1")] + pub workspace_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub description: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub owner: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub prefix: ::prost::alloc::string::String, + #[prost(string, tag = "6")] + pub hook_ids: ::prost::alloc::string::String, + #[prost(string, tag = "7")] + pub endpoint_ids: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateWorkspaceRequest { + /// Workspace template id + #[prost(string, tag = "1")] + pub workspace_template: ::prost::alloc::string::String, + /// Description of this workspace instance + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, +} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetHierarchyRequest { +pub struct CreateWorkspaceResponse { #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, + pub workspace_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub token: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub access_key: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub secret_key: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DatasetRelations { +pub struct DeleteWorkspaceRequest { #[prost(string, tag = "1")] - pub origin: ::prost::alloc::string::String, - #[prost(string, repeated, tag = "2")] - pub object_children: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + pub workspace_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CollectionRelations { - #[prost(string, tag = "1")] - pub origin: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub dataset_children: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "3")] - pub object_children: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} +pub struct DeleteWorkspaceResponse {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ProjectRelations { +pub struct ClaimWorkspaceRequest { + /// This can only be called by an registered user, + /// that is in possesion of the workspace_id and workspace token + /// It will remove the service account and claim all references "as" the user. #[prost(string, tag = "1")] - pub origin: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub collection_children: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub dataset_children: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "4")] - pub object_children: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + pub workspace_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub token: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetHierarchyResponse { - #[prost(oneof = "get_hierarchy_response::Graph", tags = "1, 2, 3")] - pub graph: ::core::option::Option, -} -/// Nested message and enum types in `GetHierarchyResponse`. -pub mod get_hierarchy_response { - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Graph { - #[prost(message, tag = "1")] - Project(super::ProjectRelations), - #[prost(message, tag = "2")] - Collection(super::CollectionRelations), - #[prost(message, tag = "3")] - Dataset(super::DatasetRelations), - } -} +pub struct ClaimWorkspaceResponse {} /// Generated client implementations. -pub mod relations_service_client { +pub mod workspace_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// RelationsService + /// WorkspaceService /// /// Status: BETA /// - /// Contains all methods to edit and change resource relations + /// Service to manage anonymous "scratch" projects / workspaces #[derive(Debug, Clone)] - pub struct RelationsServiceClient { + pub struct WorkspaceServiceClient { inner: tonic::client::Grpc, } - impl RelationsServiceClient { + impl WorkspaceServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -16481,7 +16453,7 @@ pub mod relations_service_client { Ok(Self::new(conn)) } } - impl RelationsServiceClient + impl WorkspaceServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -16499,7 +16471,7 @@ pub mod relations_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> RelationsServiceClient> + ) -> WorkspaceServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -16513,7 +16485,7 @@ pub mod relations_service_client { http::Request, >>::Error: Into + Send + Sync, { - RelationsServiceClient::new(InterceptedService::new(inner, interceptor)) + WorkspaceServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -16546,17 +16518,191 @@ pub mod relations_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// ModifyRelation + /// CreatesNewWorkspaceTemplate /// - /// Status: BETA + /// Status: ALPHA /// - /// Add/Remove/Modifies all relation types to / from a resource - /// Works for internal and external relations - pub async fn modify_relations( + /// This will create a new template for workspaces (admin only) + pub async fn create_workspace_template( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.WorkspaceService/CreateWorkspaceTemplate", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.WorkspaceService", + "CreateWorkspaceTemplate", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetWorkspaceTemplatesById + /// + /// Status: ALPHA + /// + /// Gets workspace template by id + pub async fn get_workspace_template( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.WorkspaceService/GetWorkspaceTemplate", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.WorkspaceService", + "GetWorkspaceTemplate", + ), + ); + self.inner.unary(req, path, codec).await + } + /// ListOwnedWorkspaceTemplates + /// + /// Status: ALPHA + /// + /// Lists owned workspace templates + pub async fn list_owned_workspace_templates( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.WorkspaceService/ListOwnedWorkspaceTemplates", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.WorkspaceService", + "ListOwnedWorkspaceTemplates", + ), + ); + self.inner.unary(req, path, codec).await + } + /// DeleteWorkspaceTemplates + /// + /// Status: ALPHA + /// + /// Deletes specified workspace templates + pub async fn delete_workspace_template( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.WorkspaceService/DeleteWorkspaceTemplate", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.WorkspaceService", + "DeleteWorkspaceTemplate", + ), + ); + self.inner.unary(req, path, codec).await + } + /// CreateWorkspace + /// + /// Status: ALPHA + /// + /// Create a personal anonymous workspace + pub async fn create_workspace( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.WorkspaceService/CreateWorkspace", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.WorkspaceService", + "CreateWorkspace", + ), + ); + self.inner.unary(req, path, codec).await + } + /// DeleteWorkspace + /// + /// Status: ALPHA + /// + /// Delete a workspace + pub async fn delete_workspace( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -16570,29 +16716,28 @@ pub mod relations_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.RelationsService/ModifyRelations", + "/aruna.api.storage.services.v2.WorkspaceService/DeleteWorkspace", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.RelationsService", - "ModifyRelations", + "aruna.api.storage.services.v2.WorkspaceService", + "DeleteWorkspace", ), ); self.inner.unary(req, path, codec).await } - /// GetHierachy + /// DeleteWorkspace /// - /// Status: BETA + /// Status: ALPHA /// - /// Gets all downstream hierarchy relations from a resource - /// results in a tree structure - pub async fn get_hierarchy( + /// Claims an anonymous workspace, and transfers the owner to a regular user account. + pub async fn claim_workspace( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -16606,14 +16751,14 @@ pub mod relations_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.RelationsService/GetHierarchy", + "/aruna.api.storage.services.v2.WorkspaceService/ClaimWorkspace", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.RelationsService", - "GetHierarchy", + "aruna.api.storage.services.v2.WorkspaceService", + "ClaimWorkspace", ), ); self.inner.unary(req, path, codec).await @@ -16621,46 +16766,104 @@ pub mod relations_service_client { } } /// Generated server implementations. -pub mod relations_service_server { +pub mod workspace_service_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with RelationsServiceServer. + /// Generated trait containing gRPC methods that should be implemented for use with WorkspaceServiceServer. #[async_trait] - pub trait RelationsService: Send + Sync + 'static { - /// ModifyRelation + pub trait WorkspaceService: Send + Sync + 'static { + /// CreatesNewWorkspaceTemplate /// - /// Status: BETA + /// Status: ALPHA /// - /// Add/Remove/Modifies all relation types to / from a resource - /// Works for internal and external relations - async fn modify_relations( + /// This will create a new template for workspaces (admin only) + async fn create_workspace_template( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetHierachy + /// GetWorkspaceTemplatesById /// - /// Status: BETA + /// Status: ALPHA /// - /// Gets all downstream hierarchy relations from a resource - /// results in a tree structure - async fn get_hierarchy( + /// Gets workspace template by id + async fn get_workspace_template( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, + tonic::Status, + >; + /// ListOwnedWorkspaceTemplates + /// + /// Status: ALPHA + /// + /// Lists owned workspace templates + async fn list_owned_workspace_templates( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteWorkspaceTemplates + /// + /// Status: ALPHA + /// + /// Deletes specified workspace templates + async fn delete_workspace_template( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// CreateWorkspace + /// + /// Status: ALPHA + /// + /// Create a personal anonymous workspace + async fn create_workspace( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteWorkspace + /// + /// Status: ALPHA + /// + /// Delete a workspace + async fn delete_workspace( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteWorkspace + /// + /// Status: ALPHA + /// + /// Claims an anonymous workspace, and transfers the owner to a regular user account. + async fn claim_workspace( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, tonic::Status, >; } - /// RelationsService + /// WorkspaceService /// /// Status: BETA /// - /// Contains all methods to edit and change resource relations + /// Service to manage anonymous "scratch" projects / workspaces #[derive(Debug)] - pub struct RelationsServiceServer { + pub struct WorkspaceServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -16668,7 +16871,7 @@ pub mod relations_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl RelationsServiceServer { + impl WorkspaceServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -16720,9 +16923,9 @@ pub mod relations_service_server { self } } - impl tonic::codegen::Service> for RelationsServiceServer + impl tonic::codegen::Service> for WorkspaceServiceServer where - T: RelationsService, + T: WorkspaceService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -16738,25 +16941,187 @@ pub mod relations_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.RelationsService/ModifyRelations" => { + "/aruna.api.storage.services.v2.WorkspaceService/CreateWorkspaceTemplate" => { + #[allow(non_camel_case_types)] + struct CreateWorkspaceTemplateSvc(pub Arc); + impl< + T: WorkspaceService, + > tonic::server::UnaryService + for CreateWorkspaceTemplateSvc { + type Response = super::CreateWorkspaceTemplateResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::CreateWorkspaceTemplateRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::create_workspace_template( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateWorkspaceTemplateSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.WorkspaceService/GetWorkspaceTemplate" => { + #[allow(non_camel_case_types)] + struct GetWorkspaceTemplateSvc(pub Arc); + impl< + T: WorkspaceService, + > tonic::server::UnaryService + for GetWorkspaceTemplateSvc { + type Response = super::GetWorkspaceTemplateResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_workspace_template( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetWorkspaceTemplateSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.WorkspaceService/ListOwnedWorkspaceTemplates" => { + #[allow(non_camel_case_types)] + struct ListOwnedWorkspaceTemplatesSvc( + pub Arc, + ); + impl< + T: WorkspaceService, + > tonic::server::UnaryService< + super::ListOwnedWorkspaceTemplatesRequest, + > for ListOwnedWorkspaceTemplatesSvc { + type Response = super::ListOwnedWorkspaceTemplatesResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::ListOwnedWorkspaceTemplatesRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::list_owned_workspace_templates( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ListOwnedWorkspaceTemplatesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.WorkspaceService/DeleteWorkspaceTemplate" => { #[allow(non_camel_case_types)] - struct ModifyRelationsSvc(pub Arc); + struct DeleteWorkspaceTemplateSvc(pub Arc); impl< - T: RelationsService, - > tonic::server::UnaryService - for ModifyRelationsSvc { - type Response = super::ModifyRelationsResponse; + T: WorkspaceService, + > tonic::server::UnaryService + for DeleteWorkspaceTemplateSvc { + type Response = super::DeleteWorkspaceTemplateResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::DeleteWorkspaceTemplateRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::modify_relations(&inner, request) + ::delete_workspace_template( + &inner, + request, + ) .await }; Box::pin(fut) @@ -16769,7 +17134,7 @@ pub mod relations_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ModifyRelationsSvc(inner); + let method = DeleteWorkspaceTemplateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -16785,25 +17150,25 @@ pub mod relations_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.RelationsService/GetHierarchy" => { + "/aruna.api.storage.services.v2.WorkspaceService/CreateWorkspace" => { #[allow(non_camel_case_types)] - struct GetHierarchySvc(pub Arc); + struct CreateWorkspaceSvc(pub Arc); impl< - T: RelationsService, - > tonic::server::UnaryService - for GetHierarchySvc { - type Response = super::GetHierarchyResponse; + T: WorkspaceService, + > tonic::server::UnaryService + for CreateWorkspaceSvc { + type Response = super::CreateWorkspaceResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_hierarchy(&inner, request) + ::create_workspace(&inner, request) .await }; Box::pin(fut) @@ -16816,7 +17181,101 @@ pub mod relations_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetHierarchySvc(inner); + let method = CreateWorkspaceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.WorkspaceService/DeleteWorkspace" => { + #[allow(non_camel_case_types)] + struct DeleteWorkspaceSvc(pub Arc); + impl< + T: WorkspaceService, + > tonic::server::UnaryService + for DeleteWorkspaceSvc { + type Response = super::DeleteWorkspaceResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_workspace(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteWorkspaceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.WorkspaceService/ClaimWorkspace" => { + #[allow(non_camel_case_types)] + struct ClaimWorkspaceSvc(pub Arc); + impl< + T: WorkspaceService, + > tonic::server::UnaryService + for ClaimWorkspaceSvc { + type Response = super::ClaimWorkspaceResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::claim_workspace(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ClaimWorkspaceSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -16847,7 +17306,7 @@ pub mod relations_service_server { } } } - impl Clone for RelationsServiceServer { + impl Clone for WorkspaceServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -16859,7 +17318,7 @@ pub mod relations_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -16869,164 +17328,101 @@ pub mod relations_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for RelationsServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.RelationsService"; - } -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateEndpointRequest { - /// Endpoint name - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// Endpoint type - #[prost(enumeration = "super::super::models::v2::EndpointVariant", tag = "2")] - pub ep_variant: i32, - /// Is this endpoint public - #[prost(bool, tag = "3")] - pub is_public: bool, - /// required public_key - #[prost(string, tag = "4")] - pub pubkey: ::prost::alloc::string::String, - /// List of EndpointHostConfigs - #[prost(message, repeated, tag = "5")] - pub host_configs: ::prost::alloc::vec::Vec< - super::super::models::v2::EndpointHostConfig, - >, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateEndpointResponse { - /// Overview of the created endpoint - #[prost(message, optional, tag = "1")] - pub endpoint: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FullSyncEndpointRequest {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FullSyncEndpointResponse { - #[prost(oneof = "full_sync_endpoint_response::Target", tags = "1, 2, 3")] - pub target: ::core::option::Option, -} -/// Nested message and enum types in `FullSyncEndpointResponse`. -pub mod full_sync_endpoint_response { - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Target { - #[prost(message, tag = "1")] - GenericResource(super::super::super::models::v2::GenericResource), - #[prost(message, tag = "2")] - User(super::super::super::models::v2::User), - #[prost(message, tag = "3")] - Pubkey(super::super::super::models::v2::Pubkey), - } -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetEndpointRequest { - /// Either endpoint_name or id - #[prost(oneof = "get_endpoint_request::Endpoint", tags = "1, 2")] - pub endpoint: ::core::option::Option, -} -/// Nested message and enum types in `GetEndpointRequest`. -pub mod get_endpoint_request { - /// Either endpoint_name or id - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Endpoint { - /// The name of the endpoint - #[prost(string, tag = "1")] - EndpointName(::prost::alloc::string::String), - /// Id of the endpoint - #[prost(string, tag = "2")] - EndpointId(::prost::alloc::string::String), + impl tonic::server::NamedService for WorkspaceServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.WorkspaceService"; } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetEndpointResponse { - /// Overview of the requested endpoint - #[prost(message, optional, tag = "1")] - pub endpoint: ::core::option::Option, +pub struct ModifyRelationsRequest { + #[prost(string, tag = "1")] + pub resource_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub add_relations: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub remove_relations: ::prost::alloc::vec::Vec, } -/// Requests all endpoints #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetEndpointsRequest {} +pub struct ModifyRelationsResponse {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetEndpointsResponse { - /// List of endpoints - #[prost(message, repeated, tag = "1")] - pub endpoints: ::prost::alloc::vec::Vec, +pub struct GetHierarchyRequest { + #[prost(string, tag = "1")] + pub resource_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteEndpointRequest { - /// Endpoint_id to delete +pub struct DatasetRelations { #[prost(string, tag = "1")] - pub endpoint_id: ::prost::alloc::string::String, + pub origin: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "2")] + pub object_children: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteEndpointResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDefaultEndpointRequest {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDefaultEndpointResponse { - /// Default endpoint of the server instance - #[prost(message, optional, tag = "1")] - pub endpoint: ::core::option::Option, +pub struct CollectionRelations { + #[prost(string, tag = "1")] + pub origin: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub dataset_children: ::prost::alloc::vec::Vec, + #[prost(string, repeated, tag = "3")] + pub object_children: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct SetEndpointStatusRequest { +pub struct ProjectRelations { #[prost(string, tag = "1")] - pub endpoint_id: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::ComponentStatus", tag = "2")] - pub status: i32, + pub origin: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub collection_children: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub dataset_children: ::prost::alloc::vec::Vec, + #[prost(string, repeated, tag = "4")] + pub object_children: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct SetEndpointStatusResponse { - #[prost(message, optional, tag = "1")] - pub endpoint: ::core::option::Option, +pub struct GetHierarchyResponse { + #[prost(oneof = "get_hierarchy_response::Graph", tags = "1, 2, 3")] + pub graph: ::core::option::Option, +} +/// Nested message and enum types in `GetHierarchyResponse`. +pub mod get_hierarchy_response { + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Graph { + #[prost(message, tag = "1")] + Project(super::ProjectRelations), + #[prost(message, tag = "2")] + Collection(super::CollectionRelations), + #[prost(message, tag = "3")] + Dataset(super::DatasetRelations), + } } /// Generated client implementations. -pub mod endpoint_service_client { +pub mod relations_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// EndpointService + /// RelationsService /// /// Status: BETA /// - /// Contains all methods that get/create or update Endpoint (Dataproxies) and associated resources + /// Contains all methods to edit and change resource relations #[derive(Debug, Clone)] - pub struct EndpointServiceClient { + pub struct RelationsServiceClient { inner: tonic::client::Grpc, } - impl EndpointServiceClient { + impl RelationsServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -17037,7 +17433,7 @@ pub mod endpoint_service_client { Ok(Self::new(conn)) } } - impl EndpointServiceClient + impl RelationsServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -17055,7 +17451,7 @@ pub mod endpoint_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> EndpointServiceClient> + ) -> RelationsServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -17069,7 +17465,7 @@ pub mod endpoint_service_client { http::Request, >>::Error: Into + Send + Sync, { - EndpointServiceClient::new(InterceptedService::new(inner, interceptor)) + RelationsServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -17083,212 +17479,36 @@ pub mod endpoint_service_client { /// Enable decompressing responses. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// CreateEndpoint - /// - /// Status: BETA - /// - /// Registers a new Endpoint (Aruna DataProxy) to the server - /// requires admin permissions - pub async fn create_endpoint( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.EndpointService/CreateEndpoint", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.EndpointService", - "CreateEndpoint", - ), - ); - self.inner.unary(req, path, codec).await - } - /// FullSyncEndpoint - /// - /// Status: BETA - /// - /// Requests a full sync of all endpoint related data - pub async fn full_sync_endpoint( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response>, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.EndpointService/FullSyncEndpoint", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.EndpointService", - "FullSyncEndpoint", - ), - ); - self.inner.server_streaming(req, path, codec).await - } - /// SetEndpointStatus - /// - /// Status: BETA - /// - /// This request sets the status of a specific Endpoint - pub async fn set_endpoint_status( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.EndpointService/SetEndpointStatus", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.EndpointService", - "SetEndpointStatus", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetEndpoint - /// - /// Status: BETA - /// - /// Gets an specific endpoint by ID or Name - pub async fn get_endpoint( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.EndpointService/GetEndpoint", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.EndpointService", - "GetEndpoint", - ), - ); - self.inner.unary(req, path, codec).await + self.inner = self.inner.accept_compressed(encoding); + self } - /// GetEndpoints + /// Limits the maximum size of a decoded message. /// - /// Status: BETA + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. /// - /// Gets all available endpoints - pub async fn get_endpoints( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.EndpointService/GetEndpoints", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.EndpointService", - "GetEndpoints", - ), - ); - self.inner.unary(req, path, codec).await + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self } - /// DeleteEndpoint + /// ModifyRelation /// /// Status: BETA /// - /// Deletes a specific endpoint by id - /// This needs admin permissions - pub async fn delete_endpoint( + /// Add/Remove/Modifies all relation types to / from a resource + /// Works for internal and external relations + pub async fn modify_relations( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -17302,29 +17522,29 @@ pub mod endpoint_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.EndpointService/DeleteEndpoint", + "/aruna.api.storage.services.v2.RelationsService/ModifyRelations", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.EndpointService", - "DeleteEndpoint", + "aruna.api.storage.services.v2.RelationsService", + "ModifyRelations", ), ); self.inner.unary(req, path, codec).await } - /// GetDefaultEndpoint + /// GetHierachy /// /// Status: BETA /// - /// This request returns the default endpoint for the current aruna_server - /// It may produce different results depending on the used server - pub async fn get_default_endpoint( + /// Gets all downstream hierarchy relations from a resource + /// results in a tree structure + pub async fn get_hierarchy( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -17338,14 +17558,14 @@ pub mod endpoint_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.EndpointService/GetDefaultEndpoint", + "/aruna.api.storage.services.v2.RelationsService/GetHierarchy", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.EndpointService", - "GetDefaultEndpoint", + "aruna.api.storage.services.v2.RelationsService", + "GetHierarchy", ), ); self.inner.unary(req, path, codec).await @@ -17353,116 +17573,46 @@ pub mod endpoint_service_client { } } /// Generated server implementations. -pub mod endpoint_service_server { +pub mod relations_service_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with EndpointServiceServer. + /// Generated trait containing gRPC methods that should be implemented for use with RelationsServiceServer. #[async_trait] - pub trait EndpointService: Send + Sync + 'static { - /// CreateEndpoint - /// - /// Status: BETA - /// - /// Registers a new Endpoint (Aruna DataProxy) to the server - /// requires admin permissions - async fn create_endpoint( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Server streaming response type for the FullSyncEndpoint method. - type FullSyncEndpointStream: tonic::codegen::tokio_stream::Stream< - Item = std::result::Result< - super::FullSyncEndpointResponse, - tonic::Status, - >, - > - + Send - + 'static; - /// FullSyncEndpoint - /// - /// Status: BETA - /// - /// Requests a full sync of all endpoint related data - async fn full_sync_endpoint( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// SetEndpointStatus - /// - /// Status: BETA - /// - /// This request sets the status of a specific Endpoint - async fn set_endpoint_status( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetEndpoint - /// - /// Status: BETA - /// - /// Gets an specific endpoint by ID or Name - async fn get_endpoint( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetEndpoints - /// - /// Status: BETA - /// - /// Gets all available endpoints - async fn get_endpoints( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteEndpoint + pub trait RelationsService: Send + Sync + 'static { + /// ModifyRelation /// /// Status: BETA /// - /// Deletes a specific endpoint by id - /// This needs admin permissions - async fn delete_endpoint( + /// Add/Remove/Modifies all relation types to / from a resource + /// Works for internal and external relations + async fn modify_relations( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetDefaultEndpoint + /// GetHierachy /// /// Status: BETA /// - /// This request returns the default endpoint for the current aruna_server - /// It may produce different results depending on the used server - async fn get_default_endpoint( + /// Gets all downstream hierarchy relations from a resource + /// results in a tree structure + async fn get_hierarchy( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// EndpointService + /// RelationsService /// /// Status: BETA /// - /// Contains all methods that get/create or update Endpoint (Dataproxies) and associated resources + /// Contains all methods to edit and change resource relations #[derive(Debug)] - pub struct EndpointServiceServer { + pub struct RelationsServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -17470,330 +17620,95 @@ pub mod endpoint_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl EndpointServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for EndpointServiceServer - where - T: EndpointService, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) + impl RelationsServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/aruna.api.storage.services.v2.EndpointService/CreateEndpoint" => { - #[allow(non_camel_case_types)] - struct CreateEndpointSvc(pub Arc); - impl< - T: EndpointService, - > tonic::server::UnaryService - for CreateEndpointSvc { - type Response = super::CreateEndpointResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::create_endpoint(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = CreateEndpointSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.EndpointService/FullSyncEndpoint" => { - #[allow(non_camel_case_types)] - struct FullSyncEndpointSvc(pub Arc); - impl< - T: EndpointService, - > tonic::server::ServerStreamingService< - super::FullSyncEndpointRequest, - > for FullSyncEndpointSvc { - type Response = super::FullSyncEndpointResponse; - type ResponseStream = T::FullSyncEndpointStream; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::full_sync_endpoint(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = FullSyncEndpointSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.server_streaming(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.EndpointService/SetEndpointStatus" => { - #[allow(non_camel_case_types)] - struct SetEndpointStatusSvc(pub Arc); - impl< - T: EndpointService, - > tonic::server::UnaryService - for SetEndpointStatusSvc { - type Response = super::SetEndpointStatusResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::set_endpoint_status(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = SetEndpointStatusSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.EndpointService/GetEndpoint" => { - #[allow(non_camel_case_types)] - struct GetEndpointSvc(pub Arc); - impl< - T: EndpointService, - > tonic::server::UnaryService - for GetEndpointSvc { - type Response = super::GetEndpointResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_endpoint(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetEndpointSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.EndpointService/GetEndpoints" => { - #[allow(non_camel_case_types)] - struct GetEndpointsSvc(pub Arc); - impl< - T: EndpointService, - > tonic::server::UnaryService - for GetEndpointsSvc { - type Response = super::GetEndpointsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_endpoints(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetEndpointsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.EndpointService/DeleteEndpoint" => { + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for RelationsServiceServer + where + T: RelationsService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/aruna.api.storage.services.v2.RelationsService/ModifyRelations" => { #[allow(non_camel_case_types)] - struct DeleteEndpointSvc(pub Arc); + struct ModifyRelationsSvc(pub Arc); impl< - T: EndpointService, - > tonic::server::UnaryService - for DeleteEndpointSvc { - type Response = super::DeleteEndpointResponse; + T: RelationsService, + > tonic::server::UnaryService + for ModifyRelationsSvc { + type Response = super::ModifyRelationsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_endpoint(&inner, request) + ::modify_relations(&inner, request) .await }; Box::pin(fut) @@ -17806,7 +17721,7 @@ pub mod endpoint_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteEndpointSvc(inner); + let method = ModifyRelationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -17822,28 +17737,25 @@ pub mod endpoint_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.EndpointService/GetDefaultEndpoint" => { + "/aruna.api.storage.services.v2.RelationsService/GetHierarchy" => { #[allow(non_camel_case_types)] - struct GetDefaultEndpointSvc(pub Arc); + struct GetHierarchySvc(pub Arc); impl< - T: EndpointService, - > tonic::server::UnaryService - for GetDefaultEndpointSvc { - type Response = super::GetDefaultEndpointResponse; + T: RelationsService, + > tonic::server::UnaryService + for GetHierarchySvc { + type Response = super::GetHierarchyResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_default_endpoint( - &inner, - request, - ) + ::get_hierarchy(&inner, request) .await }; Box::pin(fut) @@ -17856,7 +17768,7 @@ pub mod endpoint_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetDefaultEndpointSvc(inner); + let method = GetHierarchySvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -17887,7 +17799,7 @@ pub mod endpoint_service_server { } } } - impl Clone for EndpointServiceServer { + impl Clone for RelationsServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -17899,7 +17811,7 @@ pub mod endpoint_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -17909,250 +17821,149 @@ pub mod endpoint_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for EndpointServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.EndpointService"; + impl tonic::server::NamedService for RelationsServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.RelationsService"; } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateProjectRequest { - /// Project name +pub struct CreateRuleRequest { #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// title - #[prost(string, tag = "9")] - pub title: ::prost::alloc::string::String, - /// Description + pub rule: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, - /// Project specific labels / hooks - #[prost(message, repeated, tag = "3")] - pub key_values: ::prost::alloc::vec::Vec, - /// Internal / External relations (URLs / IDs from external sources) - #[prost(message, repeated, tag = "4")] - pub relations: ::prost::alloc::vec::Vec, - /// DataClass - #[prost(enumeration = "super::super::models::v2::DataClass", tag = "5")] - pub data_class: i32, - /// Preferred endpoint - #[prost(string, tag = "6")] - pub preferred_endpoint: ::prost::alloc::string::String, - /// - #[prost(string, tag = "7")] - pub metadata_license_tag: ::prost::alloc::string::String, - #[prost(string, tag = "8")] - pub default_data_license_tag: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "10")] - pub authors: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateProjectResponse { - /// The freshly created project - #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetProjectRequest { - /// The id of the project to get - #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetProjectResponse { - /// Overview of the projectroject - #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetProjectsRequest { - /// optional filter for specific ids - #[prost(string, repeated, tag = "1")] - pub project_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetProjectsResponse { - /// Overview of the projects - #[prost(message, repeated, tag = "1")] - pub projects: ::prost::alloc::vec::Vec, + #[prost(bool, tag = "3")] + pub public: bool, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteProjectRequest { - /// The id of the project to destroy +pub struct CreateRuleResponse { #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, + pub id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteProjectResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectNameRequest { +pub struct GetRuleRequest { #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectNameResponse { - #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, + pub id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectDescriptionRequest { +pub struct Rule { #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, + pub id: ::prost::alloc::string::String, #[prost(string, tag = "2")] + pub rule: ::prost::alloc::string::String, + #[prost(string, tag = "3")] pub description: ::prost::alloc::string::String, + #[prost(bool, tag = "4")] + pub public: bool, + #[prost(string, tag = "5")] + pub owner: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectDescriptionResponse { - #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectKeyValuesRequest { - #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub add_key_values: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub remove_key_values: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectKeyValuesResponse { +pub struct GetRuleResponse { #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, + pub rule: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectDataClassRequest { - #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::DataClass", tag = "2")] - pub data_class: i32, -} +pub struct ListRuleRequest {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectDataClassResponse { - #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, +pub struct ListRuleResponse { + #[prost(message, repeated, tag = "1")] + pub rules: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ArchiveProjectRequest { +pub struct UpdateRuleRequest { #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, + pub id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub rule: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub description: ::prost::alloc::string::String, + #[prost(bool, tag = "4")] + pub public: bool, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ArchiveProjectResponse { - /// This project will be returned via an Persistent Identifier! Updates will be impossible +pub struct UpdateRuleResponse { #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, + pub rule: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectLicensesRequest { - #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub metadata_license_tag: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub default_data_license_tag: ::prost::alloc::string::String, +pub struct DeleteRuleRequest { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectLicensesResponse { - #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, -} +pub struct DeleteRuleResponse {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectTitleRequest { - /// Project id +pub struct CreateRuleBindingRequest { #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, - /// New title + pub rule_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] - pub title: ::prost::alloc::string::String, + pub object_id: ::prost::alloc::string::String, + #[prost(bool, tag = "3")] + pub cascading: bool, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectTitleResponse { - /// The updated object - #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, +pub struct CreateRuleBindingResponse { + #[prost(string, tag = "1")] + pub rule_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub object_id: ::prost::alloc::string::String, + #[prost(bool, tag = "3")] + pub cascading: bool, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectAuthorsRequest { - /// Project id +pub struct DeleteRuleBindingRequest { #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, - /// Add authors - #[prost(message, repeated, tag = "2")] - pub add_authors: ::prost::alloc::vec::Vec, - /// Remove authors - #[prost(message, repeated, tag = "3")] - pub remove_authors: ::prost::alloc::vec::Vec, + pub rule_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub object_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectAuthorsResponse { - /// The updated project - #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, -} +pub struct DeleteRuleBindingResponse {} /// Generated client implementations. -pub mod project_service_client { +pub mod rules_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// ProjectService + /// RulesService /// /// Status: BETA /// - /// Contains all methods that get/create or update Projects and associated resources + /// Contains all methods to edit and change rules #[derive(Debug, Clone)] - pub struct ProjectServiceClient { + pub struct RulesServiceClient { inner: tonic::client::Grpc, } - impl ProjectServiceClient { + impl RulesServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -18163,7 +17974,7 @@ pub mod project_service_client { Ok(Self::new(conn)) } } - impl ProjectServiceClient + impl RulesServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -18181,7 +17992,7 @@ pub mod project_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> ProjectServiceClient> + ) -> RulesServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -18195,7 +18006,7 @@ pub mod project_service_client { http::Request, >>::Error: Into + Send + Sync, { - ProjectServiceClient::new(InterceptedService::new(inner, interceptor)) + RulesServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -18228,191 +18039,16 @@ pub mod project_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// CreateProject - /// - /// Status: BETA - /// - /// Creates a new project. All subsequent resources are part of a project. - pub async fn create_project( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/CreateProject", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "CreateProject", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetProject - /// - /// Status: BETA - /// - /// Requests a project (by id) - pub async fn get_project( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/GetProject", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "GetProject", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetProjects - /// - /// Status: BETA - /// - /// Admin request to get all projects - pub async fn get_projects( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/GetProjects", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "GetProjects", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeleteProject - /// - /// Status: BETA - /// - /// Deletes the project and all its associated data. Must be empty! - pub async fn delete_project( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/DeleteProject", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "DeleteProject", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateProjectName - /// - /// Status: BETA - /// - /// Updates the project name. Caveat! Will rename the "s3 bucket" for data proxies! - pub async fn update_project_name( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectName", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "UpdateProjectName", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateProjectDescription + /// CreateRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the project name. - pub async fn update_project_description( + /// Create a new rule + pub async fn create_rule( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -18426,28 +18062,28 @@ pub mod project_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectDescription", + "/aruna.api.storage.services.v2.RulesService/CreateRule", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "UpdateProjectDescription", + "aruna.api.storage.services.v2.RulesService", + "CreateRule", ), ); self.inner.unary(req, path, codec).await } - /// UpdateProjectKeyValues + /// GetRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the project key values. - pub async fn update_project_key_values( + /// Gets an existing rule + pub async fn get_rule( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -18461,28 +18097,28 @@ pub mod project_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectKeyValues", + "/aruna.api.storage.services.v2.RulesService/GetRule", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "UpdateProjectKeyValues", + "aruna.api.storage.services.v2.RulesService", + "GetRule", ), ); self.inner.unary(req, path, codec).await } - /// UpdateProjectDataClass + /// ListRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the project name. All (meta) data will be overwritten. - pub async fn update_project_data_class( + /// Lists rules -> Owned and public rules + pub async fn list_rule( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -18496,28 +18132,28 @@ pub mod project_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectDataClass", + "/aruna.api.storage.services.v2.RulesService/ListRule", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "UpdateProjectDataClass", + "aruna.api.storage.services.v2.RulesService", + "ListRule", ), ); self.inner.unary(req, path, codec).await } - /// UpdateLicense + /// UpdateRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the project license. All (meta) data will be overwritten. - pub async fn update_project_licenses( + /// Updates an existing rule + pub async fn update_rule( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -18531,28 +18167,28 @@ pub mod project_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectLicenses", + "/aruna.api.storage.services.v2.RulesService/UpdateRule", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "UpdateProjectLicenses", + "aruna.api.storage.services.v2.RulesService", + "UpdateRule", ), ); self.inner.unary(req, path, codec).await } - /// ArchiveProjectRequest + /// DeleteRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Archives the full project, rendering all downstream relations immutable - pub async fn archive_project( + /// Deletes an existing rule + pub async fn delete_rule( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -18566,28 +18202,28 @@ pub mod project_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/ArchiveProject", + "/aruna.api.storage.services.v2.RulesService/DeleteRule", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "ArchiveProject", + "aruna.api.storage.services.v2.RulesService", + "DeleteRule", ), ); self.inner.unary(req, path, codec).await } - /// UpdateTitle + /// CreateRuleBinding /// /// Status: ALPHA /// - /// This method updates the title of a project - pub async fn update_project_title( + /// Associates a rule with an object, optionally cascading the rule to all children + pub async fn create_rule_binding( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -18601,28 +18237,28 @@ pub mod project_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectTitle", + "/aruna.api.storage.services.v2.RulesService/CreateRuleBinding", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "UpdateProjectTitle", + "aruna.api.storage.services.v2.RulesService", + "CreateRuleBinding", ), ); self.inner.unary(req, path, codec).await } - /// UpdateAuthors + /// DeleteRuleBinding /// /// Status: ALPHA /// - /// This method updates the authors of an object - pub async fn update_project_authors( + /// Disassociates a rule from an object + pub async fn delete_rule_binding( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -18636,14 +18272,14 @@ pub mod project_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectAuthors", + "/aruna.api.storage.services.v2.RulesService/DeleteRuleBinding", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "UpdateProjectAuthors", + "aruna.api.storage.services.v2.RulesService", + "DeleteRuleBinding", ), ); self.inner.unary(req, path, codec).await @@ -18651,164 +18287,101 @@ pub mod project_service_client { } } /// Generated server implementations. -pub mod project_service_server { +pub mod rules_service_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with ProjectServiceServer. + /// Generated trait containing gRPC methods that should be implemented for use with RulesServiceServer. #[async_trait] - pub trait ProjectService: Send + Sync + 'static { - /// CreateProject - /// - /// Status: BETA - /// - /// Creates a new project. All subsequent resources are part of a project. - async fn create_project( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetProject - /// - /// Status: BETA - /// - /// Requests a project (by id) - async fn get_project( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetProjects - /// - /// Status: BETA - /// - /// Admin request to get all projects - async fn get_projects( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteProject - /// - /// Status: BETA - /// - /// Deletes the project and all its associated data. Must be empty! - async fn delete_project( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateProjectName - /// - /// Status: BETA - /// - /// Updates the project name. Caveat! Will rename the "s3 bucket" for data proxies! - async fn update_project_name( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateProjectDescription + pub trait RulesService: Send + Sync + 'static { + /// CreateRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the project name. - async fn update_project_description( + /// Create a new rule + async fn create_rule( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateProjectKeyValues + /// GetRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the project key values. - async fn update_project_key_values( + /// Gets an existing rule + async fn get_rule( &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateProjectDataClass + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// ListRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the project name. All (meta) data will be overwritten. - async fn update_project_data_class( + /// Lists rules -> Owned and public rules + async fn list_rule( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateLicense + /// UpdateRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the project license. All (meta) data will be overwritten. - async fn update_project_licenses( + /// Updates an existing rule + async fn update_rule( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ArchiveProjectRequest + /// DeleteRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Archives the full project, rendering all downstream relations immutable - async fn archive_project( + /// Deletes an existing rule + async fn delete_rule( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateTitle + /// CreateRuleBinding /// /// Status: ALPHA /// - /// This method updates the title of a project - async fn update_project_title( + /// Associates a rule with an object, optionally cascading the rule to all children + async fn create_rule_binding( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateAuthors + /// DeleteRuleBinding /// /// Status: ALPHA /// - /// This method updates the authors of an object - async fn update_project_authors( + /// Disassociates a rule from an object + async fn delete_rule_binding( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// ProjectService + /// RulesService /// /// Status: BETA /// - /// Contains all methods that get/create or update Projects and associated resources + /// Contains all methods to edit and change rules #[derive(Debug)] - pub struct ProjectServiceServer { + pub struct RulesServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -18816,7 +18389,7 @@ pub mod project_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl ProjectServiceServer { + impl RulesServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -18868,9 +18441,9 @@ pub mod project_service_server { self } } - impl tonic::codegen::Service> for ProjectServiceServer + impl tonic::codegen::Service> for RulesServiceServer where - T: ProjectService, + T: RulesService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -18886,25 +18459,25 @@ pub mod project_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.ProjectService/CreateProject" => { + "/aruna.api.storage.services.v2.RulesService/CreateRule" => { #[allow(non_camel_case_types)] - struct CreateProjectSvc(pub Arc); + struct CreateRuleSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for CreateProjectSvc { - type Response = super::CreateProjectResponse; + T: RulesService, + > tonic::server::UnaryService + for CreateRuleSvc { + type Response = super::CreateRuleResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_project(&inner, request).await + ::create_rule(&inner, request).await }; Box::pin(fut) } @@ -18916,7 +18489,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateProjectSvc(inner); + let method = CreateRuleSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -18932,25 +18505,25 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/GetProject" => { + "/aruna.api.storage.services.v2.RulesService/GetRule" => { #[allow(non_camel_case_types)] - struct GetProjectSvc(pub Arc); + struct GetRuleSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for GetProjectSvc { - type Response = super::GetProjectResponse; + T: RulesService, + > tonic::server::UnaryService + for GetRuleSvc { + type Response = super::GetRuleResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_project(&inner, request).await + ::get_rule(&inner, request).await }; Box::pin(fut) } @@ -18962,7 +18535,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetProjectSvc(inner); + let method = GetRuleSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -18978,25 +18551,25 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/GetProjects" => { + "/aruna.api.storage.services.v2.RulesService/ListRule" => { #[allow(non_camel_case_types)] - struct GetProjectsSvc(pub Arc); + struct ListRuleSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for GetProjectsSvc { - type Response = super::GetProjectsResponse; + T: RulesService, + > tonic::server::UnaryService + for ListRuleSvc { + type Response = super::ListRuleResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_projects(&inner, request).await + ::list_rule(&inner, request).await }; Box::pin(fut) } @@ -19008,7 +18581,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetProjectsSvc(inner); + let method = ListRuleSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -19024,25 +18597,25 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/DeleteProject" => { + "/aruna.api.storage.services.v2.RulesService/UpdateRule" => { #[allow(non_camel_case_types)] - struct DeleteProjectSvc(pub Arc); + struct UpdateRuleSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for DeleteProjectSvc { - type Response = super::DeleteProjectResponse; + T: RulesService, + > tonic::server::UnaryService + for UpdateRuleSvc { + type Response = super::UpdateRuleResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_project(&inner, request).await + ::update_rule(&inner, request).await }; Box::pin(fut) } @@ -19054,7 +18627,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteProjectSvc(inner); + let method = UpdateRuleSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -19070,26 +18643,25 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectName" => { + "/aruna.api.storage.services.v2.RulesService/DeleteRule" => { #[allow(non_camel_case_types)] - struct UpdateProjectNameSvc(pub Arc); + struct DeleteRuleSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for UpdateProjectNameSvc { - type Response = super::UpdateProjectNameResponse; + T: RulesService, + > tonic::server::UnaryService + for DeleteRuleSvc { + type Response = super::DeleteRuleResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_project_name(&inner, request) - .await + ::delete_rule(&inner, request).await }; Box::pin(fut) } @@ -19101,7 +18673,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateProjectNameSvc(inner); + let method = DeleteRuleSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -19117,30 +18689,25 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectDescription" => { + "/aruna.api.storage.services.v2.RulesService/CreateRuleBinding" => { #[allow(non_camel_case_types)] - struct UpdateProjectDescriptionSvc(pub Arc); + struct CreateRuleBindingSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for UpdateProjectDescriptionSvc { - type Response = super::UpdateProjectDescriptionResponse; + T: RulesService, + > tonic::server::UnaryService + for CreateRuleBindingSvc { + type Response = super::CreateRuleBindingResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::UpdateProjectDescriptionRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_project_description( - &inner, - request, - ) + ::create_rule_binding(&inner, request) .await }; Box::pin(fut) @@ -19153,7 +18720,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateProjectDescriptionSvc(inner); + let method = CreateRuleBindingSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -19169,28 +18736,25 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectKeyValues" => { + "/aruna.api.storage.services.v2.RulesService/DeleteRuleBinding" => { #[allow(non_camel_case_types)] - struct UpdateProjectKeyValuesSvc(pub Arc); + struct DeleteRuleBindingSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for UpdateProjectKeyValuesSvc { - type Response = super::UpdateProjectKeyValuesResponse; + T: RulesService, + > tonic::server::UnaryService + for DeleteRuleBindingSvc { + type Response = super::DeleteRuleBindingResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_project_key_values( - &inner, - request, - ) + ::delete_rule_binding(&inner, request) .await }; Box::pin(fut) @@ -19203,7 +18767,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateProjectKeyValuesSvc(inner); + let method = DeleteRuleBindingSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -19219,78 +18783,515 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectDataClass" => { - #[allow(non_camel_case_types)] - struct UpdateProjectDataClassSvc(pub Arc); - impl< - T: ProjectService, - > tonic::server::UnaryService - for UpdateProjectDataClassSvc { - type Response = super::UpdateProjectDataClassResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::update_project_data_class( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = UpdateProjectDataClassSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) } - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectLicenses" => { + } + } + } + impl Clone for RulesServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for RulesServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.RulesService"; + } +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SearchResourcesRequest { + #[prost(string, tag = "1")] + pub query: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub filter: ::prost::alloc::string::String, + #[prost(int64, tag = "3")] + pub limit: i64, + #[prost(int64, tag = "4")] + pub offset: i64, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SearchResourcesResponse { + /// Json list for each found resource + #[prost(message, repeated, tag = "1")] + pub resources: ::prost::alloc::vec::Vec, + /// How many results are expected to be found ? + #[prost(int64, tag = "2")] + pub estimated_total: i64, + /// The last index returned + #[prost(int64, tag = "3")] + pub last_index: i64, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetResourceRequest { + #[prost(string, tag = "1")] + pub resource_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ResourceWithPermission { + #[prost(message, optional, tag = "1")] + pub resource: ::core::option::Option, + #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "2")] + pub permission: i32, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetResourceResponse { + #[prost(message, optional, tag = "1")] + pub resource: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetResourcesRequest { + #[prost(string, repeated, tag = "1")] + pub resource_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetResourcesResponse { + #[prost(message, repeated, tag = "1")] + pub resources: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RequestResourceAccessRequest { + #[prost(string, tag = "1")] + pub resource_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub message: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RequestResourceAccessResponse {} +/// Generated client implementations. +pub mod search_service_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /// SearchService + /// + /// Status: BETA + /// + /// SearchService is used to query resources in the index and get a public view of them. + #[derive(Debug, Clone)] + pub struct SearchServiceClient { + inner: tonic::client::Grpc, + } + impl SearchServiceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl SearchServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> SearchServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + SearchServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// SearchResources + /// + /// Status: BETA + /// + /// Searches the index for applicable resources (only public + private can be searched) + pub async fn search_resources( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.SearchService/SearchResources", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.SearchService", + "SearchResources", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetResource + /// + /// Status: BETA + /// + /// Retrieves resource by its ID. + pub async fn get_resource( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.SearchService/GetResource", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.SearchService", + "GetResource", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetResources + /// + /// Status: BETA + /// + /// Retrieves resources by a list of IDs. + pub async fn get_resources( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.SearchService/GetResources", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.SearchService", + "GetResources", + ), + ); + self.inner.unary(req, path, codec).await + } + /// RequestResourceAccess + /// + /// Status: ALPHA + /// + /// Requests access to resources + pub async fn request_resource_access( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.SearchService/RequestResourceAccess", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.SearchService", + "RequestResourceAccess", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod search_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with SearchServiceServer. + #[async_trait] + pub trait SearchService: Send + Sync + 'static { + /// SearchResources + /// + /// Status: BETA + /// + /// Searches the index for applicable resources (only public + private can be searched) + async fn search_resources( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetResource + /// + /// Status: BETA + /// + /// Retrieves resource by its ID. + async fn get_resource( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetResources + /// + /// Status: BETA + /// + /// Retrieves resources by a list of IDs. + async fn get_resources( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// RequestResourceAccess + /// + /// Status: ALPHA + /// + /// Requests access to resources + async fn request_resource_access( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// SearchService + /// + /// Status: BETA + /// + /// SearchService is used to query resources in the index and get a public view of them. + #[derive(Debug)] + pub struct SearchServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl SearchServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for SearchServiceServer + where + T: SearchService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/aruna.api.storage.services.v2.SearchService/SearchResources" => { #[allow(non_camel_case_types)] - struct UpdateProjectLicensesSvc(pub Arc); + struct SearchResourcesSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for UpdateProjectLicensesSvc { - type Response = super::UpdateProjectLicensesResponse; + T: SearchService, + > tonic::server::UnaryService + for SearchResourcesSvc { + type Response = super::SearchResourcesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_project_licenses( - &inner, - request, - ) + ::search_resources(&inner, request) .await }; Box::pin(fut) @@ -19303,7 +19304,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateProjectLicensesSvc(inner); + let method = SearchResourcesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -19319,26 +19320,25 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/ArchiveProject" => { + "/aruna.api.storage.services.v2.SearchService/GetResource" => { #[allow(non_camel_case_types)] - struct ArchiveProjectSvc(pub Arc); + struct GetResourceSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for ArchiveProjectSvc { - type Response = super::ArchiveProjectResponse; + T: SearchService, + > tonic::server::UnaryService + for GetResourceSvc { + type Response = super::GetResourceResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::archive_project(&inner, request) - .await + ::get_resource(&inner, request).await }; Box::pin(fut) } @@ -19350,7 +19350,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ArchiveProjectSvc(inner); + let method = GetResourceSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -19366,26 +19366,25 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectTitle" => { + "/aruna.api.storage.services.v2.SearchService/GetResources" => { #[allow(non_camel_case_types)] - struct UpdateProjectTitleSvc(pub Arc); + struct GetResourcesSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for UpdateProjectTitleSvc { - type Response = super::UpdateProjectTitleResponse; + T: SearchService, + > tonic::server::UnaryService + for GetResourcesSvc { + type Response = super::GetResourcesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_project_title(&inner, request) - .await + ::get_resources(&inner, request).await }; Box::pin(fut) } @@ -19397,7 +19396,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateProjectTitleSvc(inner); + let method = GetResourcesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -19413,25 +19412,25 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectAuthors" => { + "/aruna.api.storage.services.v2.SearchService/RequestResourceAccess" => { #[allow(non_camel_case_types)] - struct UpdateProjectAuthorsSvc(pub Arc); + struct RequestResourceAccessSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for UpdateProjectAuthorsSvc { - type Response = super::UpdateProjectAuthorsResponse; + T: SearchService, + > tonic::server::UnaryService + for RequestResourceAccessSvc { + type Response = super::RequestResourceAccessResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_project_authors( + ::request_resource_access( &inner, request, ) @@ -19447,7 +19446,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateProjectAuthorsSvc(inner); + let method = RequestResourceAccessSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -19478,7 +19477,7 @@ pub mod project_service_server { } } } - impl Clone for ProjectServiceServer { + impl Clone for SearchServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -19490,7 +19489,7 @@ pub mod project_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -19500,7 +19499,7 @@ pub mod project_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for ProjectServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.ProjectService"; + impl tonic::server::NamedService for SearchServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.SearchService"; } } diff --git a/src/aruna/google.api.rs b/src/aruna/google.api.rs index ceb2028..a075656 100644 --- a/src/aruna/google.api.rs +++ b/src/aruna/google.api.rs @@ -1,4 +1,3 @@ -// This file is @generated by prost-build. /// Defines the HTTP configuration for an API service. It contains a list of /// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method /// to one or more HTTP REST API methods. diff --git a/src/aruna/grpc.gateway.protoc_gen_openapiv2.options.rs b/src/aruna/grpc.gateway.protoc_gen_openapiv2.options.rs index 030f6ea..dee292a 100644 --- a/src/aruna/grpc.gateway.protoc_gen_openapiv2.options.rs +++ b/src/aruna/grpc.gateway.protoc_gen_openapiv2.options.rs @@ -1,4 +1,3 @@ -// This file is @generated by prost-build. /// `Swagger` is a representation of OpenAPI v2 specification's Swagger object. /// /// See: diff --git a/src/aruna_no_transport/aruna.api.dataproxy.services.v2.rs b/src/aruna_no_transport/aruna.api.dataproxy.services.v2.rs index 8f7c728..03ca364 100644 --- a/src/aruna_no_transport/aruna.api.dataproxy.services.v2.rs +++ b/src/aruna_no_transport/aruna.api.dataproxy.services.v2.rs @@ -1,4 +1,3 @@ -// This file is @generated by prost-build. #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/src/aruna_no_transport/aruna.api.health.v2.rs b/src/aruna_no_transport/aruna.api.health.v2.rs index dce59d8..e03783e 100644 --- a/src/aruna_no_transport/aruna.api.health.v2.rs +++ b/src/aruna_no_transport/aruna.api.health.v2.rs @@ -1,4 +1,3 @@ -// This file is @generated by prost-build. #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/src/aruna_no_transport/aruna.api.hooks.services.v2.rs b/src/aruna_no_transport/aruna.api.hooks.services.v2.rs index aba0194..4a77e4c 100644 --- a/src/aruna_no_transport/aruna.api.hooks.services.v2.rs +++ b/src/aruna_no_transport/aruna.api.hooks.services.v2.rs @@ -1,4 +1,3 @@ -// This file is @generated by prost-build. #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/src/aruna_no_transport/aruna.api.notification.services.v2.rs b/src/aruna_no_transport/aruna.api.notification.services.v2.rs index ea2364e..ca5da27 100644 --- a/src/aruna_no_transport/aruna.api.notification.services.v2.rs +++ b/src/aruna_no_transport/aruna.api.notification.services.v2.rs @@ -1,4 +1,3 @@ -// This file is @generated by prost-build. #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/src/aruna_no_transport/aruna.api.storage.models.v2.rs b/src/aruna_no_transport/aruna.api.storage.models.v2.rs index d5451de..efb338a 100644 --- a/src/aruna_no_transport/aruna.api.storage.models.v2.rs +++ b/src/aruna_no_transport/aruna.api.storage.models.v2.rs @@ -1,4 +1,3 @@ -// This file is @generated by prost-build. /// ------------- USERS & PERMISSIONS ----------------------- #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/src/aruna_no_transport/aruna.api.storage.services.v2.rs b/src/aruna_no_transport/aruna.api.storage.services.v2.rs index d163bad..9496b09 100644 --- a/src/aruna_no_transport/aruna.api.storage.services.v2.rs +++ b/src/aruna_no_transport/aruna.api.storage.services.v2.rs @@ -1,143 +1,243 @@ -// This file is @generated by prost-build. #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateRuleRequest { +pub struct CreateCollectionRequest { + /// collection name #[prost(string, tag = "1")] - pub rule: ::prost::alloc::string::String, + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "9")] + pub title: ::prost::alloc::string::String, + /// description #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, - #[prost(bool, tag = "3")] - pub public: bool, + /// collection specific labels / hooks + #[prost(message, repeated, tag = "3")] + pub key_values: ::prost::alloc::vec::Vec, + /// Internal /External relations (URLs / IDs from external sources) + #[prost(message, repeated, tag = "4")] + pub relations: ::prost::alloc::vec::Vec, + /// DataClass + #[prost(enumeration = "super::super::models::v2::DataClass", tag = "5")] + pub data_class: i32, + #[prost(string, optional, tag = "7")] + pub metadata_license_tag: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag = "8")] + pub default_data_license_tag: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "10")] + pub authors: ::prost::alloc::vec::Vec, + /// Parent_id MUST be project + #[prost(oneof = "create_collection_request::Parent", tags = "6")] + pub parent: ::core::option::Option, +} +/// Nested message and enum types in `CreateCollectionRequest`. +pub mod create_collection_request { + /// Parent_id MUST be project + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Parent { + #[prost(string, tag = "6")] + ProjectId(::prost::alloc::string::String), + } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateRuleResponse { +pub struct CreateCollectionResponse { + /// The new collection_id + #[prost(message, optional, tag = "1")] + pub collection: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetCollectionRequest { + /// Requested id #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, + pub collection_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetRuleRequest { +pub struct GetCollectionResponse { + /// Overview of the requested collection + #[prost(message, optional, tag = "1")] + pub collection: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetCollectionsRequest { + #[prost(string, repeated, tag = "1")] + pub collection_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetCollectionsResponse { + /// List of collection overviews + #[prost(message, repeated, tag = "1")] + pub collections: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteCollectionRequest { #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, + pub collection_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct Rule { +pub struct DeleteCollectionResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateCollectionNameRequest { #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, + pub collection_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateCollectionNameResponse { + #[prost(message, optional, tag = "1")] + pub collection: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateCollectionDescriptionRequest { + #[prost(string, tag = "1")] + pub collection_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] - pub rule: ::prost::alloc::string::String, - #[prost(string, tag = "3")] pub description: ::prost::alloc::string::String, - #[prost(bool, tag = "4")] - pub public: bool, - #[prost(string, tag = "5")] - pub owner: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetRuleResponse { +pub struct UpdateCollectionDescriptionResponse { #[prost(message, optional, tag = "1")] - pub rule: ::core::option::Option, + pub collection: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListRuleRequest {} +pub struct UpdateCollectionKeyValuesRequest { + #[prost(string, tag = "1")] + pub collection_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub add_key_values: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub remove_key_values: ::prost::alloc::vec::Vec, +} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListRuleResponse { - #[prost(message, repeated, tag = "1")] - pub rules: ::prost::alloc::vec::Vec, +pub struct UpdateCollectionKeyValuesResponse { + #[prost(message, optional, tag = "1")] + pub collection: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateRuleRequest { +pub struct UpdateCollectionDataClassRequest { #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub rule: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub description: ::prost::alloc::string::String, - #[prost(bool, tag = "4")] - pub public: bool, + pub collection_id: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::DataClass", tag = "2")] + pub data_class: i32, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateRuleResponse { +pub struct UpdateCollectionDataClassResponse { #[prost(message, optional, tag = "1")] - pub rule: ::core::option::Option, + pub collection: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteRuleRequest { +pub struct SnapshotCollectionRequest { #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, + pub collection_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteRuleResponse {} +pub struct SnapshotCollectionResponse { + /// This collection will be returned via an Persistent Identifier! Updates will be impossible + #[prost(message, optional, tag = "1")] + pub collection: ::core::option::Option, +} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateRuleBindingRequest { +pub struct UpdateCollectionLicensesRequest { #[prost(string, tag = "1")] - pub rule_id: ::prost::alloc::string::String, + pub collection_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] - pub object_id: ::prost::alloc::string::String, - #[prost(bool, tag = "3")] - pub cascading: bool, + pub metadata_license_tag: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub default_data_license_tag: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateRuleBindingResponse { +pub struct UpdateCollectionLicensesResponse { + #[prost(message, optional, tag = "1")] + pub collection: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateCollectionTitleRequest { #[prost(string, tag = "1")] - pub rule_id: ::prost::alloc::string::String, + pub collection_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] - pub object_id: ::prost::alloc::string::String, - #[prost(bool, tag = "3")] - pub cascading: bool, + pub title: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteRuleBindingRequest { +pub struct UpdateCollectionTitleResponse { + #[prost(message, optional, tag = "1")] + pub collection: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateCollectionAuthorsRequest { #[prost(string, tag = "1")] - pub rule_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub object_id: ::prost::alloc::string::String, + pub collection_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub add_authors: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub remove_authors: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteRuleBindingResponse {} +pub struct UpdateCollectionAuthorsResponse { + #[prost(message, optional, tag = "1")] + pub collection: ::core::option::Option, +} /// Generated client implementations. -pub mod rules_service_client { +pub mod collection_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// RulesService + /// CollectionService /// /// Status: BETA /// - /// Contains all methods to edit and change rules + /// Contains all methods that get/create or update Collection and associated resources #[derive(Debug, Clone)] - pub struct RulesServiceClient { + pub struct CollectionServiceClient { inner: tonic::client::Grpc, } - impl RulesServiceClient + impl CollectionServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -155,7 +255,7 @@ pub mod rules_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> RulesServiceClient> + ) -> CollectionServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -169,7 +269,7 @@ pub mod rules_service_client { http::Request, >>::Error: Into + Send + Sync, { - RulesServiceClient::new(InterceptedService::new(inner, interceptor)) + CollectionServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -202,16 +302,16 @@ pub mod rules_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// CreateRule + /// CreateNewCollection /// - /// Status: ALPHA + /// Status: BETA /// - /// Create a new rule - pub async fn create_rule( + /// creates a new Collection + pub async fn create_collection( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -225,28 +325,28 @@ pub mod rules_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.RulesService/CreateRule", + "/aruna.api.storage.services.v2.CollectionService/CreateCollection", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.RulesService", - "CreateRule", + "aruna.api.storage.services.v2.CollectionService", + "CreateCollection", ), ); self.inner.unary(req, path, codec).await } - /// GetRule + /// GetCollection /// - /// Status: ALPHA + /// Status: BETA /// - /// Gets an existing rule - pub async fn get_rule( + /// Request a specific collection by ID + pub async fn get_collection( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -260,28 +360,28 @@ pub mod rules_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.RulesService/GetRule", + "/aruna.api.storage.services.v2.CollectionService/GetCollection", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.RulesService", - "GetRule", + "aruna.api.storage.services.v2.CollectionService", + "GetCollection", ), ); self.inner.unary(req, path, codec).await } - /// ListRule + /// GetCollections /// - /// Status: ALPHA + /// Status: BETA /// - /// Lists rules -> Owned and public rules - pub async fn list_rule( + /// Queries multiple collections by ID + pub async fn get_collections( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -295,28 +395,28 @@ pub mod rules_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.RulesService/ListRule", + "/aruna.api.storage.services.v2.CollectionService/GetCollections", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.RulesService", - "ListRule", + "aruna.api.storage.services.v2.CollectionService", + "GetCollections", ), ); self.inner.unary(req, path, codec).await } - /// UpdateRule + /// DeleteCollection /// - /// Status: ALPHA + /// Status: STABLE /// - /// Updates an existing rule - pub async fn update_rule( + /// This request deletes the collection. + pub async fn delete_collection( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -330,28 +430,28 @@ pub mod rules_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.RulesService/UpdateRule", + "/aruna.api.storage.services.v2.CollectionService/DeleteCollection", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.RulesService", - "UpdateRule", + "aruna.api.storage.services.v2.CollectionService", + "DeleteCollection", ), ); self.inner.unary(req, path, codec).await } - /// DeleteRule + /// UpdateCollectionName /// - /// Status: ALPHA + /// Status: BETA /// - /// Deletes an existing rule - pub async fn delete_rule( + /// Updates the collection name. Caveat! Will rename the "s3 bucket" for data proxies! + pub async fn update_collection_name( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -365,28 +465,28 @@ pub mod rules_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.RulesService/DeleteRule", + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionName", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.RulesService", - "DeleteRule", + "aruna.api.storage.services.v2.CollectionService", + "UpdateCollectionName", ), ); self.inner.unary(req, path, codec).await } - /// CreateRuleBinding + /// UpdateCollectionDescription /// - /// Status: ALPHA + /// Status: BETA /// - /// Associates a rule with an object, optionally cascading the rule to all children - pub async fn create_rule_binding( + /// Updates the collection description. + pub async fn update_collection_description( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -400,28 +500,28 @@ pub mod rules_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.RulesService/CreateRuleBinding", + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionDescription", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.RulesService", - "CreateRuleBinding", + "aruna.api.storage.services.v2.CollectionService", + "UpdateCollectionDescription", ), ); self.inner.unary(req, path, codec).await } - /// DeleteRuleBinding + /// UpdateCollectionKeyValues /// - /// Status: ALPHA + /// Status: BETA /// - /// Disassociates a rule from an object - pub async fn delete_rule_binding( + /// Updates the collection key values. + pub async fn update_collection_key_values( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -435,116 +535,354 @@ pub mod rules_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.RulesService/DeleteRuleBinding", + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionKeyValues", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.RulesService", - "DeleteRuleBinding", + "aruna.api.storage.services.v2.CollectionService", + "UpdateCollectionKeyValues", ), ); self.inner.unary(req, path, codec).await } - } -} -/// Generated server implementations. -pub mod rules_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with RulesServiceServer. - #[async_trait] - pub trait RulesService: Send + Sync + 'static { - /// CreateRule + /// UpdateCollectionDataClass /// - /// Status: ALPHA + /// Status: BETA /// - /// Create a new rule - async fn create_rule( - &self, - request: tonic::Request, + /// Updates the collection name. All (meta) data will be overwritten. + pub async fn update_collection_data_class( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// GetRule + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionDataClass", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.CollectionService", + "UpdateCollectionDataClass", + ), + ); + self.inner.unary(req, path, codec).await + } + /// SnapshotCollectionRequest /// - /// Status: ALPHA + /// Status: BETA /// - /// Gets an existing rule - async fn get_rule( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// ListRule + /// Archives the full collection, rendering all downstream relations immutable + pub async fn snapshot_collection( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.CollectionService/SnapshotCollection", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.CollectionService", + "SnapshotCollection", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateLicenses /// - /// Status: ALPHA + /// Status: BETA /// - /// Lists rules -> Owned and public rules - async fn list_rule( - &self, - request: tonic::Request, + /// Updates the collections metadata license and/or default data license. + pub async fn update_collection_licenses( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// UpdateRule + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionLicenses", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.CollectionService", + "UpdateCollectionLicenses", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateTitle /// /// Status: ALPHA /// - /// Updates an existing rule - async fn update_rule( - &self, - request: tonic::Request, + /// Updates the collections metadata title. + pub async fn update_collection_title( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// DeleteRule + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionTitle", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.CollectionService", + "UpdateCollectionTitle", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateAuthors /// /// Status: ALPHA /// - /// Deletes an existing rule - async fn delete_rule( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, + /// Updates the collections metadata title. + pub async fn update_collection_authors( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionAuthors", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.CollectionService", + "UpdateCollectionAuthors", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod collection_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with CollectionServiceServer. + #[async_trait] + pub trait CollectionService: Send + Sync + 'static { + /// CreateNewCollection + /// + /// Status: BETA + /// + /// creates a new Collection + async fn create_collection( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, tonic::Status, >; - /// CreateRuleBinding + /// GetCollection + /// + /// Status: BETA + /// + /// Request a specific collection by ID + async fn get_collection( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetCollections + /// + /// Status: BETA + /// + /// Queries multiple collections by ID + async fn get_collections( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteCollection + /// + /// Status: STABLE + /// + /// This request deletes the collection. + async fn delete_collection( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateCollectionName + /// + /// Status: BETA + /// + /// Updates the collection name. Caveat! Will rename the "s3 bucket" for data proxies! + async fn update_collection_name( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateCollectionDescription + /// + /// Status: BETA + /// + /// Updates the collection description. + async fn update_collection_description( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateCollectionKeyValues + /// + /// Status: BETA + /// + /// Updates the collection key values. + async fn update_collection_key_values( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateCollectionDataClass + /// + /// Status: BETA + /// + /// Updates the collection name. All (meta) data will be overwritten. + async fn update_collection_data_class( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// SnapshotCollectionRequest + /// + /// Status: BETA + /// + /// Archives the full collection, rendering all downstream relations immutable + async fn snapshot_collection( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateLicenses + /// + /// Status: BETA + /// + /// Updates the collections metadata license and/or default data license. + async fn update_collection_licenses( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateTitle /// /// Status: ALPHA /// - /// Associates a rule with an object, optionally cascading the rule to all children - async fn create_rule_binding( + /// Updates the collections metadata title. + async fn update_collection_title( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// DeleteRuleBinding + /// UpdateAuthors /// /// Status: ALPHA /// - /// Disassociates a rule from an object - async fn delete_rule_binding( + /// Updates the collections metadata title. + async fn update_collection_authors( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// RulesService + /// CollectionService /// /// Status: BETA /// - /// Contains all methods to edit and change rules + /// Contains all methods that get/create or update Collection and associated resources #[derive(Debug)] - pub struct RulesServiceServer { + pub struct CollectionServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -552,7 +890,7 @@ pub mod rules_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl RulesServiceServer { + impl CollectionServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -604,9 +942,9 @@ pub mod rules_service_server { self } } - impl tonic::codegen::Service> for RulesServiceServer + impl tonic::codegen::Service> for CollectionServiceServer where - T: RulesService, + T: CollectionService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -622,25 +960,26 @@ pub mod rules_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.RulesService/CreateRule" => { + "/aruna.api.storage.services.v2.CollectionService/CreateCollection" => { #[allow(non_camel_case_types)] - struct CreateRuleSvc(pub Arc); + struct CreateCollectionSvc(pub Arc); impl< - T: RulesService, - > tonic::server::UnaryService - for CreateRuleSvc { - type Response = super::CreateRuleResponse; + T: CollectionService, + > tonic::server::UnaryService + for CreateCollectionSvc { + type Response = super::CreateCollectionResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_rule(&inner, request).await + ::create_collection(&inner, request) + .await }; Box::pin(fut) } @@ -652,7 +991,7 @@ pub mod rules_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateRuleSvc(inner); + let method = CreateCollectionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -668,25 +1007,26 @@ pub mod rules_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.RulesService/GetRule" => { + "/aruna.api.storage.services.v2.CollectionService/GetCollection" => { #[allow(non_camel_case_types)] - struct GetRuleSvc(pub Arc); + struct GetCollectionSvc(pub Arc); impl< - T: RulesService, - > tonic::server::UnaryService - for GetRuleSvc { - type Response = super::GetRuleResponse; + T: CollectionService, + > tonic::server::UnaryService + for GetCollectionSvc { + type Response = super::GetCollectionResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_rule(&inner, request).await + ::get_collection(&inner, request) + .await }; Box::pin(fut) } @@ -698,7 +1038,7 @@ pub mod rules_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetRuleSvc(inner); + let method = GetCollectionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -714,25 +1054,26 @@ pub mod rules_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.RulesService/ListRule" => { + "/aruna.api.storage.services.v2.CollectionService/GetCollections" => { #[allow(non_camel_case_types)] - struct ListRuleSvc(pub Arc); + struct GetCollectionsSvc(pub Arc); impl< - T: RulesService, - > tonic::server::UnaryService - for ListRuleSvc { - type Response = super::ListRuleResponse; + T: CollectionService, + > tonic::server::UnaryService + for GetCollectionsSvc { + type Response = super::GetCollectionsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::list_rule(&inner, request).await + ::get_collections(&inner, request) + .await }; Box::pin(fut) } @@ -744,7 +1085,7 @@ pub mod rules_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ListRuleSvc(inner); + let method = GetCollectionsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -760,25 +1101,26 @@ pub mod rules_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.RulesService/UpdateRule" => { + "/aruna.api.storage.services.v2.CollectionService/DeleteCollection" => { #[allow(non_camel_case_types)] - struct UpdateRuleSvc(pub Arc); + struct DeleteCollectionSvc(pub Arc); impl< - T: RulesService, - > tonic::server::UnaryService - for UpdateRuleSvc { - type Response = super::UpdateRuleResponse; + T: CollectionService, + > tonic::server::UnaryService + for DeleteCollectionSvc { + type Response = super::DeleteCollectionResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_rule(&inner, request).await + ::delete_collection(&inner, request) + .await }; Box::pin(fut) } @@ -790,7 +1132,7 @@ pub mod rules_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateRuleSvc(inner); + let method = DeleteCollectionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -806,25 +1148,29 @@ pub mod rules_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.RulesService/DeleteRule" => { + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionName" => { #[allow(non_camel_case_types)] - struct DeleteRuleSvc(pub Arc); + struct UpdateCollectionNameSvc(pub Arc); impl< - T: RulesService, - > tonic::server::UnaryService - for DeleteRuleSvc { - type Response = super::DeleteRuleResponse; + T: CollectionService, + > tonic::server::UnaryService + for UpdateCollectionNameSvc { + type Response = super::UpdateCollectionNameResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_rule(&inner, request).await + ::update_collection_name( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -836,7 +1182,7 @@ pub mod rules_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteRuleSvc(inner); + let method = UpdateCollectionNameSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -852,25 +1198,33 @@ pub mod rules_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.RulesService/CreateRuleBinding" => { + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionDescription" => { #[allow(non_camel_case_types)] - struct CreateRuleBindingSvc(pub Arc); + struct UpdateCollectionDescriptionSvc( + pub Arc, + ); impl< - T: RulesService, - > tonic::server::UnaryService - for CreateRuleBindingSvc { - type Response = super::CreateRuleBindingResponse; + T: CollectionService, + > tonic::server::UnaryService< + super::UpdateCollectionDescriptionRequest, + > for UpdateCollectionDescriptionSvc { + type Response = super::UpdateCollectionDescriptionResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::UpdateCollectionDescriptionRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_rule_binding(&inner, request) + ::update_collection_description( + &inner, + request, + ) .await }; Box::pin(fut) @@ -883,7 +1237,7 @@ pub mod rules_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateRuleBindingSvc(inner); + let method = UpdateCollectionDescriptionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -899,25 +1253,33 @@ pub mod rules_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.RulesService/DeleteRuleBinding" => { + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionKeyValues" => { #[allow(non_camel_case_types)] - struct DeleteRuleBindingSvc(pub Arc); + struct UpdateCollectionKeyValuesSvc( + pub Arc, + ); impl< - T: RulesService, - > tonic::server::UnaryService - for DeleteRuleBindingSvc { - type Response = super::DeleteRuleBindingResponse; + T: CollectionService, + > tonic::server::UnaryService< + super::UpdateCollectionKeyValuesRequest, + > for UpdateCollectionKeyValuesSvc { + type Response = super::UpdateCollectionKeyValuesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::UpdateCollectionKeyValuesRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_rule_binding(&inner, request) + ::update_collection_key_values( + &inner, + request, + ) .await }; Box::pin(fut) @@ -930,7 +1292,7 @@ pub mod rules_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteRuleBindingSvc(inner); + let method = UpdateCollectionKeyValuesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -946,154 +1308,514 @@ pub mod rules_service_server { }; Box::pin(fut) } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionDataClass" => { + #[allow(non_camel_case_types)] + struct UpdateCollectionDataClassSvc( + pub Arc, + ); + impl< + T: CollectionService, + > tonic::server::UnaryService< + super::UpdateCollectionDataClassRequest, + > for UpdateCollectionDataClassSvc { + type Response = super::UpdateCollectionDataClassResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::UpdateCollectionDataClassRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_collection_data_class( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateCollectionDataClassSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) } - } - } - } - impl Clone for RulesServiceServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for RulesServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.RulesService"; - } -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UserPermission { - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub user_name: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "3")] - pub permission_level: i32, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ResourceAuthorization { - #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub user_permission: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateAuthorizationRequest { - #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub user_id: ::prost::alloc::string::String, - /// Can also include "deny" - #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "3")] - pub permission_level: i32, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateAuthorizationResponse { - #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub user_id: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub user_name: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "4")] - pub permission_level: i32, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAuthorizationsRequest { - #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, - #[prost(bool, tag = "2")] - pub recursive: bool, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAuthorizationsResponse { - #[prost(message, repeated, tag = "1")] - pub authorizations: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteAuthorizationRequest { - #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub user_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteAuthorizationResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateAuthorizationRequest { - #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub user_id: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "3")] - pub permission_level: i32, + "/aruna.api.storage.services.v2.CollectionService/SnapshotCollection" => { + #[allow(non_camel_case_types)] + struct SnapshotCollectionSvc(pub Arc); + impl< + T: CollectionService, + > tonic::server::UnaryService + for SnapshotCollectionSvc { + type Response = super::SnapshotCollectionResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::snapshot_collection( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SnapshotCollectionSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionLicenses" => { + #[allow(non_camel_case_types)] + struct UpdateCollectionLicensesSvc(pub Arc); + impl< + T: CollectionService, + > tonic::server::UnaryService + for UpdateCollectionLicensesSvc { + type Response = super::UpdateCollectionLicensesResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::UpdateCollectionLicensesRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_collection_licenses( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateCollectionLicensesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionTitle" => { + #[allow(non_camel_case_types)] + struct UpdateCollectionTitleSvc(pub Arc); + impl< + T: CollectionService, + > tonic::server::UnaryService + for UpdateCollectionTitleSvc { + type Response = super::UpdateCollectionTitleResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_collection_title( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateCollectionTitleSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionAuthors" => { + #[allow(non_camel_case_types)] + struct UpdateCollectionAuthorsSvc(pub Arc); + impl< + T: CollectionService, + > tonic::server::UnaryService + for UpdateCollectionAuthorsSvc { + type Response = super::UpdateCollectionAuthorsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::UpdateCollectionAuthorsRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_collection_authors( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateCollectionAuthorsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for CollectionServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService + for CollectionServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.CollectionService"; + } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateAuthorizationResponse { - #[prost(message, optional, tag = "1")] - pub user_permission: ::core::option::Option, -} +pub struct GetStorageVersionRequest {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SemanticVersion { + /// Complete version string + #[prost(string, tag = "1")] + pub version_string: ::prost::alloc::string::String, + /// Semver according to + #[prost(int32, tag = "2")] + pub major: i32, + #[prost(int32, tag = "3")] + pub minor: i32, + #[prost(int32, tag = "4")] + pub patch: i32, + #[prost(string, tag = "5")] + pub labels: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LocationVersion { + /// Status of a specific Location e.g Gießen / dataproxy / 0.5.0-beta.1 + #[prost(string, tag = "1")] + pub location: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub version: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ComponentVersion { + /// Name of a specific component e.g. server, dataproxy etc. and their status by location + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub version: ::core::option::Option, +} +/// Version of each component by location +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetStorageVersionResponse { + #[prost(message, repeated, tag = "1")] + pub location_version: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetStorageStatusRequest {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LocationStatus { + /// Status of a specific Location e.g Gießen / AVAILABLE + #[prost(string, tag = "1")] + pub location: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub component_status: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ComponentStatus { + /// Name of a specific component e.g. server, dataproxy etc. and their status by location + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::ComponentStatus", tag = "2")] + pub status: i32, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetStorageStatusResponse { + /// List of all locations and their component / status + #[prost(message, repeated, tag = "1")] + pub location_status: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetPubkeysRequest {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetPubkeysResponse { + #[prost(message, repeated, tag = "1")] + pub pubkeys: ::prost::alloc::vec::Vec, +} +/// ------------------------------------- +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Announcement { + /// Announcement id + #[prost(string, tag = "1")] + pub announcement_id: ::prost::alloc::string::String, + /// Announcement type + #[prost(enumeration = "super::super::models::v2::AnnouncementType", tag = "2")] + pub announcement_type: i32, + /// Announcement title + #[prost(string, tag = "3")] + pub title: ::prost::alloc::string::String, + /// Short announcement summary + #[prost(string, tag = "4")] + pub teaser: ::prost::alloc::string::String, + /// URL for announcement preview image + #[prost(string, tag = "5")] + pub image_url: ::prost::alloc::string::String, + /// Announcement content text + #[prost(string, tag = "6")] + pub content: ::prost::alloc::string::String, + /// Initial announcement author + #[prost(string, tag = "7")] + pub created_by: ::prost::alloc::string::String, + /// Initial creation timestamp + #[prost(message, optional, tag = "8")] + pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>, + /// Author responsible for the last modification + #[prost(string, tag = "9")] + pub modified_by: ::prost::alloc::string::String, + /// Last modification timestamp + #[prost(message, optional, tag = "10")] + pub modified_at: ::core::option::Option<::prost_wkt_types::Timestamp>, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SetAnnouncementsRequest { + #[prost(message, repeated, tag = "1")] + pub announcements_upsert: ::prost::alloc::vec::Vec, + #[prost(string, repeated, tag = "2")] + pub announcements_delete: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SetAnnouncementsResponse { + #[prost(message, repeated, tag = "1")] + pub announcements: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAnnouncementsRequest { + #[prost(string, repeated, tag = "1")] + pub announcement_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, optional, tag = "2")] + pub page: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAnnouncementsResponse { + #[prost(message, repeated, tag = "1")] + pub announcements: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAnnouncementsByTypeRequest { + #[prost(enumeration = "super::super::models::v2::AnnouncementType", tag = "1")] + pub announcement_type: i32, + #[prost(message, optional, tag = "2")] + pub page: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAnnouncementsByTypeResponse { + #[prost(message, repeated, tag = "1")] + pub announcements: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAnnouncementRequest { + #[prost(string, tag = "1")] + pub announcement_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAnnouncementResponse { + #[prost(message, optional, tag = "1")] + pub announcement: ::core::option::Option, +} /// Generated client implementations. -pub mod authorization_service_client { +pub mod storage_status_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// AuthorizationService + /// StorageStatusService /// /// Status: BETA /// - /// Contains all methods to edit and change user authorization + /// This is a generic service that contains utility functions + /// these functions are used to query additional meta-information + /// about the status of storage components #[derive(Debug, Clone)] - pub struct AuthorizationServiceClient { + pub struct StorageStatusServiceClient { inner: tonic::client::Grpc, } - impl AuthorizationServiceClient + impl StorageStatusServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -1111,7 +1833,7 @@ pub mod authorization_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> AuthorizationServiceClient> + ) -> StorageStatusServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -1125,7 +1847,7 @@ pub mod authorization_service_client { http::Request, >>::Error: Into + Send + Sync, { - AuthorizationServiceClient::new(InterceptedService::new(inner, interceptor)) + StorageStatusServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -1158,17 +1880,17 @@ pub mod authorization_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// CreateAuthorization + /// GetStorageVersion /// /// Status: BETA /// - /// This creates a user-specific attribute that handles permission for a - /// specific resource - pub async fn create_authorization( + /// A request to get the current version of the server application + /// String representation and https://semver.org/ + pub async fn get_storage_version( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1182,28 +1904,28 @@ pub mod authorization_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.AuthorizationService/CreateAuthorization", + "/aruna.api.storage.services.v2.StorageStatusService/GetStorageVersion", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.AuthorizationService", - "CreateAuthorization", + "aruna.api.storage.services.v2.StorageStatusService", + "GetStorageVersion", ), ); self.inner.unary(req, path, codec).await } - /// GetAuthorization + /// GetStorageStatus /// - /// Status: BETA + /// Status: ALPHA /// - /// This gets resource specific user authorizations - pub async fn get_authorizations( + /// A request to get the current status of the storage components by location(s) + pub async fn get_storage_status( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1217,29 +1939,28 @@ pub mod authorization_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.AuthorizationService/GetAuthorizations", + "/aruna.api.storage.services.v2.StorageStatusService/GetStorageStatus", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.AuthorizationService", - "GetAuthorizations", + "aruna.api.storage.services.v2.StorageStatusService", + "GetStorageStatus", ), ); self.inner.unary(req, path, codec).await } - /// DeleteAuthorization + /// GetPubkeys /// /// Status: BETA /// - /// This deletes a user-specific attribute that handles permission for a - /// specific resource - pub async fn delete_authorization( + /// Get all public keys of all storage components + pub async fn get_pubkeys( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1253,29 +1974,30 @@ pub mod authorization_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.AuthorizationService/DeleteAuthorization", + "/aruna.api.storage.services.v2.StorageStatusService/GetPubkeys", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.AuthorizationService", - "DeleteAuthorization", + "aruna.api.storage.services.v2.StorageStatusService", + "GetPubkeys", ), ); self.inner.unary(req, path, codec).await } - /// UpdateAuthorization + /// Get Announcements /// /// Status: BETA /// - /// This creates a user-specific attribute that handles permission for a - /// specific resource - pub async fn update_authorization( + /// Query global announcements optionally filtered by specific ids. + /// - Returns all announcements if no ids are provided + /// - Returns only the specific announcements if ids are provided + pub async fn get_announcements( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1289,14 +2011,119 @@ pub mod authorization_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.AuthorizationService/UpdateAuthorization", + "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncements", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.AuthorizationService", - "UpdateAuthorization", + "aruna.api.storage.services.v2.StorageStatusService", + "GetAnnouncements", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetAnnouncementsByType + /// + /// Status: BETA + /// + /// Query global announcements by type + pub async fn get_announcements_by_type( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncementsByType", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.StorageStatusService", + "GetAnnouncementsByType", + ), + ); + self.inner.unary(req, path, codec).await + } + /// Get a specific Announcement + /// + /// Status: BETA + /// + /// Query a specific global announcement by its id + pub async fn get_announcement( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncement", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.StorageStatusService", + "GetAnnouncement", + ), + ); + self.inner.unary(req, path, codec).await + } + /// SetAnnouncements + /// + /// Status: BETA + /// + /// Update / add global announcements + pub async fn set_announcements( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.StorageStatusService/SetAnnouncements", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.StorageStatusService", + "SetAnnouncements", ), ); self.inner.unary(req, path, codec).await @@ -1304,71 +2131,109 @@ pub mod authorization_service_client { } } /// Generated server implementations. -pub mod authorization_service_server { +pub mod storage_status_service_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with AuthorizationServiceServer. + /// Generated trait containing gRPC methods that should be implemented for use with StorageStatusServiceServer. #[async_trait] - pub trait AuthorizationService: Send + Sync + 'static { - /// CreateAuthorization + pub trait StorageStatusService: Send + Sync + 'static { + /// GetStorageVersion /// /// Status: BETA /// - /// This creates a user-specific attribute that handles permission for a - /// specific resource - async fn create_authorization( + /// A request to get the current version of the server application + /// String representation and https://semver.org/ + async fn get_storage_version( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetAuthorization + /// GetStorageStatus + /// + /// Status: ALPHA + /// + /// A request to get the current status of the storage components by location(s) + async fn get_storage_status( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetPubkeys /// /// Status: BETA /// - /// This gets resource specific user authorizations - async fn get_authorizations( + /// Get all public keys of all storage components + async fn get_pubkeys( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// DeleteAuthorization + /// Get Announcements /// /// Status: BETA /// - /// This deletes a user-specific attribute that handles permission for a - /// specific resource - async fn delete_authorization( + /// Query global announcements optionally filtered by specific ids. + /// - Returns all announcements if no ids are provided + /// - Returns only the specific announcements if ids are provided + async fn get_announcements( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateAuthorization + /// GetAnnouncementsByType /// /// Status: BETA /// - /// This creates a user-specific attribute that handles permission for a - /// specific resource - async fn update_authorization( + /// Query global announcements by type + async fn get_announcements_by_type( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, + tonic::Status, + >; + /// Get a specific Announcement + /// + /// Status: BETA + /// + /// Query a specific global announcement by its id + async fn get_announcement( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// SetAnnouncements + /// + /// Status: BETA + /// + /// Update / add global announcements + async fn set_announcements( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, tonic::Status, >; } - /// AuthorizationService + /// StorageStatusService /// /// Status: BETA /// - /// Contains all methods to edit and change user authorization + /// This is a generic service that contains utility functions + /// these functions are used to query additional meta-information + /// about the status of storage components #[derive(Debug)] - pub struct AuthorizationServiceServer { + pub struct StorageStatusServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -1376,7 +2241,7 @@ pub mod authorization_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl AuthorizationServiceServer { + impl StorageStatusServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -1429,9 +2294,9 @@ pub mod authorization_service_server { } } impl tonic::codegen::Service> - for AuthorizationServiceServer + for StorageStatusServiceServer where - T: AuthorizationService, + T: StorageStatusService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -1447,25 +2312,25 @@ pub mod authorization_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.AuthorizationService/CreateAuthorization" => { + "/aruna.api.storage.services.v2.StorageStatusService/GetStorageVersion" => { #[allow(non_camel_case_types)] - struct CreateAuthorizationSvc(pub Arc); + struct GetStorageVersionSvc(pub Arc); impl< - T: AuthorizationService, - > tonic::server::UnaryService - for CreateAuthorizationSvc { - type Response = super::CreateAuthorizationResponse; + T: StorageStatusService, + > tonic::server::UnaryService + for GetStorageVersionSvc { + type Response = super::GetStorageVersionResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_authorization( + ::get_storage_version( &inner, request, ) @@ -1481,7 +2346,7 @@ pub mod authorization_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateAuthorizationSvc(inner); + let method = GetStorageVersionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1497,25 +2362,25 @@ pub mod authorization_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.AuthorizationService/GetAuthorizations" => { + "/aruna.api.storage.services.v2.StorageStatusService/GetStorageStatus" => { #[allow(non_camel_case_types)] - struct GetAuthorizationsSvc(pub Arc); + struct GetStorageStatusSvc(pub Arc); impl< - T: AuthorizationService, - > tonic::server::UnaryService - for GetAuthorizationsSvc { - type Response = super::GetAuthorizationsResponse; + T: StorageStatusService, + > tonic::server::UnaryService + for GetStorageStatusSvc { + type Response = super::GetStorageStatusResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_authorizations( + ::get_storage_status( &inner, request, ) @@ -1531,7 +2396,7 @@ pub mod authorization_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetAuthorizationsSvc(inner); + let method = GetStorageStatusSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1547,25 +2412,72 @@ pub mod authorization_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.AuthorizationService/DeleteAuthorization" => { + "/aruna.api.storage.services.v2.StorageStatusService/GetPubkeys" => { #[allow(non_camel_case_types)] - struct DeleteAuthorizationSvc(pub Arc); + struct GetPubkeysSvc(pub Arc); impl< - T: AuthorizationService, - > tonic::server::UnaryService - for DeleteAuthorizationSvc { - type Response = super::DeleteAuthorizationResponse; + T: StorageStatusService, + > tonic::server::UnaryService + for GetPubkeysSvc { + type Response = super::GetPubkeysResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_authorization( + ::get_pubkeys(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetPubkeysSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncements" => { + #[allow(non_camel_case_types)] + struct GetAnnouncementsSvc(pub Arc); + impl< + T: StorageStatusService, + > tonic::server::UnaryService + for GetAnnouncementsSvc { + type Response = super::GetAnnouncementsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_announcements( &inner, request, ) @@ -1581,7 +2493,7 @@ pub mod authorization_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteAuthorizationSvc(inner); + let method = GetAnnouncementsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1597,25 +2509,27 @@ pub mod authorization_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.AuthorizationService/UpdateAuthorization" => { + "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncementsByType" => { #[allow(non_camel_case_types)] - struct UpdateAuthorizationSvc(pub Arc); + struct GetAnnouncementsByTypeSvc( + pub Arc, + ); impl< - T: AuthorizationService, - > tonic::server::UnaryService - for UpdateAuthorizationSvc { - type Response = super::UpdateAuthorizationResponse; + T: StorageStatusService, + > tonic::server::UnaryService + for GetAnnouncementsByTypeSvc { + type Response = super::GetAnnouncementsByTypeResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_authorization( + ::get_announcements_by_type( &inner, request, ) @@ -1631,7 +2545,107 @@ pub mod authorization_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateAuthorizationSvc(inner); + let method = GetAnnouncementsByTypeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncement" => { + #[allow(non_camel_case_types)] + struct GetAnnouncementSvc(pub Arc); + impl< + T: StorageStatusService, + > tonic::server::UnaryService + for GetAnnouncementSvc { + type Response = super::GetAnnouncementResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_announcement( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetAnnouncementSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.StorageStatusService/SetAnnouncements" => { + #[allow(non_camel_case_types)] + struct SetAnnouncementsSvc(pub Arc); + impl< + T: StorageStatusService, + > tonic::server::UnaryService + for SetAnnouncementsSvc { + type Response = super::SetAnnouncementsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::set_announcements( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SetAnnouncementsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1662,7 +2676,7 @@ pub mod authorization_service_server { } } } - impl Clone for AuthorizationServiceServer { + impl Clone for StorageStatusServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1674,7 +2688,7 @@ pub mod authorization_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -1684,103 +2698,251 @@ pub mod authorization_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService - for AuthorizationServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.AuthorizationService"; + impl tonic::server::NamedService + for StorageStatusServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.StorageStatusService"; } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct SearchResourcesRequest { +pub struct CreateDatasetRequest { + /// dataset name #[prost(string, tag = "1")] - pub query: ::prost::alloc::string::String, + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "10")] + pub title: ::prost::alloc::string::String, + /// Description #[prost(string, tag = "2")] - pub filter: ::prost::alloc::string::String, - #[prost(int64, tag = "3")] - pub limit: i64, - #[prost(int64, tag = "4")] - pub offset: i64, + pub description: ::prost::alloc::string::String, + /// dataset specific labels / hooks + #[prost(message, repeated, tag = "3")] + pub key_values: ::prost::alloc::vec::Vec, + /// Internal / External relations (URLs / IDs from external sources) + #[prost(message, repeated, tag = "4")] + pub relations: ::prost::alloc::vec::Vec, + /// DataClass + #[prost(enumeration = "super::super::models::v2::DataClass", tag = "5")] + pub data_class: i32, + #[prost(string, optional, tag = "8")] + pub metadata_license_tag: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag = "9")] + pub default_data_license_tag: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "11")] + pub authors: ::prost::alloc::vec::Vec, + /// Parent_id MUST be dataset + #[prost(oneof = "create_dataset_request::Parent", tags = "6, 7")] + pub parent: ::core::option::Option, +} +/// Nested message and enum types in `CreateDatasetRequest`. +pub mod create_dataset_request { + /// Parent_id MUST be dataset + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Parent { + #[prost(string, tag = "6")] + ProjectId(::prost::alloc::string::String), + #[prost(string, tag = "7")] + CollectionId(::prost::alloc::string::String), + } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct SearchResourcesResponse { - /// Json list for each found resource - #[prost(message, repeated, tag = "1")] - pub resources: ::prost::alloc::vec::Vec, - /// How many results are expected to be found ? - #[prost(int64, tag = "2")] - pub estimated_total: i64, - /// The last index returned - #[prost(int64, tag = "3")] - pub last_index: i64, +pub struct CreateDatasetResponse { + /// The new dataset_id + #[prost(message, optional, tag = "1")] + pub dataset: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetResourceRequest { +pub struct GetDatasetRequest { + /// Requested id #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, + pub dataset_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ResourceWithPermission { +pub struct GetDatasetResponse { + /// Overview of the requested dataset #[prost(message, optional, tag = "1")] - pub resource: ::core::option::Option, - #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "2")] - pub permission: i32, + pub dataset: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetResourceResponse { +pub struct GetDatasetsRequest { + #[prost(string, repeated, tag = "1")] + pub dataset_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetDatasetsResponse { + /// List of dataset overviews + #[prost(message, repeated, tag = "1")] + pub datasets: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteDatasetRequest { + #[prost(string, tag = "1")] + pub dataset_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteDatasetResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetNameRequest { + #[prost(string, tag = "1")] + pub dataset_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetNameResponse { #[prost(message, optional, tag = "1")] - pub resource: ::core::option::Option, + pub dataset: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetResourcesRequest { - #[prost(string, repeated, tag = "1")] - pub resource_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +pub struct UpdateDatasetDescriptionRequest { + #[prost(string, tag = "1")] + pub dataset_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetResourcesResponse { - #[prost(message, repeated, tag = "1")] - pub resources: ::prost::alloc::vec::Vec, +pub struct UpdateDatasetDescriptionResponse { + #[prost(message, optional, tag = "1")] + pub dataset: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct RequestResourceAccessRequest { +pub struct UpdateDatasetKeyValuesRequest { #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, + pub dataset_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub add_key_values: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub remove_key_values: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetKeyValuesResponse { + #[prost(message, optional, tag = "1")] + pub dataset: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetDataClassRequest { + #[prost(string, tag = "1")] + pub dataset_id: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::DataClass", tag = "2")] + pub data_class: i32, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetDataClassResponse { + #[prost(message, optional, tag = "1")] + pub dataset: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SnapshotDatasetRequest { + #[prost(string, tag = "1")] + pub dataset_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SnapshotDatasetResponse { + /// This dataset will be returned via an Persistent Identifier! Updates will be impossible + #[prost(message, optional, tag = "1")] + pub dataset: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetLicensesRequest { + #[prost(string, tag = "1")] + pub dataset_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] - pub message: ::prost::alloc::string::String, + pub metadata_license_tag: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub default_data_license_tag: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct RequestResourceAccessResponse {} +pub struct UpdateDatasetLicensesResponse { + #[prost(message, optional, tag = "1")] + pub dataset: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetTitleRequest { + #[prost(string, tag = "1")] + pub dataset_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub title: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetTitleResponse { + #[prost(message, optional, tag = "1")] + pub dataset: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetAuthorsRequest { + #[prost(string, tag = "1")] + pub dataset_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub add_authors: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub remove_authors: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateDatasetAuthorsResponse { + #[prost(message, optional, tag = "1")] + pub dataset: ::core::option::Option, +} /// Generated client implementations. -pub mod search_service_client { +pub mod dataset_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// SearchService - /// - /// Status: BETA + /// DatasetService /// - /// SearchService is used to query resources in the index and get a public view of them. + /// Contains all methods that get/create or update Dataset and associated resources #[derive(Debug, Clone)] - pub struct SearchServiceClient { + pub struct DatasetServiceClient { inner: tonic::client::Grpc, } - impl SearchServiceClient + impl DatasetServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -1798,7 +2960,7 @@ pub mod search_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> SearchServiceClient> + ) -> DatasetServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -1812,7 +2974,7 @@ pub mod search_service_client { http::Request, >>::Error: Into + Send + Sync, { - SearchServiceClient::new(InterceptedService::new(inner, interceptor)) + DatasetServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -1845,16 +3007,16 @@ pub mod search_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// SearchResources + /// CreateNewDataset /// /// Status: BETA /// - /// Searches the index for applicable resources (only public + private can be searched) - pub async fn search_resources( + /// creates a new Dataset + pub async fn create_dataset( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1868,28 +3030,28 @@ pub mod search_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.SearchService/SearchResources", + "/aruna.api.storage.services.v2.DatasetService/CreateDataset", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.SearchService", - "SearchResources", + "aruna.api.storage.services.v2.DatasetService", + "CreateDataset", ), ); self.inner.unary(req, path, codec).await } - /// GetResource + /// GetDataset /// /// Status: BETA /// - /// Retrieves resource by its ID. - pub async fn get_resource( + /// Request a specific dataset by ID + pub async fn get_dataset( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1903,28 +3065,28 @@ pub mod search_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.SearchService/GetResource", + "/aruna.api.storage.services.v2.DatasetService/GetDataset", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.SearchService", - "GetResource", + "aruna.api.storage.services.v2.DatasetService", + "GetDataset", ), ); self.inner.unary(req, path, codec).await } - /// GetResources + /// GetDatasets /// /// Status: BETA /// - /// Retrieves resources by a list of IDs. - pub async fn get_resources( + /// Queries multiple datasets by ID + pub async fn get_datasets( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1938,28 +3100,28 @@ pub mod search_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.SearchService/GetResources", + "/aruna.api.storage.services.v2.DatasetService/GetDatasets", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.SearchService", - "GetResources", + "aruna.api.storage.services.v2.DatasetService", + "GetDatasets", ), ); self.inner.unary(req, path, codec).await } - /// RequestResourceAccess + /// DeleteDataset /// - /// Status: ALPHA + /// Status: STABLE /// - /// Requests access to resources - pub async fn request_resource_access( + /// This request deletes the dataset. + pub async fn delete_dataset( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1973,1625 +3135,553 @@ pub mod search_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.SearchService/RequestResourceAccess", + "/aruna.api.storage.services.v2.DatasetService/DeleteDataset", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.SearchService", - "RequestResourceAccess", + "aruna.api.storage.services.v2.DatasetService", + "DeleteDataset", ), ); self.inner.unary(req, path, codec).await } - } -} -/// Generated server implementations. -pub mod search_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with SearchServiceServer. - #[async_trait] - pub trait SearchService: Send + Sync + 'static { - /// SearchResources + /// UpdateDatasetName /// /// Status: BETA /// - /// Searches the index for applicable resources (only public + private can be searched) - async fn search_resources( - &self, - request: tonic::Request, + /// Updates the dataset name. Caveat! Will rename the "s3 bucket" for data proxies! + pub async fn update_dataset_name( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// GetResource + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetName", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.DatasetService", + "UpdateDatasetName", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateDatasetDescription /// /// Status: BETA /// - /// Retrieves resource by its ID. - async fn get_resource( - &self, - request: tonic::Request, + /// Updates the dataset description. + pub async fn update_dataset_description( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// GetResources + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetDescription", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.DatasetService", + "UpdateDatasetDescription", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateDatasetKeyValues /// /// Status: BETA /// - /// Retrieves resources by a list of IDs. - async fn get_resources( - &self, - request: tonic::Request, + /// Updates the dataset key values. + pub async fn update_dataset_key_values( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// RequestResourceAccess + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetKeyValues", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.DatasetService", + "UpdateDatasetKeyValues", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateDatasetDataClass /// - /// Status: ALPHA + /// Status: BETA /// - /// Requests access to resources - async fn request_resource_access( - &self, - request: tonic::Request, + /// Updates the dataset name. All (meta) data will be overwritten. + pub async fn update_dataset_data_class( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - } - /// SearchService - /// - /// Status: BETA - /// - /// SearchService is used to query resources in the index and get a public view of them. - #[derive(Debug)] - pub struct SearchServiceServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl SearchServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetDataClass", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.DatasetService", + "UpdateDatasetDataClass", + ), + ); + self.inner.unary(req, path, codec).await } - /// Limits the maximum size of a decoded message. + /// SnapshotDatasetRequest /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. + /// Status: BETA /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for SearchServiceServer - where - T: SearchService, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( + /// Archives the full dataset, rendering all downstream relations immutable + pub async fn snapshot_dataset( &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/aruna.api.storage.services.v2.SearchService/SearchResources" => { - #[allow(non_camel_case_types)] - struct SearchResourcesSvc(pub Arc); - impl< - T: SearchService, - > tonic::server::UnaryService - for SearchResourcesSvc { - type Response = super::SearchResourcesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::search_resources(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = SearchResourcesSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.SearchService/GetResource" => { - #[allow(non_camel_case_types)] - struct GetResourceSvc(pub Arc); - impl< - T: SearchService, - > tonic::server::UnaryService - for GetResourceSvc { - type Response = super::GetResourceResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_resource(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetResourceSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.SearchService/GetResources" => { - #[allow(non_camel_case_types)] - struct GetResourcesSvc(pub Arc); - impl< - T: SearchService, - > tonic::server::UnaryService - for GetResourcesSvc { - type Response = super::GetResourcesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_resources(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetResourcesSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.SearchService/RequestResourceAccess" => { - #[allow(non_camel_case_types)] - struct RequestResourceAccessSvc(pub Arc); - impl< - T: SearchService, - > tonic::server::UnaryService - for RequestResourceAccessSvc { - type Response = super::RequestResourceAccessResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::request_resource_access( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = RequestResourceAccessSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } - } + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.DatasetService/SnapshotDataset", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.DatasetService", + "SnapshotDataset", + ), + ); + self.inner.unary(req, path, codec).await } - } - impl Clone for SearchServiceServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } + /// UpdateLicenses + /// + /// Status: BETA + /// + /// Updates the dataset metadata license and/or default data license. + pub async fn update_dataset_licenses( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetLicenses", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.DatasetService", + "UpdateDatasetLicenses", + ), + ); + self.inner.unary(req, path, codec).await } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) + /// UpdateTitle + /// + /// Status: ALPHA + /// + /// Updates the datasets metadata title. + pub async fn update_dataset_title( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetTitle", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.DatasetService", + "UpdateDatasetTitle", + ), + ); + self.inner.unary(req, path, codec).await } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) + /// UpdateAuthors + /// + /// Status: ALPHA + /// + /// Updates the datasets metadata title. + pub async fn update_dataset_authors( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetAuthors", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.DatasetService", + "UpdateDatasetAuthors", + ), + ); + self.inner.unary(req, path, codec).await } } - impl tonic::server::NamedService for SearchServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.SearchService"; - } -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateServiceAccountRequest { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub project_id: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "3")] - pub permission_level: i32, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ServiceAccount { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub permission: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateServiceAccountResponse { - #[prost(message, optional, tag = "1")] - pub service_account: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateServiceAccountTokenRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - /// Token permissions - #[prost(message, optional, tag = "2")] - pub permission: ::core::option::Option, - /// (optional) Token name - #[prost(string, tag = "3")] - pub name: ::prost::alloc::string::String, - /// (optional) Token expiry - #[prost(message, optional, tag = "4")] - pub expires_at: ::core::option::Option<::prost_wkt_types::Timestamp>, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateServiceAccountTokenResponse { - /// This contains only the token description - #[prost(message, optional, tag = "1")] - pub token: ::core::option::Option, - /// This is the actual secret API token - #[prost(string, tag = "2")] - pub token_secret: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetServiceAccountTokenRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub token_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetServiceAccountTokenResponse { - /// This contains only the token description - #[prost(message, optional, tag = "1")] - pub token: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetServiceAccountTokensRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetServiceAccountTokensResponse { - /// This contains only the token description - #[prost(message, repeated, tag = "1")] - pub tokens: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteServiceAccountTokenRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub token_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteServiceAccountTokenResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteServiceAccountTokensRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteServiceAccountTokensResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteServiceAccountRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteServiceAccountResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateS3CredentialsSvcAccountRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateS3CredentialsSvcAccountResponse { - #[prost(string, tag = "1")] - pub s3_access_key: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub s3_secret_key: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub s3_endpoint_url: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetS3CredentialsSvcAccountRequest { - /// If called as admin, an id must be provided - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetS3CredentialsSvcAccountResponse { - #[prost(string, tag = "1")] - pub s3_access_key: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub s3_secret_key: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub s3_endpoint_url: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteS3CredentialsSvcAccountRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, } -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteS3CredentialsSvcAccountResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateDataproxyTokenSvcAccountRequest { - /// Needs to be provided by project admins - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - /// optional context to limit the scope - #[prost(message, optional, tag = "3")] - pub context: ::core::option::Option, - #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateDataproxyTokenSvcAccountResponse { - #[prost(string, tag = "1")] - pub token: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddPubkeySvcAccountRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub public_key: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddPubkeySvcAccountResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddTrustedEndpointsSvcAccountRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddTrustedEndpointsSvcAccountResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveTrustedEndpointsSvcAccountRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveTrustedEndpointsSvcAccountResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddDataProxyAttributeSvcAccountRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub attribute: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddDataProxyAttributeSvcAccountResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveDataProxyAttributeSvcAccountRequest { - #[prost(string, tag = "1")] - pub svc_account_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub dataproxy_id: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub attribute_name: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveDataProxyAttributeSvcAccountResponse {} -/// Generated client implementations. -pub mod service_account_service_client { +/// Generated server implementations. +pub mod dataset_service_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// ServiceAccountService - /// - /// Status: BETA - /// - /// Service that contains CRUD operations for service_accounts. - /// Service accounts are project specific accounts that can be used for automation. - #[derive(Debug, Clone)] - pub struct ServiceAccountServiceClient { - inner: tonic::client::Grpc, - } - impl ServiceAccountServiceClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> ServiceAccountServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - ServiceAccountServiceClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// CreateServiceAccount + /// Generated trait containing gRPC methods that should be implemented for use with DatasetServiceServer. + #[async_trait] + pub trait DatasetService: Send + Sync + 'static { + /// CreateNewDataset /// /// Status: BETA /// - /// Creates a service account for a given project - /// If the service account has permissions for the global Admin project - /// it will be a global service account that can interact with any resource - pub async fn create_service_account( - &mut self, - request: impl tonic::IntoRequest, + /// creates a new Dataset + async fn create_dataset( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/CreateServiceAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "CreateServiceAccount", - ), - ); - self.inner.unary(req, path, codec).await - } - /// CreateServiceAccountToken + >; + /// GetDataset /// /// Status: BETA /// - /// Creates a token for a service account - /// Each service account can only have one permission -> The token will have the same permission as the - /// service account or a subset of it. - pub async fn create_service_account_token( - &mut self, - request: impl tonic::IntoRequest, + /// Request a specific dataset by ID + async fn get_dataset( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/CreateServiceAccountToken", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "CreateServiceAccountToken", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetServiceAccountToken + >; + /// GetDatasets /// /// Status: BETA /// - /// This requests the overall information about a specifc service account token (by id) - /// it will not contain the token itself. - pub async fn get_service_account_token( - &mut self, - request: impl tonic::IntoRequest, + /// Queries multiple datasets by ID + async fn get_datasets( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/GetServiceAccountToken", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "GetServiceAccountToken", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetServiceAccountTokens + >; + /// DeleteDataset + /// + /// Status: STABLE + /// + /// This request deletes the dataset. + async fn delete_dataset( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateDatasetName /// /// Status: BETA /// - /// This requests the overall information about all service account tokens - /// it will not contain the token itself. - pub async fn get_service_account_tokens( - &mut self, - request: impl tonic::IntoRequest, + /// Updates the dataset name. Caveat! Will rename the "s3 bucket" for data proxies! + async fn update_dataset_name( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/GetServiceAccountTokens", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "GetServiceAccountTokens", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeleteServiceAccountToken + >; + /// UpdateDatasetDescription /// /// Status: BETA /// - /// Deletes one service account token by ID - pub async fn delete_service_account_token( - &mut self, - request: impl tonic::IntoRequest, + /// Updates the dataset description. + async fn update_dataset_description( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccountToken", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "DeleteServiceAccountToken", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeleteServiceAccountTokens + >; + /// UpdateDatasetKeyValues /// /// Status: BETA /// - /// Deletes all service account tokens - pub async fn delete_service_account_tokens( - &mut self, - request: impl tonic::IntoRequest, + /// Updates the dataset key values. + async fn update_dataset_key_values( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccountTokens", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "DeleteServiceAccountTokens", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeleteServiceAccount + >; + /// UpdateDatasetDataClass /// /// Status: BETA /// - /// Deletes a service account (by id) - pub async fn delete_service_account( - &mut self, - request: impl tonic::IntoRequest, + /// Updates the dataset name. All (meta) data will be overwritten. + async fn update_dataset_data_class( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "DeleteServiceAccount", - ), - ); - self.inner.unary(req, path, codec).await - } - /// CreateS3CredentialsSvcAccount + >; + /// SnapshotDatasetRequest /// - /// Status: ALPHA + /// Status: BETA /// - /// Creates or updates S3 credentials for a specific SvcAccount and data_proxy - pub async fn create_s3_credentials_svc_account( - &mut self, - request: impl tonic::IntoRequest, + /// Archives the full dataset, rendering all downstream relations immutable + async fn snapshot_dataset( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/CreateS3CredentialsSvcAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "CreateS3CredentialsSvcAccount", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetS3CredentialsSvcAccount + >; + /// UpdateLicenses + /// + /// Status: BETA + /// + /// Updates the dataset metadata license and/or default data license. + async fn update_dataset_licenses( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateTitle /// /// Status: ALPHA /// - /// Gets S3 credentials for a specific svc_account and data_proxy - pub async fn get_s3_credentials_svc_account( - &mut self, - request: impl tonic::IntoRequest, + /// Updates the datasets metadata title. + async fn update_dataset_title( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/GetS3CredentialsSvcAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "GetS3CredentialsSvcAccount", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeleteS3CredentialsSvcAccount + >; + /// UpdateAuthors /// /// Status: ALPHA /// - /// Revokes existing S3 credentials for a specific user and data_proxy - pub async fn delete_s3_credentials_svc_account( - &mut self, - request: impl tonic::IntoRequest, + /// Updates the datasets metadata title. + async fn update_dataset_authors( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/DeleteS3CredentialsSvcAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "DeleteS3CredentialsSvcAccount", - ), - ); - self.inner.unary(req, path, codec).await + >; + } + /// DatasetService + /// + /// Contains all methods that get/create or update Dataset and associated resources + #[derive(Debug)] + pub struct DatasetServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl DatasetServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) } - /// GetDataproxyToken - /// - /// Status: ALPHA - /// - /// Gets token for a specific SvcAccount and data_proxy - pub async fn create_dataproxy_token_svc_account( - &mut self, - request: impl tonic::IntoRequest< - super::CreateDataproxyTokenSvcAccountRequest, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/CreateDataproxyTokenSvcAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "CreateDataproxyTokenSvcAccount", - ), - ); - self.inner.unary(req, path, codec).await + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } } - /// AddPubkeySvcAccount - /// - /// Status: ALPHA - /// - /// Adds an ED25519 public key for the SvcAccount - pub async fn add_pubkey_svc_account( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/AddPubkeySvcAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "AddPubkeySvcAccount", - ), - ); - self.inner.unary(req, path, codec).await + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) } - /// AddTrustedEndpointsSvcAccount - /// - /// Status: ALPHA - /// - /// Adds an endpoint to the trusted endpoints list of the SvcAccount - pub async fn add_trusted_endpoints_svc_account( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/AddTrustedEndpointsSvcAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "AddTrustedEndpointsSvcAccount", - ), - ); - self.inner.unary(req, path, codec).await + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self } - /// RemoveTrustedEndpointsSvcAccount - /// - /// Status: ALPHA - /// - /// Removes an endpoint from the trusted endpoints list of the SvcAccount - pub async fn remove_trusted_endpoints_svc_account( - &mut self, - request: impl tonic::IntoRequest< - super::RemoveTrustedEndpointsSvcAccountRequest, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/RemoveTrustedEndpointsSvcAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "RemoveTrustedEndpointsSvcAccount", - ), - ); - self.inner.unary(req, path, codec).await + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self } - /// AddDataProxyAttributeSvcAccount + /// Limits the maximum size of a decoded message. /// - /// Status: ALPHA + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. /// - /// Adds an data proxy specific attribute to the SvcAccount - pub async fn add_data_proxy_attribute_svc_account( - &mut self, - request: impl tonic::IntoRequest< - super::AddDataProxyAttributeSvcAccountRequest, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/AddDataProxyAttributeSvcAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "AddDataProxyAttributeSvcAccount", - ), - ); - self.inner.unary(req, path, codec).await + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self } - /// RemoveDataProxyAttributeSvcAccount - /// - /// Status: ALPHA - /// - /// Removes an data proxy specific attribute from the SvcAccount - pub async fn remove_data_proxy_attribute_svc_account( + } + impl tonic::codegen::Service> for DatasetServiceServer + where + T: DatasetService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( &mut self, - request: impl tonic::IntoRequest< - super::RemoveDataProxyAttributeSvcAccountRequest, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ServiceAccountService/RemoveDataProxyAttributeSvcAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ServiceAccountService", - "RemoveDataProxyAttributeSvcAccount", - ), - ); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod service_account_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with ServiceAccountServiceServer. - #[async_trait] - pub trait ServiceAccountService: Send + Sync + 'static { - /// CreateServiceAccount - /// - /// Status: BETA - /// - /// Creates a service account for a given project - /// If the service account has permissions for the global Admin project - /// it will be a global service account that can interact with any resource - async fn create_service_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// CreateServiceAccountToken - /// - /// Status: BETA - /// - /// Creates a token for a service account - /// Each service account can only have one permission -> The token will have the same permission as the - /// service account or a subset of it. - async fn create_service_account_token( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetServiceAccountToken - /// - /// Status: BETA - /// - /// This requests the overall information about a specifc service account token (by id) - /// it will not contain the token itself. - async fn get_service_account_token( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetServiceAccountTokens - /// - /// Status: BETA - /// - /// This requests the overall information about all service account tokens - /// it will not contain the token itself. - async fn get_service_account_tokens( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteServiceAccountToken - /// - /// Status: BETA - /// - /// Deletes one service account token by ID - async fn delete_service_account_token( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteServiceAccountTokens - /// - /// Status: BETA - /// - /// Deletes all service account tokens - async fn delete_service_account_tokens( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteServiceAccount - /// - /// Status: BETA - /// - /// Deletes a service account (by id) - async fn delete_service_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// CreateS3CredentialsSvcAccount - /// - /// Status: ALPHA - /// - /// Creates or updates S3 credentials for a specific SvcAccount and data_proxy - async fn create_s3_credentials_svc_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetS3CredentialsSvcAccount - /// - /// Status: ALPHA - /// - /// Gets S3 credentials for a specific svc_account and data_proxy - async fn get_s3_credentials_svc_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteS3CredentialsSvcAccount - /// - /// Status: ALPHA - /// - /// Revokes existing S3 credentials for a specific user and data_proxy - async fn delete_s3_credentials_svc_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetDataproxyToken - /// - /// Status: ALPHA - /// - /// Gets token for a specific SvcAccount and data_proxy - async fn create_dataproxy_token_svc_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AddPubkeySvcAccount - /// - /// Status: ALPHA - /// - /// Adds an ED25519 public key for the SvcAccount - async fn add_pubkey_svc_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AddTrustedEndpointsSvcAccount - /// - /// Status: ALPHA - /// - /// Adds an endpoint to the trusted endpoints list of the SvcAccount - async fn add_trusted_endpoints_svc_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// RemoveTrustedEndpointsSvcAccount - /// - /// Status: ALPHA - /// - /// Removes an endpoint from the trusted endpoints list of the SvcAccount - async fn remove_trusted_endpoints_svc_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AddDataProxyAttributeSvcAccount - /// - /// Status: ALPHA - /// - /// Adds an data proxy specific attribute to the SvcAccount - async fn add_data_proxy_attribute_svc_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// RemoveDataProxyAttributeSvcAccount - /// - /// Status: ALPHA - /// - /// Removes an data proxy specific attribute from the SvcAccount - async fn remove_data_proxy_attribute_svc_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// ServiceAccountService - /// - /// Status: BETA - /// - /// Service that contains CRUD operations for service_accounts. - /// Service accounts are project specific accounts that can be used for automation. - #[derive(Debug)] - pub struct ServiceAccountServiceServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl ServiceAccountServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> - for ServiceAccountServiceServer - where - T: ServiceAccountService, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.ServiceAccountService/CreateServiceAccount" => { + "/aruna.api.storage.services.v2.DatasetService/CreateDataset" => { #[allow(non_camel_case_types)] - struct CreateServiceAccountSvc(pub Arc); + struct CreateDatasetSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService - for CreateServiceAccountSvc { - type Response = super::CreateServiceAccountResponse; + T: DatasetService, + > tonic::server::UnaryService + for CreateDatasetSvc { + type Response = super::CreateDatasetResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_service_account( - &inner, - request, - ) - .await + ::create_dataset(&inner, request).await }; Box::pin(fut) } @@ -3603,7 +3693,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateServiceAccountSvc(inner); + let method = CreateDatasetSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3619,34 +3709,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/CreateServiceAccountToken" => { + "/aruna.api.storage.services.v2.DatasetService/GetDataset" => { #[allow(non_camel_case_types)] - struct CreateServiceAccountTokenSvc( - pub Arc, - ); + struct GetDatasetSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::CreateServiceAccountTokenRequest, - > for CreateServiceAccountTokenSvc { - type Response = super::CreateServiceAccountTokenResponse; + T: DatasetService, + > tonic::server::UnaryService + for GetDatasetSvc { + type Response = super::GetDatasetResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::CreateServiceAccountTokenRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_service_account_token( - &inner, - request, - ) - .await + ::get_dataset(&inner, request).await }; Box::pin(fut) } @@ -3658,7 +3739,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateServiceAccountTokenSvc(inner); + let method = GetDatasetSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3674,31 +3755,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/GetServiceAccountToken" => { + "/aruna.api.storage.services.v2.DatasetService/GetDatasets" => { #[allow(non_camel_case_types)] - struct GetServiceAccountTokenSvc( - pub Arc, - ); + struct GetDatasetsSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService - for GetServiceAccountTokenSvc { - type Response = super::GetServiceAccountTokenResponse; + T: DatasetService, + > tonic::server::UnaryService + for GetDatasetsSvc { + type Response = super::GetDatasetsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_service_account_token( - &inner, - request, - ) - .await + ::get_datasets(&inner, request).await }; Box::pin(fut) } @@ -3710,7 +3785,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetServiceAccountTokenSvc(inner); + let method = GetDatasetsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3726,33 +3801,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/GetServiceAccountTokens" => { + "/aruna.api.storage.services.v2.DatasetService/DeleteDataset" => { #[allow(non_camel_case_types)] - struct GetServiceAccountTokensSvc( - pub Arc, - ); + struct DeleteDatasetSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService - for GetServiceAccountTokensSvc { - type Response = super::GetServiceAccountTokensResponse; + T: DatasetService, + > tonic::server::UnaryService + for DeleteDatasetSvc { + type Response = super::DeleteDatasetResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::GetServiceAccountTokensRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_service_account_tokens( - &inner, - request, - ) - .await + ::delete_dataset(&inner, request).await }; Box::pin(fut) } @@ -3764,7 +3831,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetServiceAccountTokensSvc(inner); + let method = DeleteDatasetSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3780,33 +3847,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccountToken" => { + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetName" => { #[allow(non_camel_case_types)] - struct DeleteServiceAccountTokenSvc( - pub Arc, - ); + struct UpdateDatasetNameSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::DeleteServiceAccountTokenRequest, - > for DeleteServiceAccountTokenSvc { - type Response = super::DeleteServiceAccountTokenResponse; + T: DatasetService, + > tonic::server::UnaryService + for UpdateDatasetNameSvc { + type Response = super::UpdateDatasetNameResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::DeleteServiceAccountTokenRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_service_account_token( - &inner, - request, - ) + ::update_dataset_name(&inner, request) .await }; Box::pin(fut) @@ -3819,7 +3878,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteServiceAccountTokenSvc(inner); + let method = UpdateDatasetNameSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3835,17 +3894,14 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccountTokens" => { + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetDescription" => { #[allow(non_camel_case_types)] - struct DeleteServiceAccountTokensSvc( - pub Arc, - ); + struct UpdateDatasetDescriptionSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::DeleteServiceAccountTokensRequest, - > for DeleteServiceAccountTokensSvc { - type Response = super::DeleteServiceAccountTokensResponse; + T: DatasetService, + > tonic::server::UnaryService + for UpdateDatasetDescriptionSvc { + type Response = super::UpdateDatasetDescriptionResponse; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -3853,12 +3909,12 @@ pub mod service_account_service_server { fn call( &mut self, request: tonic::Request< - super::DeleteServiceAccountTokensRequest, + super::UpdateDatasetDescriptionRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_service_account_tokens( + ::update_dataset_description( &inner, request, ) @@ -3874,7 +3930,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteServiceAccountTokensSvc(inner); + let method = UpdateDatasetDescriptionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3890,25 +3946,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccount" => { + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetKeyValues" => { #[allow(non_camel_case_types)] - struct DeleteServiceAccountSvc(pub Arc); + struct UpdateDatasetKeyValuesSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService - for DeleteServiceAccountSvc { - type Response = super::DeleteServiceAccountResponse; + T: DatasetService, + > tonic::server::UnaryService + for UpdateDatasetKeyValuesSvc { + type Response = super::UpdateDatasetKeyValuesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_service_account( + ::update_dataset_key_values( &inner, request, ) @@ -3924,7 +3980,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteServiceAccountSvc(inner); + let method = UpdateDatasetKeyValuesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3940,30 +3996,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/CreateS3CredentialsSvcAccount" => { + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetDataClass" => { #[allow(non_camel_case_types)] - struct CreateS3CredentialsSvcAccountSvc( - pub Arc, - ); + struct UpdateDatasetDataClassSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::CreateS3CredentialsSvcAccountRequest, - > for CreateS3CredentialsSvcAccountSvc { - type Response = super::CreateS3CredentialsSvcAccountResponse; + T: DatasetService, + > tonic::server::UnaryService + for UpdateDatasetDataClassSvc { + type Response = super::UpdateDatasetDataClassResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::CreateS3CredentialsSvcAccountRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_s3_credentials_svc_account( + ::update_dataset_data_class( &inner, request, ) @@ -3979,7 +4030,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateS3CredentialsSvcAccountSvc(inner); + let method = UpdateDatasetDataClassSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3995,33 +4046,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/GetS3CredentialsSvcAccount" => { + "/aruna.api.storage.services.v2.DatasetService/SnapshotDataset" => { #[allow(non_camel_case_types)] - struct GetS3CredentialsSvcAccountSvc( - pub Arc, - ); + struct SnapshotDatasetSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::GetS3CredentialsSvcAccountRequest, - > for GetS3CredentialsSvcAccountSvc { - type Response = super::GetS3CredentialsSvcAccountResponse; + T: DatasetService, + > tonic::server::UnaryService + for SnapshotDatasetSvc { + type Response = super::SnapshotDatasetResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::GetS3CredentialsSvcAccountRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_s3_credentials_svc_account( - &inner, - request, - ) + ::snapshot_dataset(&inner, request) .await }; Box::pin(fut) @@ -4034,7 +4077,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetS3CredentialsSvcAccountSvc(inner); + let method = SnapshotDatasetSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4050,30 +4093,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/DeleteS3CredentialsSvcAccount" => { + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetLicenses" => { #[allow(non_camel_case_types)] - struct DeleteS3CredentialsSvcAccountSvc( - pub Arc, - ); + struct UpdateDatasetLicensesSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::DeleteS3CredentialsSvcAccountRequest, - > for DeleteS3CredentialsSvcAccountSvc { - type Response = super::DeleteS3CredentialsSvcAccountResponse; + T: DatasetService, + > tonic::server::UnaryService + for UpdateDatasetLicensesSvc { + type Response = super::UpdateDatasetLicensesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::DeleteS3CredentialsSvcAccountRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_s3_credentials_svc_account( + ::update_dataset_licenses( &inner, request, ) @@ -4089,7 +4127,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteS3CredentialsSvcAccountSvc(inner); + let method = UpdateDatasetLicensesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4105,33 +4143,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/CreateDataproxyTokenSvcAccount" => { + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetTitle" => { #[allow(non_camel_case_types)] - struct CreateDataproxyTokenSvcAccountSvc( - pub Arc, - ); + struct UpdateDatasetTitleSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::CreateDataproxyTokenSvcAccountRequest, - > for CreateDataproxyTokenSvcAccountSvc { - type Response = super::CreateDataproxyTokenSvcAccountResponse; + T: DatasetService, + > tonic::server::UnaryService + for UpdateDatasetTitleSvc { + type Response = super::UpdateDatasetTitleResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::CreateDataproxyTokenSvcAccountRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_dataproxy_token_svc_account( - &inner, - request, - ) + ::update_dataset_title(&inner, request) .await }; Box::pin(fut) @@ -4144,7 +4174,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateDataproxyTokenSvcAccountSvc(inner); + let method = UpdateDatasetTitleSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4160,25 +4190,25 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/AddPubkeySvcAccount" => { + "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetAuthors" => { #[allow(non_camel_case_types)] - struct AddPubkeySvcAccountSvc(pub Arc); + struct UpdateDatasetAuthorsSvc(pub Arc); impl< - T: ServiceAccountService, - > tonic::server::UnaryService - for AddPubkeySvcAccountSvc { - type Response = super::AddPubkeySvcAccountResponse; + T: DatasetService, + > tonic::server::UnaryService + for UpdateDatasetAuthorsSvc { + type Response = super::UpdateDatasetAuthorsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::add_pubkey_svc_account( + ::update_dataset_authors( &inner, request, ) @@ -4194,7 +4224,7 @@ pub mod service_account_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = AddPubkeySvcAccountSvc(inner); + let method = UpdateDatasetAuthorsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4210,244 +4240,22 @@ pub mod service_account_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ServiceAccountService/AddTrustedEndpointsSvcAccount" => { - #[allow(non_camel_case_types)] - struct AddTrustedEndpointsSvcAccountSvc( - pub Arc, - ); - impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::AddTrustedEndpointsSvcAccountRequest, - > for AddTrustedEndpointsSvcAccountSvc { - type Response = super::AddTrustedEndpointsSvcAccountResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::AddTrustedEndpointsSvcAccountRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::add_trusted_endpoints_svc_account( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = AddTrustedEndpointsSvcAccountSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.ServiceAccountService/RemoveTrustedEndpointsSvcAccount" => { - #[allow(non_camel_case_types)] - struct RemoveTrustedEndpointsSvcAccountSvc( - pub Arc, - ); - impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::RemoveTrustedEndpointsSvcAccountRequest, - > for RemoveTrustedEndpointsSvcAccountSvc { - type Response = super::RemoveTrustedEndpointsSvcAccountResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::RemoveTrustedEndpointsSvcAccountRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::remove_trusted_endpoints_svc_account( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = RemoveTrustedEndpointsSvcAccountSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.ServiceAccountService/AddDataProxyAttributeSvcAccount" => { - #[allow(non_camel_case_types)] - struct AddDataProxyAttributeSvcAccountSvc( - pub Arc, - ); - impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::AddDataProxyAttributeSvcAccountRequest, - > for AddDataProxyAttributeSvcAccountSvc { - type Response = super::AddDataProxyAttributeSvcAccountResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::AddDataProxyAttributeSvcAccountRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::add_data_proxy_attribute_svc_account( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = AddDataProxyAttributeSvcAccountSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.ServiceAccountService/RemoveDataProxyAttributeSvcAccount" => { - #[allow(non_camel_case_types)] - struct RemoveDataProxyAttributeSvcAccountSvc< - T: ServiceAccountService, - >( - pub Arc, - ); - impl< - T: ServiceAccountService, - > tonic::server::UnaryService< - super::RemoveDataProxyAttributeSvcAccountRequest, - > for RemoveDataProxyAttributeSvcAccountSvc { - type Response = super::RemoveDataProxyAttributeSvcAccountResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::RemoveDataProxyAttributeSvcAccountRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::remove_data_proxy_attribute_svc_account( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = RemoveDataProxyAttributeSvcAccountSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) } } } } - impl Clone for ServiceAccountServiceServer { + impl Clone for DatasetServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -4459,7 +4267,7 @@ pub mod service_account_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -4469,218 +4277,139 @@ pub mod service_account_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService - for ServiceAccountServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.ServiceAccountService"; + impl tonic::server::NamedService for DatasetServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.DatasetService"; } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetStorageVersionRequest {} +pub struct ReplicateProjectDataRequest { + #[prost(string, tag = "1")] + pub project_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, +} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct SemanticVersion { - /// Complete version string - #[prost(string, tag = "1")] - pub version_string: ::prost::alloc::string::String, - /// Semver according to - #[prost(int32, tag = "2")] - pub major: i32, - #[prost(int32, tag = "3")] - pub minor: i32, - #[prost(int32, tag = "4")] - pub patch: i32, - #[prost(string, tag = "5")] - pub labels: ::prost::alloc::string::String, +pub struct ReplicateProjectDataResponse { + #[prost(enumeration = "super::super::models::v2::ReplicationStatus", tag = "1")] + pub status: i32, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct LocationVersion { - /// Status of a specific Location e.g Gießen / dataproxy / 0.5.0-beta.1 - #[prost(string, tag = "1")] - pub location: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub version: ::prost::alloc::vec::Vec, +pub struct PartialReplicateDataRequest { + #[prost(string, tag = "4")] + pub endpoint_id: ::prost::alloc::string::String, + #[prost(oneof = "partial_replicate_data_request::DataVariant", tags = "1, 2, 3")] + pub data_variant: ::core::option::Option< + partial_replicate_data_request::DataVariant, + >, +} +/// Nested message and enum types in `PartialReplicateDataRequest`. +pub mod partial_replicate_data_request { + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum DataVariant { + #[prost(string, tag = "1")] + CollectionId(::prost::alloc::string::String), + #[prost(string, tag = "2")] + DatasetId(::prost::alloc::string::String), + #[prost(string, tag = "3")] + ObjectId(::prost::alloc::string::String), + } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ComponentVersion { - /// Name of a specific component e.g. server, dataproxy etc. and their status by location - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub version: ::core::option::Option, +pub struct PartialReplicateDataResponse { + #[prost(enumeration = "super::super::models::v2::ReplicationStatus", tag = "1")] + pub status: i32, } -/// Version of each component by location #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetStorageVersionResponse { - #[prost(message, repeated, tag = "1")] - pub location_version: ::prost::alloc::vec::Vec, +pub struct UpdateReplicationStatusRequest { + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::ReplicationStatus", tag = "3")] + pub status: i32, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetStorageStatusRequest {} +pub struct UpdateReplicationStatusResponse {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct LocationStatus { - /// Status of a specific Location e.g Gießen / AVAILABLE +pub struct GetReplicationStatusRequest { #[prost(string, tag = "1")] - pub location: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub component_status: ::prost::alloc::vec::Vec, + pub resource_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ComponentStatus { - /// Name of a specific component e.g. server, dataproxy etc. and their status by location - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::ComponentStatus", tag = "2")] - pub status: i32, +pub struct GetReplicationStatusResponse { + #[prost(message, repeated, tag = "1")] + pub infos: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetStorageStatusResponse { - /// List of all locations and their component / status - #[prost(message, repeated, tag = "1")] - pub location_status: ::prost::alloc::vec::Vec, +pub struct ReplicationInfo { + #[prost(message, optional, tag = "5")] + pub endpoint_info: ::core::option::Option, + #[prost(oneof = "replication_info::Resource", tags = "1, 2, 3, 4")] + pub resource: ::core::option::Option, +} +/// Nested message and enum types in `ReplicationInfo`. +pub mod replication_info { + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Resource { + #[prost(string, tag = "1")] + ProjectId(::prost::alloc::string::String), + #[prost(string, tag = "2")] + CollectionId(::prost::alloc::string::String), + #[prost(string, tag = "3")] + DatasetId(::prost::alloc::string::String), + #[prost(string, tag = "4")] + ObjectId(::prost::alloc::string::String), + } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetPubkeysRequest {} +pub struct DeleteReplicationRequest { + #[prost(string, tag = "1")] + pub resource_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, +} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetPubkeysResponse { - #[prost(message, repeated, tag = "1")] - pub pubkeys: ::prost::alloc::vec::Vec, -} -/// ------------------------------------- -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Announcement { - /// Announcement id - #[prost(string, tag = "1")] - pub announcement_id: ::prost::alloc::string::String, - /// Announcement type - #[prost(enumeration = "super::super::models::v2::AnnouncementType", tag = "2")] - pub announcement_type: i32, - /// Announcement title - #[prost(string, tag = "3")] - pub title: ::prost::alloc::string::String, - /// Short announcement summary - #[prost(string, tag = "4")] - pub teaser: ::prost::alloc::string::String, - /// URL for announcement preview image - #[prost(string, tag = "5")] - pub image_url: ::prost::alloc::string::String, - /// Announcement content text - #[prost(string, tag = "6")] - pub content: ::prost::alloc::string::String, - /// Initial announcement author - #[prost(string, tag = "7")] - pub created_by: ::prost::alloc::string::String, - /// Initial creation timestamp - #[prost(message, optional, tag = "8")] - pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>, - /// Author responsible for the last modification - #[prost(string, tag = "9")] - pub modified_by: ::prost::alloc::string::String, - /// Last modification timestamp - #[prost(message, optional, tag = "10")] - pub modified_at: ::core::option::Option<::prost_wkt_types::Timestamp>, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SetAnnouncementsRequest { - #[prost(message, repeated, tag = "1")] - pub announcements_upsert: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "2")] - pub announcements_delete: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SetAnnouncementsResponse { - #[prost(message, repeated, tag = "1")] - pub announcements: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAnnouncementsRequest { - #[prost(string, repeated, tag = "1")] - pub announcement_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub page: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAnnouncementsResponse { - #[prost(message, repeated, tag = "1")] - pub announcements: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAnnouncementsByTypeRequest { - #[prost(enumeration = "super::super::models::v2::AnnouncementType", tag = "1")] - pub announcement_type: i32, - #[prost(message, optional, tag = "2")] - pub page: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAnnouncementsByTypeResponse { - #[prost(message, repeated, tag = "1")] - pub announcements: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAnnouncementRequest { - #[prost(string, tag = "1")] - pub announcement_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAnnouncementResponse { - #[prost(message, optional, tag = "1")] - pub announcement: ::core::option::Option, -} +pub struct DeleteReplicationResponse {} /// Generated client implementations. -pub mod storage_status_service_client { +pub mod data_replication_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// StorageStatusService - /// - /// Status: BETA - /// - /// This is a generic service that contains utility functions - /// these functions are used to query additional meta-information - /// about the status of storage components + /// DataReplicationService + /// Endpoint specific methods for syncing data #[derive(Debug, Clone)] - pub struct StorageStatusServiceClient { + pub struct DataReplicationServiceClient { inner: tonic::client::Grpc, } - impl StorageStatusServiceClient + impl DataReplicationServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -4698,7 +4427,7 @@ pub mod storage_status_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> StorageStatusServiceClient> + ) -> DataReplicationServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -4712,7 +4441,9 @@ pub mod storage_status_service_client { http::Request, >>::Error: Into + Send + Sync, { - StorageStatusServiceClient::new(InterceptedService::new(inner, interceptor)) + DataReplicationServiceClient::new( + InterceptedService::new(inner, interceptor), + ) } /// Compress requests with the given encoding. /// @@ -4745,17 +4476,16 @@ pub mod storage_status_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// GetStorageVersion + /// ReplicateProjectData /// - /// Status: BETA + /// Status: ALPHA /// - /// A request to get the current version of the server application - /// String representation and https://semver.org/ - pub async fn get_storage_version( + /// Replicates the (full) project data from one endpoint to another + pub async fn replicate_project_data( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4769,28 +4499,28 @@ pub mod storage_status_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.StorageStatusService/GetStorageVersion", + "/aruna.api.storage.services.v2.DataReplicationService/ReplicateProjectData", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.StorageStatusService", - "GetStorageVersion", + "aruna.api.storage.services.v2.DataReplicationService", + "ReplicateProjectData", ), ); self.inner.unary(req, path, codec).await } - /// GetStorageStatus + /// PartialReplicateData /// /// Status: ALPHA /// - /// A request to get the current status of the storage components by location(s) - pub async fn get_storage_status( + /// Partial replicate data between endpoints + pub async fn partial_replicate_data( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4804,28 +4534,28 @@ pub mod storage_status_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.StorageStatusService/GetStorageStatus", + "/aruna.api.storage.services.v2.DataReplicationService/PartialReplicateData", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.StorageStatusService", - "GetStorageStatus", + "aruna.api.storage.services.v2.DataReplicationService", + "PartialReplicateData", ), ); self.inner.unary(req, path, codec).await } - /// GetPubkeys + /// UpdateReplicationStatus /// - /// Status: BETA + /// Status: ALPHA /// - /// Get all public keys of all storage components - pub async fn get_pubkeys( + /// Update the replication status of a project + pub async fn update_replication_status( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4839,30 +4569,28 @@ pub mod storage_status_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.StorageStatusService/GetPubkeys", + "/aruna.api.storage.services.v2.DataReplicationService/UpdateReplicationStatus", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.StorageStatusService", - "GetPubkeys", + "aruna.api.storage.services.v2.DataReplicationService", + "UpdateReplicationStatus", ), ); self.inner.unary(req, path, codec).await } - /// Get Announcements + /// GetReplicationStatus /// - /// Status: BETA + /// Status: ALPHA /// - /// Query global announcements optionally filtered by specific ids. - /// - Returns all announcements if no ids are provided - /// - Returns only the specific announcements if ids are provided - pub async fn get_announcements( + /// Get the replication status of a project + pub async fn get_replication_status( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4876,28 +4604,28 @@ pub mod storage_status_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncements", + "/aruna.api.storage.services.v2.DataReplicationService/GetReplicationStatus", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.StorageStatusService", - "GetAnnouncements", + "aruna.api.storage.services.v2.DataReplicationService", + "GetReplicationStatus", ), ); self.inner.unary(req, path, codec).await } - /// GetAnnouncementsByType + /// DeleteReplication /// - /// Status: BETA + /// Status: ALPHA /// - /// Query global announcements by type - pub async fn get_announcements_by_type( + /// Delete the replication status of a project + pub async fn delete_replication( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4911,194 +4639,92 @@ pub mod storage_status_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncementsByType", + "/aruna.api.storage.services.v2.DataReplicationService/DeleteReplication", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.StorageStatusService", - "GetAnnouncementsByType", + "aruna.api.storage.services.v2.DataReplicationService", + "DeleteReplication", ), ); self.inner.unary(req, path, codec).await } - /// Get a specific Announcement + } +} +/// Generated server implementations. +pub mod data_replication_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with DataReplicationServiceServer. + #[async_trait] + pub trait DataReplicationService: Send + Sync + 'static { + /// ReplicateProjectData /// - /// Status: BETA + /// Status: ALPHA /// - /// Query a specific global announcement by its id - pub async fn get_announcement( - &mut self, - request: impl tonic::IntoRequest, + /// Replicates the (full) project data from one endpoint to another + async fn replicate_project_data( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncement", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.StorageStatusService", - "GetAnnouncement", - ), - ); - self.inner.unary(req, path, codec).await - } - /// SetAnnouncements - /// - /// Status: BETA - /// - /// Update / add global announcements - pub async fn set_announcements( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.StorageStatusService/SetAnnouncements", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.StorageStatusService", - "SetAnnouncements", - ), - ); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod storage_status_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with StorageStatusServiceServer. - #[async_trait] - pub trait StorageStatusService: Send + Sync + 'static { - /// GetStorageVersion - /// - /// Status: BETA - /// - /// A request to get the current version of the server application - /// String representation and https://semver.org/ - async fn get_storage_version( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetStorageStatus + /// PartialReplicateData /// /// Status: ALPHA /// - /// A request to get the current status of the storage components by location(s) - async fn get_storage_status( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetPubkeys - /// - /// Status: BETA - /// - /// Get all public keys of all storage components - async fn get_pubkeys( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Get Announcements - /// - /// Status: BETA - /// - /// Query global announcements optionally filtered by specific ids. - /// - Returns all announcements if no ids are provided - /// - Returns only the specific announcements if ids are provided - async fn get_announcements( + /// Partial replicate data between endpoints + async fn partial_replicate_data( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetAnnouncementsByType + /// UpdateReplicationStatus /// - /// Status: BETA + /// Status: ALPHA /// - /// Query global announcements by type - async fn get_announcements_by_type( + /// Update the replication status of a project + async fn update_replication_status( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Get a specific Announcement + /// GetReplicationStatus /// - /// Status: BETA + /// Status: ALPHA /// - /// Query a specific global announcement by its id - async fn get_announcement( + /// Get the replication status of a project + async fn get_replication_status( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// SetAnnouncements + /// DeleteReplication /// - /// Status: BETA + /// Status: ALPHA /// - /// Update / add global announcements - async fn set_announcements( + /// Delete the replication status of a project + async fn delete_replication( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// StorageStatusService - /// - /// Status: BETA - /// - /// This is a generic service that contains utility functions - /// these functions are used to query additional meta-information - /// about the status of storage components + /// DataReplicationService + /// Endpoint specific methods for syncing data #[derive(Debug)] - pub struct StorageStatusServiceServer { + pub struct DataReplicationServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -5106,7 +4732,7 @@ pub mod storage_status_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl StorageStatusServiceServer { + impl DataReplicationServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -5159,9 +4785,9 @@ pub mod storage_status_service_server { } } impl tonic::codegen::Service> - for StorageStatusServiceServer + for DataReplicationServiceServer where - T: StorageStatusService, + T: DataReplicationService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -5177,25 +4803,27 @@ pub mod storage_status_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.StorageStatusService/GetStorageVersion" => { + "/aruna.api.storage.services.v2.DataReplicationService/ReplicateProjectData" => { #[allow(non_camel_case_types)] - struct GetStorageVersionSvc(pub Arc); + struct ReplicateProjectDataSvc( + pub Arc, + ); impl< - T: StorageStatusService, - > tonic::server::UnaryService - for GetStorageVersionSvc { - type Response = super::GetStorageVersionResponse; + T: DataReplicationService, + > tonic::server::UnaryService + for ReplicateProjectDataSvc { + type Response = super::ReplicateProjectDataResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_storage_version( + ::replicate_project_data( &inner, request, ) @@ -5211,7 +4839,7 @@ pub mod storage_status_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetStorageVersionSvc(inner); + let method = ReplicateProjectDataSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5227,25 +4855,27 @@ pub mod storage_status_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.StorageStatusService/GetStorageStatus" => { + "/aruna.api.storage.services.v2.DataReplicationService/PartialReplicateData" => { #[allow(non_camel_case_types)] - struct GetStorageStatusSvc(pub Arc); + struct PartialReplicateDataSvc( + pub Arc, + ); impl< - T: StorageStatusService, - > tonic::server::UnaryService - for GetStorageStatusSvc { - type Response = super::GetStorageStatusResponse; + T: DataReplicationService, + > tonic::server::UnaryService + for PartialReplicateDataSvc { + type Response = super::PartialReplicateDataResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_storage_status( + ::partial_replicate_data( &inner, request, ) @@ -5261,7 +4891,7 @@ pub mod storage_status_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetStorageStatusSvc(inner); + let method = PartialReplicateDataSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5277,25 +4907,32 @@ pub mod storage_status_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.StorageStatusService/GetPubkeys" => { + "/aruna.api.storage.services.v2.DataReplicationService/UpdateReplicationStatus" => { #[allow(non_camel_case_types)] - struct GetPubkeysSvc(pub Arc); + struct UpdateReplicationStatusSvc( + pub Arc, + ); impl< - T: StorageStatusService, - > tonic::server::UnaryService - for GetPubkeysSvc { - type Response = super::GetPubkeysResponse; + T: DataReplicationService, + > tonic::server::UnaryService + for UpdateReplicationStatusSvc { + type Response = super::UpdateReplicationStatusResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::UpdateReplicationStatusRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_pubkeys(&inner, request) + ::update_replication_status( + &inner, + request, + ) .await }; Box::pin(fut) @@ -5308,7 +4945,7 @@ pub mod storage_status_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetPubkeysSvc(inner); + let method = UpdateReplicationStatusSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5324,25 +4961,27 @@ pub mod storage_status_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncements" => { + "/aruna.api.storage.services.v2.DataReplicationService/GetReplicationStatus" => { #[allow(non_camel_case_types)] - struct GetAnnouncementsSvc(pub Arc); + struct GetReplicationStatusSvc( + pub Arc, + ); impl< - T: StorageStatusService, - > tonic::server::UnaryService - for GetAnnouncementsSvc { - type Response = super::GetAnnouncementsResponse; + T: DataReplicationService, + > tonic::server::UnaryService + for GetReplicationStatusSvc { + type Response = super::GetReplicationStatusResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_announcements( + ::get_replication_status( &inner, request, ) @@ -5358,7 +4997,7 @@ pub mod storage_status_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetAnnouncementsSvc(inner); + let method = GetReplicationStatusSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5374,27 +5013,25 @@ pub mod storage_status_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncementsByType" => { + "/aruna.api.storage.services.v2.DataReplicationService/DeleteReplication" => { #[allow(non_camel_case_types)] - struct GetAnnouncementsByTypeSvc( - pub Arc, - ); + struct DeleteReplicationSvc(pub Arc); impl< - T: StorageStatusService, - > tonic::server::UnaryService - for GetAnnouncementsByTypeSvc { - type Response = super::GetAnnouncementsByTypeResponse; + T: DataReplicationService, + > tonic::server::UnaryService + for DeleteReplicationSvc { + type Response = super::DeleteReplicationResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_announcements_by_type( + ::delete_replication( &inner, request, ) @@ -5410,107 +5047,7 @@ pub mod storage_status_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetAnnouncementsByTypeSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.StorageStatusService/GetAnnouncement" => { - #[allow(non_camel_case_types)] - struct GetAnnouncementSvc(pub Arc); - impl< - T: StorageStatusService, - > tonic::server::UnaryService - for GetAnnouncementSvc { - type Response = super::GetAnnouncementResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_announcement( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetAnnouncementSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.StorageStatusService/SetAnnouncements" => { - #[allow(non_camel_case_types)] - struct SetAnnouncementsSvc(pub Arc); - impl< - T: StorageStatusService, - > tonic::server::UnaryService - for SetAnnouncementsSvc { - type Response = super::SetAnnouncementsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::set_announcements( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = SetAnnouncementsSvc(inner); + let method = DeleteReplicationSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5541,7 +5078,7 @@ pub mod storage_status_service_server { } } } - impl Clone for StorageStatusServiceServer { + impl Clone for DataReplicationServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -5553,7 +5090,7 @@ pub mod storage_status_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -5563,29 +5100,25 @@ pub mod storage_status_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService - for StorageStatusServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.StorageStatusService"; + impl tonic::server::NamedService + for DataReplicationServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.DataReplicationService"; } } -/// Models -/// These are the models for the above described requests and responses. -/// gRPC best practises advice each Request and Response message in a RPC to be -/// called {rpc_name}Request and {rpc_name}Response. #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateObjectRequest { - /// collection name +pub struct CreateProjectRequest { + /// Project name #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, /// title - #[prost(string, tag = "12")] + #[prost(string, tag = "9")] pub title: ::prost::alloc::string::String, - /// description + /// Description #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, - /// collection specific labels / hooks + /// Project specific labels / hooks #[prost(message, repeated, tag = "3")] pub key_values: ::prost::alloc::vec::Vec, /// Internal / External relations (URLs / IDs from external sources) @@ -5594,305 +5127,175 @@ pub struct CreateObjectRequest { /// DataClass #[prost(enumeration = "super::super::models::v2::DataClass", tag = "5")] pub data_class: i32, - #[prost(message, repeated, tag = "9")] - pub hashes: ::prost::alloc::vec::Vec, - #[prost(string, tag = "10")] + /// Preferred endpoint + #[prost(string, tag = "6")] + pub preferred_endpoint: ::prost::alloc::string::String, + /// + #[prost(string, tag = "7")] pub metadata_license_tag: ::prost::alloc::string::String, - #[prost(string, tag = "11")] - pub data_license_tag: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "13")] + #[prost(string, tag = "8")] + pub default_data_license_tag: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "10")] pub authors: ::prost::alloc::vec::Vec, - /// Parent can be one of all other resources - #[prost(oneof = "create_object_request::Parent", tags = "6, 7, 8")] - pub parent: ::core::option::Option, -} -/// Nested message and enum types in `CreateObjectRequest`. -pub mod create_object_request { - /// Parent can be one of all other resources - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Parent { - #[prost(string, tag = "6")] - ProjectId(::prost::alloc::string::String), - #[prost(string, tag = "7")] - CollectionId(::prost::alloc::string::String), - #[prost(string, tag = "8")] - DatasetId(::prost::alloc::string::String), - } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateObjectResponse { +pub struct CreateProjectResponse { + /// The freshly created project #[prost(message, optional, tag = "1")] - pub object: ::core::option::Option, + pub project: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetUploadUrlRequest { - /// ObjectId +pub struct GetProjectRequest { + /// The id of the project to get #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, - /// Is this a multipart upload? - #[prost(bool, tag = "2")] - pub multipart: bool, - /// (optional) if multi was initialized - #[prost(int32, tag = "3")] - pub part_number: i32, + pub project_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetUploadUrlResponse { - /// URL - #[prost(string, tag = "1")] - pub url: ::prost::alloc::string::String, +pub struct GetProjectResponse { + /// Overview of the projectroject + #[prost(message, optional, tag = "1")] + pub project: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDownloadUrlRequest { - #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, +pub struct GetProjectsRequest { + /// optional filter for specific ids + #[prost(string, repeated, tag = "1")] + pub project_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDownloadUrlResponse { - /// URL +pub struct GetProjectsResponse { + /// Overview of the projects + #[prost(message, repeated, tag = "1")] + pub projects: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteProjectRequest { + /// The id of the project to destroy #[prost(string, tag = "1")] - pub url: ::prost::alloc::string::String, + pub project_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CompletedPart { - /// Multipart identifier +pub struct DeleteProjectResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateProjectNameRequest { #[prost(string, tag = "1")] - pub etag: ::prost::alloc::string::String, - /// Part number - #[prost(int64, tag = "2")] - pub part: i64, + pub project_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct FinishObjectStagingRequest { - /// ObjectId +pub struct UpdateProjectNameResponse { + #[prost(message, optional, tag = "1")] + pub project: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateProjectDescriptionRequest { #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, - /// Final content len - #[prost(int64, tag = "2")] - pub content_len: i64, - /// Hash of the uploaded data - used to verify the data integrity. - /// This supports multiple hashing algorithms. - #[prost(message, repeated, tag = "3")] - pub hashes: ::prost::alloc::vec::Vec, - /// If the upload was multipart, this is the list of parts that were uploaded. - /// Should be empty if the upload was not multipart. - /// (optional) - #[prost(message, repeated, tag = "4")] - pub completed_parts: ::prost::alloc::vec::Vec, + pub project_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct FinishObjectStagingResponse { - /// (new) Object overview +pub struct UpdateProjectDescriptionResponse { #[prost(message, optional, tag = "1")] - pub object: ::core::option::Option, + pub project: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateObjectRequest { - /// Existing object ID +pub struct UpdateProjectKeyValuesRequest { #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, - /// object name - #[prost(string, optional, tag = "2")] - pub name: ::core::option::Option<::prost::alloc::string::String>, - /// object description - #[prost(string, optional, tag = "3")] - pub description: ::core::option::Option<::prost::alloc::string::String>, - /// key_values to add - #[prost(message, repeated, tag = "4")] + pub project_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] pub add_key_values: ::prost::alloc::vec::Vec, - /// key_values to remove - #[prost(message, repeated, tag = "5")] + #[prost(message, repeated, tag = "3")] pub remove_key_values: ::prost::alloc::vec::Vec, - /// New DataClass - #[prost(enumeration = "super::super::models::v2::DataClass", tag = "7")] - pub data_class: i32, - #[prost(message, repeated, tag = "12")] - pub hashes: ::prost::alloc::vec::Vec, - /// Force new object revision - #[prost(bool, tag = "13")] - pub force_revision: bool, - #[prost(string, optional, tag = "14")] - pub metadata_license_tag: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "15")] - pub data_license_tag: ::core::option::Option<::prost::alloc::string::String>, - /// Parent can be one of all other resources - #[prost(oneof = "update_object_request::Parent", tags = "8, 9, 10")] - pub parent: ::core::option::Option, -} -/// Nested message and enum types in `UpdateObjectRequest`. -pub mod update_object_request { - /// Parent can be one of all other resources - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Parent { - #[prost(string, tag = "8")] - ProjectId(::prost::alloc::string::String), - #[prost(string, tag = "9")] - CollectionId(::prost::alloc::string::String), - #[prost(string, tag = "10")] - DatasetId(::prost::alloc::string::String), - } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateObjectResponse { +pub struct UpdateProjectKeyValuesResponse { #[prost(message, optional, tag = "1")] - pub object: ::core::option::Option, - #[prost(bool, tag = "2")] - pub new_revision: bool, + pub project: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CloneObjectRequest { - /// ObjectId +pub struct UpdateProjectDataClassRequest { #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, - /// - #[prost(oneof = "clone_object_request::Parent", tags = "2, 3, 4")] - pub parent: ::core::option::Option, -} -/// Nested message and enum types in `CloneObjectRequest`. -pub mod clone_object_request { - /// - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Parent { - #[prost(string, tag = "2")] - ProjectId(::prost::alloc::string::String), - #[prost(string, tag = "3")] - CollectionId(::prost::alloc::string::String), - #[prost(string, tag = "4")] - DatasetId(::prost::alloc::string::String), - } + pub project_id: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::DataClass", tag = "2")] + pub data_class: i32, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CloneObjectResponse { - /// This describes the new object. +pub struct UpdateProjectDataClassResponse { #[prost(message, optional, tag = "1")] - pub object: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteObjectRequest { - /// ObjectId - #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, - /// Delete including revisions - #[prost(bool, tag = "2")] - pub with_revisions: bool, + pub project: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteObjectResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetObjectRequest { - /// Object Id +pub struct ArchiveProjectRequest { #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, + pub project_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetObjectResponse { +pub struct ArchiveProjectResponse { + /// This project will be returned via an Persistent Identifier! Updates will be impossible #[prost(message, optional, tag = "1")] - pub object: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetObjectsRequest { - /// Object ids - #[prost(string, repeated, tag = "1")] - pub object_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetObjectsResponse { - /// A List of objects - #[prost(message, repeated, tag = "1")] - pub objects: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetObjectRevisionsRequest { - /// Object id - #[prost(string, tag = "2")] - pub object_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetObjectRevisionsResponse { - /// List of objects - #[prost(message, repeated, tag = "1")] - pub objects: ::prost::alloc::vec::Vec, + pub project: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetLatestObjectRevisionRequest { - /// Object id +pub struct UpdateProjectLicensesRequest { #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, + pub project_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub metadata_license_tag: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub default_data_license_tag: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetLatestObjectRevisionResponse { - /// The object with the latest revision +pub struct UpdateProjectLicensesResponse { #[prost(message, optional, tag = "1")] - pub object: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetObjectEndpointsRequest { - /// Collection id - #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, - /// Object id - #[prost(string, tag = "2")] - pub object_id: ::prost::alloc::string::String, + pub project: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateObjectTitleRequest { - /// Object id +pub struct UpdateProjectTitleRequest { + /// Project id #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, + pub project_id: ::prost::alloc::string::String, /// New title #[prost(string, tag = "2")] pub title: ::prost::alloc::string::String, @@ -5900,18 +5303,18 @@ pub struct UpdateObjectTitleRequest { #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateObjectTitleResponse { +pub struct UpdateProjectTitleResponse { /// The updated object #[prost(message, optional, tag = "1")] - pub object: ::core::option::Option, + pub project: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateObjectAuthorsRequest { - /// Object id +pub struct UpdateProjectAuthorsRequest { + /// Project id #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, + pub project_id: ::prost::alloc::string::String, /// Add authors #[prost(message, repeated, tag = "2")] pub add_authors: ::prost::alloc::vec::Vec, @@ -5922,45 +5325,26 @@ pub struct UpdateObjectAuthorsRequest { #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateObjectAuthorsResponse { - /// The updated object - #[prost(message, optional, tag = "1")] - pub object: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SetObjectHashesRequest { - /// Object id - #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, - /// Hashes - #[prost(message, repeated, tag = "2")] - pub hashes: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SetObjectHashesResponse { - /// The updated object (possibly with error status) +pub struct UpdateProjectAuthorsResponse { + /// The updated project #[prost(message, optional, tag = "1")] - pub object: ::core::option::Option, + pub project: ::core::option::Option, } /// Generated client implementations. -pub mod object_service_client { +pub mod project_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// ObjectService + /// ProjectService /// /// Status: BETA /// - /// Contains all methods that get/create or update objects and associated resources + /// Contains all methods that get/create or update Projects and associated resources #[derive(Debug, Clone)] - pub struct ObjectServiceClient { + pub struct ProjectServiceClient { inner: tonic::client::Grpc, } - impl ObjectServiceClient + impl ProjectServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -5978,7 +5362,7 @@ pub mod object_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> ObjectServiceClient> + ) -> ProjectServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -5992,7 +5376,7 @@ pub mod object_service_client { http::Request, >>::Error: Into + Send + Sync, { - ObjectServiceClient::new(InterceptedService::new(inner, interceptor)) + ProjectServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -6025,18 +5409,16 @@ pub mod object_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// CreateObject + /// CreateProject /// /// Status: BETA /// - /// This creates a new object and puts it in a staging area. - /// Staging objects have an "INITIALIZING" status - /// and need to be finished either manually or by uploading data. - pub async fn create_object( + /// Creates a new project. All subsequent resources are part of a project. + pub async fn create_project( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6050,31 +5432,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/CreateObject", + "/aruna.api.storage.services.v2.ProjectService/CreateProject", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "CreateObject", + "aruna.api.storage.services.v2.ProjectService", + "CreateProject", ), ); self.inner.unary(req, path, codec).await } - /// GetUploadURL + /// GetProject /// /// Status: BETA /// - /// This is a proxy method that will call the apropriate method at dataproxy level - /// This method will return a (multi-part) url that can be used to upload a - /// file to S3. Part is a optional query parameter that can be used to upload a - /// part of the file / multipart upload. - pub async fn get_upload_url( + /// Requests a project (by id) + pub async fn get_project( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6088,29 +5467,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/GetUploadURL", + "/aruna.api.storage.services.v2.ProjectService/GetProject", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "GetUploadURL", + "aruna.api.storage.services.v2.ProjectService", + "GetProject", ), ); self.inner.unary(req, path, codec).await } - /// GetDownloadUrl + /// GetProjects /// /// Status: BETA /// - /// This is a proxy method that will call the apropriate method at dataproxy level - /// will return a url that can be used to download a file from S3. - pub async fn get_download_url( + /// Admin request to get all projects + pub async fn get_projects( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6124,28 +5502,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/GetDownloadURL", + "/aruna.api.storage.services.v2.ProjectService/GetProjects", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "GetDownloadURL", + "aruna.api.storage.services.v2.ProjectService", + "GetProjects", ), ); self.inner.unary(req, path, codec).await } - /// FinishObjectStaging + /// DeleteProject /// /// Status: BETA /// - /// This method completes the staging of an object. - pub async fn finish_object_staging( + /// Deletes the project and all its associated data. Must be empty! + pub async fn delete_project( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6159,32 +5537,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/FinishObjectStaging", + "/aruna.api.storage.services.v2.ProjectService/DeleteProject", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "FinishObjectStaging", + "aruna.api.storage.services.v2.ProjectService", + "DeleteProject", ), ); self.inner.unary(req, path, codec).await } - /// UpdateObject + /// UpdateProjectName /// /// Status: BETA /// - /// Objects are immutable! - /// Updating an object will create a new revision for the object - /// This method will put the new revision in a staging area. - /// Staged objects will get a separate staging id and need to be finished - /// before they can be used. - pub async fn update_object( + /// Updates the project name. Caveat! Will rename the "s3 bucket" for data proxies! + pub async fn update_project_name( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6198,30 +5572,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/UpdateObject", + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectName", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "UpdateObject", + "aruna.api.storage.services.v2.ProjectService", + "UpdateProjectName", ), ); self.inner.unary(req, path, codec).await } - /// CloneObject + /// UpdateProjectDescription /// /// Status: BETA /// - /// This method clones an object and creates a copy in the same collection. - /// This copy has a new id and revision and will not receive any updates from - /// the original object. - pub async fn clone_object( + /// Updates the project name. + pub async fn update_project_description( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6235,28 +5607,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/CloneObject", + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectDescription", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "CloneObject", + "aruna.api.storage.services.v2.ProjectService", + "UpdateProjectDescription", ), ); self.inner.unary(req, path, codec).await } - /// DeleteObject + /// UpdateProjectKeyValues /// /// Status: BETA /// - /// Deletes the object with the complete revision history. - pub async fn delete_object( + /// Updates the project key values. + pub async fn update_project_key_values( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6270,31 +5642,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/DeleteObject", + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectKeyValues", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "DeleteObject", + "aruna.api.storage.services.v2.ProjectService", + "UpdateProjectKeyValues", ), ); self.inner.unary(req, path, codec).await } - /// GetObject + /// UpdateProjectDataClass /// /// Status: BETA /// - /// gets a specific Object by ID that is associated to the - /// current collection By default only the latest revision of an object will be - /// returned Specify a revision_number to select an older revision With the - /// optional with_url boolean a download link can automatically be requested - pub async fn get_object( + /// Updates the project name. All (meta) data will be overwritten. + pub async fn update_project_data_class( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6308,28 +5677,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/GetObject", + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectDataClass", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "GetObject", + "aruna.api.storage.services.v2.ProjectService", + "UpdateProjectDataClass", ), ); self.inner.unary(req, path, codec).await } - /// GetObjects + /// UpdateLicense /// /// Status: BETA /// - /// Get multiple objects by ID at once - pub async fn get_objects( + /// Updates the project license. All (meta) data will be overwritten. + pub async fn update_project_licenses( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6343,28 +5712,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/GetObjects", + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectLicenses", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "GetObjects", + "aruna.api.storage.services.v2.ProjectService", + "UpdateProjectLicenses", ), ); self.inner.unary(req, path, codec).await } - /// UpdateTitle + /// ArchiveProjectRequest /// - /// Status: ALPHA + /// Status: BETA /// - /// This method updates the title of an object - pub async fn update_object_title( + /// Archives the full project, rendering all downstream relations immutable + pub async fn archive_project( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6378,28 +5747,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/UpdateObjectTitle", + "/aruna.api.storage.services.v2.ProjectService/ArchiveProject", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "UpdateObjectTitle", + "aruna.api.storage.services.v2.ProjectService", + "ArchiveProject", ), ); self.inner.unary(req, path, codec).await } - /// UpdateAuthors + /// UpdateTitle /// /// Status: ALPHA /// - /// This method updates the authors of an object - pub async fn update_object_authors( + /// This method updates the title of a project + pub async fn update_project_title( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6413,30 +5782,28 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/UpdateObjectAuthors", + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectTitle", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "UpdateObjectAuthors", + "aruna.api.storage.services.v2.ProjectService", + "UpdateProjectTitle", ), ); self.inner.unary(req, path, codec).await } - /// SetObjectHashes + /// UpdateAuthors /// /// Status: ALPHA /// - /// This method sets the object hashes if not already set - /// if a hash is already set, it will be compared to the new hash and - /// set the status to ERROR if they do not match - pub async fn set_object_hashes( + /// This method updates the authors of an object + pub async fn update_project_authors( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -6450,14 +5817,14 @@ pub mod object_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ObjectService/SetObjectHashes", + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectAuthors", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ObjectService", - "SetObjectHashes", + "aruna.api.storage.services.v2.ProjectService", + "UpdateProjectAuthors", ), ); self.inner.unary(req, path, codec).await @@ -6465,181 +5832,164 @@ pub mod object_service_client { } } /// Generated server implementations. -pub mod object_service_server { +pub mod project_service_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with ObjectServiceServer. + /// Generated trait containing gRPC methods that should be implemented for use with ProjectServiceServer. #[async_trait] - pub trait ObjectService: Send + Sync + 'static { - /// CreateObject + pub trait ProjectService: Send + Sync + 'static { + /// CreateProject /// /// Status: BETA /// - /// This creates a new object and puts it in a staging area. - /// Staging objects have an "INITIALIZING" status - /// and need to be finished either manually or by uploading data. - async fn create_object( + /// Creates a new project. All subsequent resources are part of a project. + async fn create_project( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetUploadURL + /// GetProject /// /// Status: BETA /// - /// This is a proxy method that will call the apropriate method at dataproxy level - /// This method will return a (multi-part) url that can be used to upload a - /// file to S3. Part is a optional query parameter that can be used to upload a - /// part of the file / multipart upload. - async fn get_upload_url( + /// Requests a project (by id) + async fn get_project( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetDownloadUrl + /// GetProjects /// /// Status: BETA /// - /// This is a proxy method that will call the apropriate method at dataproxy level - /// will return a url that can be used to download a file from S3. - async fn get_download_url( + /// Admin request to get all projects + async fn get_projects( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// FinishObjectStaging + /// DeleteProject /// /// Status: BETA /// - /// This method completes the staging of an object. - async fn finish_object_staging( + /// Deletes the project and all its associated data. Must be empty! + async fn delete_project( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateObject + /// UpdateProjectName /// /// Status: BETA /// - /// Objects are immutable! - /// Updating an object will create a new revision for the object - /// This method will put the new revision in a staging area. - /// Staged objects will get a separate staging id and need to be finished - /// before they can be used. - async fn update_object( + /// Updates the project name. Caveat! Will rename the "s3 bucket" for data proxies! + async fn update_project_name( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// CloneObject + /// UpdateProjectDescription /// /// Status: BETA /// - /// This method clones an object and creates a copy in the same collection. - /// This copy has a new id and revision and will not receive any updates from - /// the original object. - async fn clone_object( + /// Updates the project name. + async fn update_project_description( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// DeleteObject + /// UpdateProjectKeyValues /// /// Status: BETA /// - /// Deletes the object with the complete revision history. - async fn delete_object( + /// Updates the project key values. + async fn update_project_key_values( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetObject + /// UpdateProjectDataClass /// /// Status: BETA /// - /// gets a specific Object by ID that is associated to the - /// current collection By default only the latest revision of an object will be - /// returned Specify a revision_number to select an older revision With the - /// optional with_url boolean a download link can automatically be requested - async fn get_object( + /// Updates the project name. All (meta) data will be overwritten. + async fn update_project_data_class( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetObjects + /// UpdateLicense /// /// Status: BETA /// - /// Get multiple objects by ID at once - async fn get_objects( + /// Updates the project license. All (meta) data will be overwritten. + async fn update_project_licenses( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateTitle + /// ArchiveProjectRequest /// - /// Status: ALPHA + /// Status: BETA /// - /// This method updates the title of an object - async fn update_object_title( + /// Archives the full project, rendering all downstream relations immutable + async fn archive_project( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateAuthors + /// UpdateTitle /// /// Status: ALPHA /// - /// This method updates the authors of an object - async fn update_object_authors( + /// This method updates the title of a project + async fn update_project_title( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// SetObjectHashes + /// UpdateAuthors /// /// Status: ALPHA /// - /// This method sets the object hashes if not already set - /// if a hash is already set, it will be compared to the new hash and - /// set the status to ERROR if they do not match - async fn set_object_hashes( + /// This method updates the authors of an object + async fn update_project_authors( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// ObjectService + /// ProjectService /// /// Status: BETA /// - /// Contains all methods that get/create or update objects and associated resources + /// Contains all methods that get/create or update Projects and associated resources #[derive(Debug)] - pub struct ObjectServiceServer { + pub struct ProjectServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -6647,7 +5997,7 @@ pub mod object_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl ObjectServiceServer { + impl ProjectServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -6699,9 +6049,9 @@ pub mod object_service_server { self } } - impl tonic::codegen::Service> for ObjectServiceServer + impl tonic::codegen::Service> for ProjectServiceServer where - T: ObjectService, + T: ProjectService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -6717,25 +6067,25 @@ pub mod object_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.ObjectService/CreateObject" => { + "/aruna.api.storage.services.v2.ProjectService/CreateProject" => { #[allow(non_camel_case_types)] - struct CreateObjectSvc(pub Arc); + struct CreateProjectSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for CreateObjectSvc { - type Response = super::CreateObjectResponse; + T: ProjectService, + > tonic::server::UnaryService + for CreateProjectSvc { + type Response = super::CreateProjectResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_object(&inner, request).await + ::create_project(&inner, request).await }; Box::pin(fut) } @@ -6747,7 +6097,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateObjectSvc(inner); + let method = CreateProjectSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -6763,25 +6113,25 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/GetUploadURL" => { + "/aruna.api.storage.services.v2.ProjectService/GetProject" => { #[allow(non_camel_case_types)] - struct GetUploadURLSvc(pub Arc); + struct GetProjectSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for GetUploadURLSvc { - type Response = super::GetUploadUrlResponse; + T: ProjectService, + > tonic::server::UnaryService + for GetProjectSvc { + type Response = super::GetProjectResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_upload_url(&inner, request).await + ::get_project(&inner, request).await }; Box::pin(fut) } @@ -6793,7 +6143,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetUploadURLSvc(inner); + let method = GetProjectSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -6809,26 +6159,25 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/GetDownloadURL" => { + "/aruna.api.storage.services.v2.ProjectService/GetProjects" => { #[allow(non_camel_case_types)] - struct GetDownloadURLSvc(pub Arc); + struct GetProjectsSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for GetDownloadURLSvc { - type Response = super::GetDownloadUrlResponse; + T: ProjectService, + > tonic::server::UnaryService + for GetProjectsSvc { + type Response = super::GetProjectsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_download_url(&inner, request) - .await + ::get_projects(&inner, request).await }; Box::pin(fut) } @@ -6840,7 +6189,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetDownloadURLSvc(inner); + let method = GetProjectsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -6856,26 +6205,25 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/FinishObjectStaging" => { + "/aruna.api.storage.services.v2.ProjectService/DeleteProject" => { #[allow(non_camel_case_types)] - struct FinishObjectStagingSvc(pub Arc); + struct DeleteProjectSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for FinishObjectStagingSvc { - type Response = super::FinishObjectStagingResponse; + T: ProjectService, + > tonic::server::UnaryService + for DeleteProjectSvc { + type Response = super::DeleteProjectResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::finish_object_staging(&inner, request) - .await + ::delete_project(&inner, request).await }; Box::pin(fut) } @@ -6887,7 +6235,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = FinishObjectStagingSvc(inner); + let method = DeleteProjectSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -6903,25 +6251,26 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/UpdateObject" => { + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectName" => { #[allow(non_camel_case_types)] - struct UpdateObjectSvc(pub Arc); + struct UpdateProjectNameSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for UpdateObjectSvc { - type Response = super::UpdateObjectResponse; + T: ProjectService, + > tonic::server::UnaryService + for UpdateProjectNameSvc { + type Response = super::UpdateProjectNameResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_object(&inner, request).await + ::update_project_name(&inner, request) + .await }; Box::pin(fut) } @@ -6933,7 +6282,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateObjectSvc(inner); + let method = UpdateProjectNameSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -6949,25 +6298,31 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/CloneObject" => { + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectDescription" => { #[allow(non_camel_case_types)] - struct CloneObjectSvc(pub Arc); + struct UpdateProjectDescriptionSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for CloneObjectSvc { - type Response = super::CloneObjectResponse; + T: ProjectService, + > tonic::server::UnaryService + for UpdateProjectDescriptionSvc { + type Response = super::UpdateProjectDescriptionResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::UpdateProjectDescriptionRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::clone_object(&inner, request).await + ::update_project_description( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -6979,7 +6334,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CloneObjectSvc(inner); + let method = UpdateProjectDescriptionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -6995,25 +6350,29 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/DeleteObject" => { + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectKeyValues" => { #[allow(non_camel_case_types)] - struct DeleteObjectSvc(pub Arc); + struct UpdateProjectKeyValuesSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for DeleteObjectSvc { - type Response = super::DeleteObjectResponse; + T: ProjectService, + > tonic::server::UnaryService + for UpdateProjectKeyValuesSvc { + type Response = super::UpdateProjectKeyValuesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_object(&inner, request).await + ::update_project_key_values( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -7025,7 +6384,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteObjectSvc(inner); + let method = UpdateProjectKeyValuesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -7041,25 +6400,29 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/GetObject" => { + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectDataClass" => { #[allow(non_camel_case_types)] - struct GetObjectSvc(pub Arc); + struct UpdateProjectDataClassSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for GetObjectSvc { - type Response = super::GetObjectResponse; + T: ProjectService, + > tonic::server::UnaryService + for UpdateProjectDataClassSvc { + type Response = super::UpdateProjectDataClassResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_object(&inner, request).await + ::update_project_data_class( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -7071,7 +6434,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetObjectSvc(inner); + let method = UpdateProjectDataClassSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -7087,25 +6450,29 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/GetObjects" => { + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectLicenses" => { #[allow(non_camel_case_types)] - struct GetObjectsSvc(pub Arc); + struct UpdateProjectLicensesSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for GetObjectsSvc { - type Response = super::GetObjectsResponse; + T: ProjectService, + > tonic::server::UnaryService + for UpdateProjectLicensesSvc { + type Response = super::UpdateProjectLicensesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_objects(&inner, request).await + ::update_project_licenses( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -7117,7 +6484,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetObjectsSvc(inner); + let method = UpdateProjectLicensesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -7133,25 +6500,25 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/UpdateObjectTitle" => { + "/aruna.api.storage.services.v2.ProjectService/ArchiveProject" => { #[allow(non_camel_case_types)] - struct UpdateObjectTitleSvc(pub Arc); + struct ArchiveProjectSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for UpdateObjectTitleSvc { - type Response = super::UpdateObjectTitleResponse; + T: ProjectService, + > tonic::server::UnaryService + for ArchiveProjectSvc { + type Response = super::ArchiveProjectResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_object_title(&inner, request) + ::archive_project(&inner, request) .await }; Box::pin(fut) @@ -7164,7 +6531,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateObjectTitleSvc(inner); + let method = ArchiveProjectSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -7180,25 +6547,25 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/UpdateObjectAuthors" => { + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectTitle" => { #[allow(non_camel_case_types)] - struct UpdateObjectAuthorsSvc(pub Arc); + struct UpdateProjectTitleSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for UpdateObjectAuthorsSvc { - type Response = super::UpdateObjectAuthorsResponse; + T: ProjectService, + > tonic::server::UnaryService + for UpdateProjectTitleSvc { + type Response = super::UpdateProjectTitleResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_object_authors(&inner, request) + ::update_project_title(&inner, request) .await }; Box::pin(fut) @@ -7211,7 +6578,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateObjectAuthorsSvc(inner); + let method = UpdateProjectTitleSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -7227,25 +6594,28 @@ pub mod object_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ObjectService/SetObjectHashes" => { + "/aruna.api.storage.services.v2.ProjectService/UpdateProjectAuthors" => { #[allow(non_camel_case_types)] - struct SetObjectHashesSvc(pub Arc); + struct UpdateProjectAuthorsSvc(pub Arc); impl< - T: ObjectService, - > tonic::server::UnaryService - for SetObjectHashesSvc { - type Response = super::SetObjectHashesResponse; + T: ProjectService, + > tonic::server::UnaryService + for UpdateProjectAuthorsSvc { + type Response = super::UpdateProjectAuthorsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::set_object_hashes(&inner, request) + ::update_project_authors( + &inner, + request, + ) .await }; Box::pin(fut) @@ -7258,7 +6628,7 @@ pub mod object_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = SetObjectHashesSvc(inner); + let method = UpdateProjectAuthorsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -7289,7 +6659,7 @@ pub mod object_service_server { } } } - impl Clone for ObjectServiceServer { + impl Clone for ProjectServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -7301,7 +6671,7 @@ pub mod object_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -7311,250 +6681,164 @@ pub mod object_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for ObjectServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.ObjectService"; + impl tonic::server::NamedService for ProjectServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.ProjectService"; } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateDatasetRequest { - /// dataset name +pub struct CreateEndpointRequest { + /// Endpoint name #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, - #[prost(string, tag = "10")] - pub title: ::prost::alloc::string::String, - /// Description - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// dataset specific labels / hooks - #[prost(message, repeated, tag = "3")] - pub key_values: ::prost::alloc::vec::Vec, - /// Internal / External relations (URLs / IDs from external sources) - #[prost(message, repeated, tag = "4")] - pub relations: ::prost::alloc::vec::Vec, - /// DataClass - #[prost(enumeration = "super::super::models::v2::DataClass", tag = "5")] - pub data_class: i32, - #[prost(string, optional, tag = "8")] - pub metadata_license_tag: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "9")] - pub default_data_license_tag: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "11")] - pub authors: ::prost::alloc::vec::Vec, - /// Parent_id MUST be dataset - #[prost(oneof = "create_dataset_request::Parent", tags = "6, 7")] - pub parent: ::core::option::Option, -} -/// Nested message and enum types in `CreateDatasetRequest`. -pub mod create_dataset_request { - /// Parent_id MUST be dataset - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Parent { - #[prost(string, tag = "6")] - ProjectId(::prost::alloc::string::String), - #[prost(string, tag = "7")] - CollectionId(::prost::alloc::string::String), - } + /// Endpoint type + #[prost(enumeration = "super::super::models::v2::EndpointVariant", tag = "2")] + pub ep_variant: i32, + /// Is this endpoint public + #[prost(bool, tag = "3")] + pub is_public: bool, + /// required public_key + #[prost(string, tag = "4")] + pub pubkey: ::prost::alloc::string::String, + /// List of EndpointHostConfigs + #[prost(message, repeated, tag = "5")] + pub host_configs: ::prost::alloc::vec::Vec< + super::super::models::v2::EndpointHostConfig, + >, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateDatasetResponse { - /// The new dataset_id +pub struct CreateEndpointResponse { + /// Overview of the created endpoint #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDatasetRequest { - /// Requested id - #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, + pub endpoint: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDatasetResponse { - /// Overview of the requested dataset - #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, -} +pub struct FullSyncEndpointRequest {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDatasetsRequest { - #[prost(string, repeated, tag = "1")] - pub dataset_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +pub struct FullSyncEndpointResponse { + #[prost(oneof = "full_sync_endpoint_response::Target", tags = "1, 2, 3")] + pub target: ::core::option::Option, } -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDatasetsResponse { - /// List of dataset overviews - #[prost(message, repeated, tag = "1")] - pub datasets: ::prost::alloc::vec::Vec, +/// Nested message and enum types in `FullSyncEndpointResponse`. +pub mod full_sync_endpoint_response { + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Target { + #[prost(message, tag = "1")] + GenericResource(super::super::super::models::v2::GenericResource), + #[prost(message, tag = "2")] + User(super::super::super::models::v2::User), + #[prost(message, tag = "3")] + Pubkey(super::super::super::models::v2::Pubkey), + } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteDatasetRequest { - #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, +pub struct GetEndpointRequest { + /// Either endpoint_name or id + #[prost(oneof = "get_endpoint_request::Endpoint", tags = "1, 2")] + pub endpoint: ::core::option::Option, } -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteDatasetResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetNameRequest { - #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, +/// Nested message and enum types in `GetEndpointRequest`. +pub mod get_endpoint_request { + /// Either endpoint_name or id + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Endpoint { + /// The name of the endpoint + #[prost(string, tag = "1")] + EndpointName(::prost::alloc::string::String), + /// Id of the endpoint + #[prost(string, tag = "2")] + EndpointId(::prost::alloc::string::String), + } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetNameResponse { +pub struct GetEndpointResponse { + /// Overview of the requested endpoint #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, + pub endpoint: ::core::option::Option, } +/// Requests all endpoints #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetDescriptionRequest { - #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, -} +pub struct GetEndpointsRequest {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetDescriptionResponse { - #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, +pub struct GetEndpointsResponse { + /// List of endpoints + #[prost(message, repeated, tag = "1")] + pub endpoints: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetKeyValuesRequest { +pub struct DeleteEndpointRequest { + /// Endpoint_id to delete #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub add_key_values: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub remove_key_values: ::prost::alloc::vec::Vec, + pub endpoint_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetKeyValuesResponse { - #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, -} +pub struct DeleteEndpointResponse {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetDataClassRequest { - #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::DataClass", tag = "2")] - pub data_class: i32, -} +pub struct GetDefaultEndpointRequest {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetDataClassResponse { +pub struct GetDefaultEndpointResponse { + /// Default endpoint of the server instance #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, + pub endpoint: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotDatasetRequest { +pub struct SetEndpointStatusRequest { #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, + pub endpoint_id: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::ComponentStatus", tag = "2")] + pub status: i32, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotDatasetResponse { - /// This dataset will be returned via an Persistent Identifier! Updates will be impossible +pub struct SetEndpointStatusResponse { #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetLicensesRequest { - #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub metadata_license_tag: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub default_data_license_tag: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetLicensesResponse { - #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetTitleRequest { - #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub title: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetTitleResponse { - #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetAuthorsRequest { - #[prost(string, tag = "1")] - pub dataset_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub add_authors: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub remove_authors: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateDatasetAuthorsResponse { - #[prost(message, optional, tag = "1")] - pub dataset: ::core::option::Option, + pub endpoint: ::core::option::Option, } /// Generated client implementations. -pub mod dataset_service_client { +pub mod endpoint_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// DatasetService + /// EndpointService /// - /// Contains all methods that get/create or update Dataset and associated resources + /// Status: BETA + /// + /// Contains all methods that get/create or update Endpoint (Dataproxies) and associated resources #[derive(Debug, Clone)] - pub struct DatasetServiceClient { + pub struct EndpointServiceClient { inner: tonic::client::Grpc, } - impl DatasetServiceClient + impl EndpointServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -7572,7 +6856,7 @@ pub mod dataset_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> DatasetServiceClient> + ) -> EndpointServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -7586,7 +6870,7 @@ pub mod dataset_service_client { http::Request, >>::Error: Into + Send + Sync, { - DatasetServiceClient::new(InterceptedService::new(inner, interceptor)) + EndpointServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -7619,16 +6903,17 @@ pub mod dataset_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// CreateNewDataset + /// CreateEndpoint /// /// Status: BETA /// - /// creates a new Dataset - pub async fn create_dataset( + /// Registers a new Endpoint (Aruna DataProxy) to the server + /// requires admin permissions + pub async fn create_endpoint( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -7642,28 +6927,28 @@ pub mod dataset_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/CreateDataset", + "/aruna.api.storage.services.v2.EndpointService/CreateEndpoint", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "CreateDataset", + "aruna.api.storage.services.v2.EndpointService", + "CreateEndpoint", ), ); self.inner.unary(req, path, codec).await } - /// GetDataset + /// FullSyncEndpoint /// /// Status: BETA /// - /// Request a specific dataset by ID - pub async fn get_dataset( + /// Requests a full sync of all endpoint related data + pub async fn full_sync_endpoint( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response>, tonic::Status, > { self.inner @@ -7677,28 +6962,28 @@ pub mod dataset_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/GetDataset", + "/aruna.api.storage.services.v2.EndpointService/FullSyncEndpoint", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "GetDataset", + "aruna.api.storage.services.v2.EndpointService", + "FullSyncEndpoint", ), ); - self.inner.unary(req, path, codec).await + self.inner.server_streaming(req, path, codec).await } - /// GetDatasets + /// SetEndpointStatus /// /// Status: BETA /// - /// Queries multiple datasets by ID - pub async fn get_datasets( + /// This request sets the status of a specific Endpoint + pub async fn set_endpoint_status( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -7712,28 +6997,28 @@ pub mod dataset_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/GetDatasets", + "/aruna.api.storage.services.v2.EndpointService/SetEndpointStatus", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "GetDatasets", + "aruna.api.storage.services.v2.EndpointService", + "SetEndpointStatus", ), ); self.inner.unary(req, path, codec).await } - /// DeleteDataset + /// GetEndpoint /// - /// Status: STABLE + /// Status: BETA /// - /// This request deletes the dataset. - pub async fn delete_dataset( + /// Gets an specific endpoint by ID or Name + pub async fn get_endpoint( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -7747,28 +7032,28 @@ pub mod dataset_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/DeleteDataset", + "/aruna.api.storage.services.v2.EndpointService/GetEndpoint", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "DeleteDataset", + "aruna.api.storage.services.v2.EndpointService", + "GetEndpoint", ), ); self.inner.unary(req, path, codec).await } - /// UpdateDatasetName + /// GetEndpoints /// /// Status: BETA /// - /// Updates the dataset name. Caveat! Will rename the "s3 bucket" for data proxies! - pub async fn update_dataset_name( + /// Gets all available endpoints + pub async fn get_endpoints( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -7782,28 +7067,29 @@ pub mod dataset_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetName", + "/aruna.api.storage.services.v2.EndpointService/GetEndpoints", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "UpdateDatasetName", + "aruna.api.storage.services.v2.EndpointService", + "GetEndpoints", ), ); self.inner.unary(req, path, codec).await } - /// UpdateDatasetDescription + /// DeleteEndpoint /// /// Status: BETA /// - /// Updates the dataset description. - pub async fn update_dataset_description( + /// Deletes a specific endpoint by id + /// This needs admin permissions + pub async fn delete_endpoint( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -7817,28 +7103,29 @@ pub mod dataset_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetDescription", + "/aruna.api.storage.services.v2.EndpointService/DeleteEndpoint", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "UpdateDatasetDescription", + "aruna.api.storage.services.v2.EndpointService", + "DeleteEndpoint", ), ); self.inner.unary(req, path, codec).await } - /// UpdateDatasetKeyValues + /// GetDefaultEndpoint /// /// Status: BETA /// - /// Updates the dataset key values. - pub async fn update_dataset_key_values( + /// This request returns the default endpoint for the current aruna_server + /// It may produce different results depending on the used server + pub async fn get_default_endpoint( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -7852,403 +7139,182 @@ pub mod dataset_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetKeyValues", + "/aruna.api.storage.services.v2.EndpointService/GetDefaultEndpoint", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "UpdateDatasetKeyValues", + "aruna.api.storage.services.v2.EndpointService", + "GetDefaultEndpoint", ), ); self.inner.unary(req, path, codec).await } - /// UpdateDatasetDataClass + } +} +/// Generated server implementations. +pub mod endpoint_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with EndpointServiceServer. + #[async_trait] + pub trait EndpointService: Send + Sync + 'static { + /// CreateEndpoint /// /// Status: BETA /// - /// Updates the dataset name. All (meta) data will be overwritten. - pub async fn update_dataset_data_class( - &mut self, - request: impl tonic::IntoRequest, + /// Registers a new Endpoint (Aruna DataProxy) to the server + /// requires admin permissions + async fn create_endpoint( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetDataClass", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "UpdateDatasetDataClass", - ), - ); - self.inner.unary(req, path, codec).await - } - /// SnapshotDatasetRequest + >; + /// Server streaming response type for the FullSyncEndpoint method. + type FullSyncEndpointStream: tonic::codegen::tokio_stream::Stream< + Item = std::result::Result< + super::FullSyncEndpointResponse, + tonic::Status, + >, + > + + Send + + 'static; + /// FullSyncEndpoint /// /// Status: BETA /// - /// Archives the full dataset, rendering all downstream relations immutable - pub async fn snapshot_dataset( - &mut self, - request: impl tonic::IntoRequest, + /// Requests a full sync of all endpoint related data + async fn full_sync_endpoint( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/SnapshotDataset", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "SnapshotDataset", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateLicenses - /// - /// Status: BETA - /// - /// Updates the dataset metadata license and/or default data license. - pub async fn update_dataset_licenses( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetLicenses", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "UpdateDatasetLicenses", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateTitle - /// - /// Status: ALPHA - /// - /// Updates the datasets metadata title. - pub async fn update_dataset_title( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetTitle", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "UpdateDatasetTitle", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateAuthors - /// - /// Status: ALPHA - /// - /// Updates the datasets metadata title. - pub async fn update_dataset_authors( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetAuthors", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.DatasetService", - "UpdateDatasetAuthors", - ), - ); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod dataset_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with DatasetServiceServer. - #[async_trait] - pub trait DatasetService: Send + Sync + 'static { - /// CreateNewDataset - /// - /// Status: BETA - /// - /// creates a new Dataset - async fn create_dataset( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetDataset + /// SetEndpointStatus /// /// Status: BETA /// - /// Request a specific dataset by ID - async fn get_dataset( + /// This request sets the status of a specific Endpoint + async fn set_endpoint_status( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetDatasets + /// GetEndpoint /// /// Status: BETA /// - /// Queries multiple datasets by ID - async fn get_datasets( + /// Gets an specific endpoint by ID or Name + async fn get_endpoint( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// DeleteDataset + /// GetEndpoints /// - /// Status: STABLE + /// Status: BETA /// - /// This request deletes the dataset. - async fn delete_dataset( + /// Gets all available endpoints + async fn get_endpoints( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateDatasetName + /// DeleteEndpoint /// /// Status: BETA /// - /// Updates the dataset name. Caveat! Will rename the "s3 bucket" for data proxies! - async fn update_dataset_name( + /// Deletes a specific endpoint by id + /// This needs admin permissions + async fn delete_endpoint( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateDatasetDescription + /// GetDefaultEndpoint /// /// Status: BETA /// - /// Updates the dataset description. - async fn update_dataset_description( + /// This request returns the default endpoint for the current aruna_server + /// It may produce different results depending on the used server + async fn get_default_endpoint( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateDatasetKeyValues + } + /// EndpointService + /// + /// Status: BETA + /// + /// Contains all methods that get/create or update Endpoint (Dataproxies) and associated resources + #[derive(Debug)] + pub struct EndpointServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl EndpointServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. /// - /// Status: BETA - /// - /// Updates the dataset key values. - async fn update_dataset_key_values( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateDatasetDataClass - /// - /// Status: BETA - /// - /// Updates the dataset name. All (meta) data will be overwritten. - async fn update_dataset_data_class( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// SnapshotDatasetRequest - /// - /// Status: BETA - /// - /// Archives the full dataset, rendering all downstream relations immutable - async fn snapshot_dataset( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateLicenses - /// - /// Status: BETA - /// - /// Updates the dataset metadata license and/or default data license. - async fn update_dataset_licenses( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateTitle - /// - /// Status: ALPHA - /// - /// Updates the datasets metadata title. - async fn update_dataset_title( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateAuthors - /// - /// Status: ALPHA - /// - /// Updates the datasets metadata title. - async fn update_dataset_authors( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// DatasetService - /// - /// Contains all methods that get/create or update Dataset and associated resources - #[derive(Debug)] - pub struct DatasetServiceServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl DatasetServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. /// /// Default: `usize::MAX` #[must_use] @@ -8257,9 +7323,9 @@ pub mod dataset_service_server { self } } - impl tonic::codegen::Service> for DatasetServiceServer + impl tonic::codegen::Service> for EndpointServiceServer where - T: DatasetService, + T: EndpointService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -8275,25 +7341,26 @@ pub mod dataset_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.DatasetService/CreateDataset" => { + "/aruna.api.storage.services.v2.EndpointService/CreateEndpoint" => { #[allow(non_camel_case_types)] - struct CreateDatasetSvc(pub Arc); + struct CreateEndpointSvc(pub Arc); impl< - T: DatasetService, - > tonic::server::UnaryService - for CreateDatasetSvc { - type Response = super::CreateDatasetResponse; + T: EndpointService, + > tonic::server::UnaryService + for CreateEndpointSvc { + type Response = super::CreateEndpointResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_dataset(&inner, request).await + ::create_endpoint(&inner, request) + .await }; Box::pin(fut) } @@ -8305,7 +7372,7 @@ pub mod dataset_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateDatasetSvc(inner); + let method = CreateEndpointSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -8321,25 +7388,28 @@ pub mod dataset_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DatasetService/GetDataset" => { + "/aruna.api.storage.services.v2.EndpointService/FullSyncEndpoint" => { #[allow(non_camel_case_types)] - struct GetDatasetSvc(pub Arc); + struct FullSyncEndpointSvc(pub Arc); impl< - T: DatasetService, - > tonic::server::UnaryService - for GetDatasetSvc { - type Response = super::GetDatasetResponse; + T: EndpointService, + > tonic::server::ServerStreamingService< + super::FullSyncEndpointRequest, + > for FullSyncEndpointSvc { + type Response = super::FullSyncEndpointResponse; + type ResponseStream = T::FullSyncEndpointStream; type Future = BoxFuture< - tonic::Response, + tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_dataset(&inner, request).await + ::full_sync_endpoint(&inner, request) + .await }; Box::pin(fut) } @@ -8351,7 +7421,7 @@ pub mod dataset_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetDatasetSvc(inner); + let method = FullSyncEndpointSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -8362,30 +7432,31 @@ pub mod dataset_service_server { max_decoding_message_size, max_encoding_message_size, ); - let res = grpc.unary(method, req).await; + let res = grpc.server_streaming(method, req).await; Ok(res) }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DatasetService/GetDatasets" => { + "/aruna.api.storage.services.v2.EndpointService/SetEndpointStatus" => { #[allow(non_camel_case_types)] - struct GetDatasetsSvc(pub Arc); + struct SetEndpointStatusSvc(pub Arc); impl< - T: DatasetService, - > tonic::server::UnaryService - for GetDatasetsSvc { - type Response = super::GetDatasetsResponse; + T: EndpointService, + > tonic::server::UnaryService + for SetEndpointStatusSvc { + type Response = super::SetEndpointStatusResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_datasets(&inner, request).await + ::set_endpoint_status(&inner, request) + .await }; Box::pin(fut) } @@ -8397,7 +7468,7 @@ pub mod dataset_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetDatasetsSvc(inner); + let method = SetEndpointStatusSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -8413,25 +7484,25 @@ pub mod dataset_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DatasetService/DeleteDataset" => { + "/aruna.api.storage.services.v2.EndpointService/GetEndpoint" => { #[allow(non_camel_case_types)] - struct DeleteDatasetSvc(pub Arc); + struct GetEndpointSvc(pub Arc); impl< - T: DatasetService, - > tonic::server::UnaryService - for DeleteDatasetSvc { - type Response = super::DeleteDatasetResponse; + T: EndpointService, + > tonic::server::UnaryService + for GetEndpointSvc { + type Response = super::GetEndpointResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_dataset(&inner, request).await + ::get_endpoint(&inner, request).await }; Box::pin(fut) } @@ -8443,7 +7514,7 @@ pub mod dataset_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteDatasetSvc(inner); + let method = GetEndpointSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -8459,26 +7530,25 @@ pub mod dataset_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetName" => { + "/aruna.api.storage.services.v2.EndpointService/GetEndpoints" => { #[allow(non_camel_case_types)] - struct UpdateDatasetNameSvc(pub Arc); + struct GetEndpointsSvc(pub Arc); impl< - T: DatasetService, - > tonic::server::UnaryService - for UpdateDatasetNameSvc { - type Response = super::UpdateDatasetNameResponse; + T: EndpointService, + > tonic::server::UnaryService + for GetEndpointsSvc { + type Response = super::GetEndpointsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_dataset_name(&inner, request) - .await + ::get_endpoints(&inner, request).await }; Box::pin(fut) } @@ -8490,7 +7560,7 @@ pub mod dataset_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateDatasetNameSvc(inner); + let method = GetEndpointsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -8506,30 +7576,25 @@ pub mod dataset_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetDescription" => { + "/aruna.api.storage.services.v2.EndpointService/DeleteEndpoint" => { #[allow(non_camel_case_types)] - struct UpdateDatasetDescriptionSvc(pub Arc); + struct DeleteEndpointSvc(pub Arc); impl< - T: DatasetService, - > tonic::server::UnaryService - for UpdateDatasetDescriptionSvc { - type Response = super::UpdateDatasetDescriptionResponse; + T: EndpointService, + > tonic::server::UnaryService + for DeleteEndpointSvc { + type Response = super::DeleteEndpointResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::UpdateDatasetDescriptionRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_dataset_description( - &inner, - request, - ) + ::delete_endpoint(&inner, request) .await }; Box::pin(fut) @@ -8542,7 +7607,7 @@ pub mod dataset_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateDatasetDescriptionSvc(inner); + let method = DeleteEndpointSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -8558,172 +7623,25 @@ pub mod dataset_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetKeyValues" => { + "/aruna.api.storage.services.v2.EndpointService/GetDefaultEndpoint" => { #[allow(non_camel_case_types)] - struct UpdateDatasetKeyValuesSvc(pub Arc); + struct GetDefaultEndpointSvc(pub Arc); impl< - T: DatasetService, - > tonic::server::UnaryService - for UpdateDatasetKeyValuesSvc { - type Response = super::UpdateDatasetKeyValuesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::update_dataset_key_values( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = UpdateDatasetKeyValuesSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetDataClass" => { - #[allow(non_camel_case_types)] - struct UpdateDatasetDataClassSvc(pub Arc); - impl< - T: DatasetService, - > tonic::server::UnaryService - for UpdateDatasetDataClassSvc { - type Response = super::UpdateDatasetDataClassResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::update_dataset_data_class( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = UpdateDatasetDataClassSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.DatasetService/SnapshotDataset" => { - #[allow(non_camel_case_types)] - struct SnapshotDatasetSvc(pub Arc); - impl< - T: DatasetService, - > tonic::server::UnaryService - for SnapshotDatasetSvc { - type Response = super::SnapshotDatasetResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::snapshot_dataset(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = SnapshotDatasetSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetLicenses" => { - #[allow(non_camel_case_types)] - struct UpdateDatasetLicensesSvc(pub Arc); - impl< - T: DatasetService, - > tonic::server::UnaryService - for UpdateDatasetLicensesSvc { - type Response = super::UpdateDatasetLicensesResponse; + T: EndpointService, + > tonic::server::UnaryService + for GetDefaultEndpointSvc { + type Response = super::GetDefaultEndpointResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_dataset_licenses( + ::get_default_endpoint( &inner, request, ) @@ -8739,7 +7657,7 @@ pub mod dataset_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateDatasetLicensesSvc(inner); + let method = GetDefaultEndpointSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -8755,119 +7673,22 @@ pub mod dataset_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetTitle" => { - #[allow(non_camel_case_types)] - struct UpdateDatasetTitleSvc(pub Arc); - impl< - T: DatasetService, - > tonic::server::UnaryService - for UpdateDatasetTitleSvc { - type Response = super::UpdateDatasetTitleResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::update_dataset_title(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = UpdateDatasetTitleSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.DatasetService/UpdateDatasetAuthors" => { - #[allow(non_camel_case_types)] - struct UpdateDatasetAuthorsSvc(pub Arc); - impl< - T: DatasetService, - > tonic::server::UnaryService - for UpdateDatasetAuthorsSvc { - type Response = super::UpdateDatasetAuthorsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::update_dataset_authors( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = UpdateDatasetAuthorsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) } } } } - impl Clone for DatasetServiceServer { + impl Clone for EndpointServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -8879,7 +7700,7 @@ pub mod dataset_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -8889,95 +7710,117 @@ pub mod dataset_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for DatasetServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.DatasetService"; + impl tonic::server::NamedService for EndpointServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.EndpointService"; } } -/// CreateLicenseRequest -/// -/// Request object for CreateLicense #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateLicenseRequest { - /// CC-BY-SA-4.0 +pub struct UserPermission { #[prost(string, tag = "1")] - pub tag: ::prost::alloc::string::String, - /// Creative Commons Attribution-ShareAlike 4.0 International + pub user_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub text: ::prost::alloc::string::String, - /// url is optional - /// - /// - #[prost(string, tag = "4")] - pub url: ::prost::alloc::string::String, + pub user_name: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "3")] + pub permission_level: i32, } -/// CreateLicenseResponse -/// -/// Response object for CreateLicense #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateLicenseResponse { - /// CC-BY-SA-4.0 +pub struct ResourceAuthorization { #[prost(string, tag = "1")] - pub tag: ::prost::alloc::string::String, + pub resource_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub user_permission: ::prost::alloc::vec::Vec, } -/// GetLicenseRequest -/// -/// Request object for GetLicense #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetLicenseRequest { - /// 1234567890abcdef +pub struct CreateAuthorizationRequest { #[prost(string, tag = "1")] - pub tag: ::prost::alloc::string::String, + pub resource_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub user_id: ::prost::alloc::string::String, + /// Can also include "deny" + #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "3")] + pub permission_level: i32, } -/// GetLicenseResponse -/// -/// Response object for GetLicense #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetLicenseResponse { - #[prost(message, optional, tag = "1")] - pub license: ::core::option::Option, +pub struct CreateAuthorizationResponse { + #[prost(string, tag = "1")] + pub resource_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub user_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub user_name: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "4")] + pub permission_level: i32, } -/// ListLicensesRequest -/// -/// Request object for ListLicense #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListLicensesRequest {} -/// ListLicenseResponse -/// -/// Response object for ListLicense +pub struct GetAuthorizationsRequest { + #[prost(string, tag = "1")] + pub resource_id: ::prost::alloc::string::String, + #[prost(bool, tag = "2")] + pub recursive: bool, +} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListLicensesResponse { +pub struct GetAuthorizationsResponse { #[prost(message, repeated, tag = "1")] - pub licenses: ::prost::alloc::vec::Vec, + pub authorizations: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteAuthorizationRequest { + #[prost(string, tag = "1")] + pub resource_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub user_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteAuthorizationResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateAuthorizationRequest { + #[prost(string, tag = "1")] + pub resource_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub user_id: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "3")] + pub permission_level: i32, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateAuthorizationResponse { + #[prost(message, optional, tag = "1")] + pub user_permission: ::core::option::Option, } /// Generated client implementations. -pub mod license_service_client { +pub mod authorization_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// LicenseService + /// AuthorizationService /// /// Status: BETA /// - /// Contains all methods to add, get or list (custom) licenses + /// Contains all methods to edit and change user authorization #[derive(Debug, Clone)] - pub struct LicenseServiceClient { + pub struct AuthorizationServiceClient { inner: tonic::client::Grpc, } - impl LicenseServiceClient + impl AuthorizationServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -8995,7 +7838,7 @@ pub mod license_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> LicenseServiceClient> + ) -> AuthorizationServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -9009,7 +7852,7 @@ pub mod license_service_client { http::Request, >>::Error: Into + Send + Sync, { - LicenseServiceClient::new(InterceptedService::new(inner, interceptor)) + AuthorizationServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -9042,16 +7885,17 @@ pub mod license_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// CreateLicense + /// CreateAuthorization /// /// Status: BETA /// - /// This creates a new license - pub async fn create_license( + /// This creates a user-specific attribute that handles permission for a + /// specific resource + pub async fn create_authorization( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9065,28 +7909,28 @@ pub mod license_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.LicenseService/CreateLicense", + "/aruna.api.storage.services.v2.AuthorizationService/CreateAuthorization", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.LicenseService", - "CreateLicense", + "aruna.api.storage.services.v2.AuthorizationService", + "CreateAuthorization", ), ); self.inner.unary(req, path, codec).await } - /// GetLicense + /// GetAuthorization /// /// Status: BETA /// - /// This returns the license for a given tag - pub async fn get_license( + /// This gets resource specific user authorizations + pub async fn get_authorizations( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9100,28 +7944,29 @@ pub mod license_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.LicenseService/GetLicense", + "/aruna.api.storage.services.v2.AuthorizationService/GetAuthorizations", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.LicenseService", - "GetLicense", + "aruna.api.storage.services.v2.AuthorizationService", + "GetAuthorizations", ), ); self.inner.unary(req, path, codec).await } - /// ListLicenses + /// DeleteAuthorization /// /// Status: BETA /// - /// This returns a list of all licenses - pub async fn list_licenses( + /// This deletes a user-specific attribute that handles permission for a + /// specific resource + pub async fn delete_authorization( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9135,14 +7980,50 @@ pub mod license_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.LicenseService/ListLicenses", + "/aruna.api.storage.services.v2.AuthorizationService/DeleteAuthorization", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.LicenseService", - "ListLicenses", + "aruna.api.storage.services.v2.AuthorizationService", + "DeleteAuthorization", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateAuthorization + /// + /// Status: BETA + /// + /// This creates a user-specific attribute that handles permission for a + /// specific resource + pub async fn update_authorization( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.AuthorizationService/UpdateAuthorization", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.AuthorizationService", + "UpdateAuthorization", ), ); self.inner.unary(req, path, codec).await @@ -9150,56 +8031,71 @@ pub mod license_service_client { } } /// Generated server implementations. -pub mod license_service_server { +pub mod authorization_service_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with LicenseServiceServer. + /// Generated trait containing gRPC methods that should be implemented for use with AuthorizationServiceServer. #[async_trait] - pub trait LicenseService: Send + Sync + 'static { - /// CreateLicense + pub trait AuthorizationService: Send + Sync + 'static { + /// CreateAuthorization /// /// Status: BETA /// - /// This creates a new license - async fn create_license( + /// This creates a user-specific attribute that handles permission for a + /// specific resource + async fn create_authorization( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetLicense + /// GetAuthorization /// /// Status: BETA /// - /// This returns the license for a given tag - async fn get_license( + /// This gets resource specific user authorizations + async fn get_authorizations( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ListLicenses + /// DeleteAuthorization /// /// Status: BETA /// - /// This returns a list of all licenses - async fn list_licenses( + /// This deletes a user-specific attribute that handles permission for a + /// specific resource + async fn delete_authorization( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, + tonic::Status, + >; + /// UpdateAuthorization + /// + /// Status: BETA + /// + /// This creates a user-specific attribute that handles permission for a + /// specific resource + async fn update_authorization( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, tonic::Status, >; } - /// LicenseService + /// AuthorizationService /// /// Status: BETA /// - /// Contains all methods to add, get or list (custom) licenses + /// Contains all methods to edit and change user authorization #[derive(Debug)] - pub struct LicenseServiceServer { + pub struct AuthorizationServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -9207,7 +8103,7 @@ pub mod license_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl LicenseServiceServer { + impl AuthorizationServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -9259,9 +8155,10 @@ pub mod license_service_server { self } } - impl tonic::codegen::Service> for LicenseServiceServer + impl tonic::codegen::Service> + for AuthorizationServiceServer where - T: LicenseService, + T: AuthorizationService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -9277,25 +8174,29 @@ pub mod license_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.LicenseService/CreateLicense" => { + "/aruna.api.storage.services.v2.AuthorizationService/CreateAuthorization" => { #[allow(non_camel_case_types)] - struct CreateLicenseSvc(pub Arc); + struct CreateAuthorizationSvc(pub Arc); impl< - T: LicenseService, - > tonic::server::UnaryService - for CreateLicenseSvc { - type Response = super::CreateLicenseResponse; + T: AuthorizationService, + > tonic::server::UnaryService + for CreateAuthorizationSvc { + type Response = super::CreateAuthorizationResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_license(&inner, request).await + ::create_authorization( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -9307,7 +8208,7 @@ pub mod license_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateLicenseSvc(inner); + let method = CreateAuthorizationSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -9323,25 +8224,29 @@ pub mod license_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.LicenseService/GetLicense" => { + "/aruna.api.storage.services.v2.AuthorizationService/GetAuthorizations" => { #[allow(non_camel_case_types)] - struct GetLicenseSvc(pub Arc); + struct GetAuthorizationsSvc(pub Arc); impl< - T: LicenseService, - > tonic::server::UnaryService - for GetLicenseSvc { - type Response = super::GetLicenseResponse; + T: AuthorizationService, + > tonic::server::UnaryService + for GetAuthorizationsSvc { + type Response = super::GetAuthorizationsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_license(&inner, request).await + ::get_authorizations( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -9353,7 +8258,7 @@ pub mod license_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetLicenseSvc(inner); + let method = GetAuthorizationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -9369,25 +8274,29 @@ pub mod license_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.LicenseService/ListLicenses" => { + "/aruna.api.storage.services.v2.AuthorizationService/DeleteAuthorization" => { #[allow(non_camel_case_types)] - struct ListLicensesSvc(pub Arc); + struct DeleteAuthorizationSvc(pub Arc); impl< - T: LicenseService, - > tonic::server::UnaryService - for ListLicensesSvc { - type Response = super::ListLicensesResponse; + T: AuthorizationService, + > tonic::server::UnaryService + for DeleteAuthorizationSvc { + type Response = super::DeleteAuthorizationResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::list_licenses(&inner, request).await + ::delete_authorization( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -9399,7 +8308,57 @@ pub mod license_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ListLicensesSvc(inner); + let method = DeleteAuthorizationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.AuthorizationService/UpdateAuthorization" => { + #[allow(non_camel_case_types)] + struct UpdateAuthorizationSvc(pub Arc); + impl< + T: AuthorizationService, + > tonic::server::UnaryService + for UpdateAuthorizationSvc { + type Response = super::UpdateAuthorizationResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_authorization( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateAuthorizationSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -9430,7 +8389,7 @@ pub mod license_service_server { } } } - impl Clone for LicenseServiceServer { + impl Clone for AuthorizationServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -9442,7 +8401,7 @@ pub mod license_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -9452,164 +8411,291 @@ pub mod license_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for LicenseServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.LicenseService"; + impl tonic::server::NamedService + for AuthorizationServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.AuthorizationService"; } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateWorkspaceTemplateRequest { - /// The user id of the template owner (will be automatically added as "admin" to each associated workspace) +pub struct CreateServiceAccountRequest { #[prost(string, tag = "1")] - pub owner_id: ::prost::alloc::string::String, - /// Short prefix for each workspace_project (will be prepended by a random id) example: test-i12ashj9g2 - #[prost(string, tag = "2")] - pub prefix: ::prost::alloc::string::String, - /// The name of the workspace template - #[prost(string, tag = "3")] pub name: ::prost::alloc::string::String, - /// Hooks that are added to created workspaces - #[prost(string, repeated, tag = "5")] - pub hook_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Description of the workspace - #[prost(string, tag = "6")] - pub description: ::prost::alloc::string::String, - /// Endpoint ids that are used for this template - #[prost(string, repeated, tag = "7")] - pub endpoint_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Rule ids that are enforced on workspace-level - #[prost(string, repeated, tag = "8")] - pub rules: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, tag = "2")] + pub project_id: ::prost::alloc::string::String, + #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "3")] + pub permission_level: i32, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateWorkspaceTemplateResponse { +pub struct ServiceAccount { #[prost(string, tag = "1")] - pub template_id: ::prost::alloc::string::String, + pub svc_account_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub permission: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetWorkspaceTemplateRequest { +pub struct CreateServiceAccountResponse { + #[prost(message, optional, tag = "1")] + pub service_account: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateServiceAccountTokenRequest { #[prost(string, tag = "1")] - pub template_id: ::prost::alloc::string::String, + pub svc_account_id: ::prost::alloc::string::String, + /// Token permissions + #[prost(message, optional, tag = "2")] + pub permission: ::core::option::Option, + /// (optional) Token name + #[prost(string, tag = "3")] + pub name: ::prost::alloc::string::String, + /// (optional) Token expiry + #[prost(message, optional, tag = "4")] + pub expires_at: ::core::option::Option<::prost_wkt_types::Timestamp>, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetWorkspaceTemplateResponse { +pub struct CreateServiceAccountTokenResponse { + /// This contains only the token description #[prost(message, optional, tag = "1")] - pub workspace: ::core::option::Option, + pub token: ::core::option::Option, + /// This is the actual secret API token + #[prost(string, tag = "2")] + pub token_secret: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteWorkspaceTemplateRequest { +pub struct GetServiceAccountTokenRequest { #[prost(string, tag = "1")] - pub template_id: ::prost::alloc::string::String, + pub svc_account_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub token_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteWorkspaceTemplateResponse {} +pub struct GetServiceAccountTokenResponse { + /// This contains only the token description + #[prost(message, optional, tag = "1")] + pub token: ::core::option::Option, +} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListOwnedWorkspaceTemplatesRequest {} +pub struct GetServiceAccountTokensRequest { + #[prost(string, tag = "1")] + pub svc_account_id: ::prost::alloc::string::String, +} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListOwnedWorkspaceTemplatesResponse { +pub struct GetServiceAccountTokensResponse { + /// This contains only the token description #[prost(message, repeated, tag = "1")] - pub workspaces: ::prost::alloc::vec::Vec, + pub tokens: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct WorkspaceInfo { +pub struct DeleteServiceAccountTokenRequest { #[prost(string, tag = "1")] - pub workspace_id: ::prost::alloc::string::String, + pub svc_account_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, + pub token_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteServiceAccountTokenResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteServiceAccountTokensRequest { + #[prost(string, tag = "1")] + pub svc_account_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteServiceAccountTokensResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteServiceAccountRequest { + #[prost(string, tag = "1")] + pub svc_account_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteServiceAccountResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateS3CredentialsSvcAccountRequest { + #[prost(string, tag = "1")] + pub svc_account_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateS3CredentialsSvcAccountResponse { + #[prost(string, tag = "1")] + pub s3_access_key: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub s3_secret_key: ::prost::alloc::string::String, #[prost(string, tag = "3")] - pub description: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub owner: ::prost::alloc::string::String, - #[prost(string, tag = "5")] - pub prefix: ::prost::alloc::string::String, - #[prost(string, tag = "6")] - pub hook_ids: ::prost::alloc::string::String, - #[prost(string, tag = "7")] - pub endpoint_ids: ::prost::alloc::string::String, + pub s3_endpoint_url: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateWorkspaceRequest { - /// Workspace template id +pub struct GetS3CredentialsSvcAccountRequest { + /// If called as admin, an id must be provided #[prost(string, tag = "1")] - pub workspace_template: ::prost::alloc::string::String, - /// Description of this workspace instance + pub svc_account_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, + pub endpoint_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateWorkspaceResponse { +pub struct GetS3CredentialsSvcAccountResponse { #[prost(string, tag = "1")] - pub workspace_id: ::prost::alloc::string::String, + pub s3_access_key: ::prost::alloc::string::String, #[prost(string, tag = "2")] - pub token: ::prost::alloc::string::String, + pub s3_secret_key: ::prost::alloc::string::String, #[prost(string, tag = "3")] - pub access_key: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub secret_key: ::prost::alloc::string::String, + pub s3_endpoint_url: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteWorkspaceRequest { +pub struct DeleteS3CredentialsSvcAccountRequest { #[prost(string, tag = "1")] - pub workspace_id: ::prost::alloc::string::String, + pub svc_account_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteWorkspaceResponse {} +pub struct DeleteS3CredentialsSvcAccountResponse {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClaimWorkspaceRequest { - /// This can only be called by an registered user, - /// that is in possesion of the workspace_id and workspace token - /// It will remove the service account and claim all references "as" the user. +pub struct CreateDataproxyTokenSvcAccountRequest { + /// Needs to be provided by project admins #[prost(string, tag = "1")] - pub workspace_id: ::prost::alloc::string::String, + pub svc_account_id: ::prost::alloc::string::String, + /// optional context to limit the scope + #[prost(message, optional, tag = "3")] + pub context: ::core::option::Option, #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateDataproxyTokenSvcAccountResponse { + #[prost(string, tag = "1")] pub token: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClaimWorkspaceResponse {} +pub struct AddPubkeySvcAccountRequest { + #[prost(string, tag = "1")] + pub svc_account_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub public_key: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddPubkeySvcAccountResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddTrustedEndpointsSvcAccountRequest { + #[prost(string, tag = "1")] + pub svc_account_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddTrustedEndpointsSvcAccountResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RemoveTrustedEndpointsSvcAccountRequest { + #[prost(string, tag = "1")] + pub svc_account_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RemoveTrustedEndpointsSvcAccountResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddDataProxyAttributeSvcAccountRequest { + #[prost(string, tag = "1")] + pub svc_account_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub attribute: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddDataProxyAttributeSvcAccountResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RemoveDataProxyAttributeSvcAccountRequest { + #[prost(string, tag = "1")] + pub svc_account_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub dataproxy_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub attribute_name: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RemoveDataProxyAttributeSvcAccountResponse {} /// Generated client implementations. -pub mod workspace_service_client { +pub mod service_account_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// WorkspaceService + /// ServiceAccountService /// /// Status: BETA /// - /// Service to manage anonymous "scratch" projects / workspaces + /// Service that contains CRUD operations for service_accounts. + /// Service accounts are project specific accounts that can be used for automation. #[derive(Debug, Clone)] - pub struct WorkspaceServiceClient { + pub struct ServiceAccountServiceClient { inner: tonic::client::Grpc, } - impl WorkspaceServiceClient + impl ServiceAccountServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -9627,7 +8713,7 @@ pub mod workspace_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> WorkspaceServiceClient> + ) -> ServiceAccountServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -9641,7 +8727,7 @@ pub mod workspace_service_client { http::Request, >>::Error: Into + Send + Sync, { - WorkspaceServiceClient::new(InterceptedService::new(inner, interceptor)) + ServiceAccountServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -9674,16 +8760,18 @@ pub mod workspace_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// CreatesNewWorkspaceTemplate + /// CreateServiceAccount /// - /// Status: ALPHA + /// Status: BETA /// - /// This will create a new template for workspaces (admin only) - pub async fn create_workspace_template( + /// Creates a service account for a given project + /// If the service account has permissions for the global Admin project + /// it will be a global service account that can interact with any resource + pub async fn create_service_account( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9697,28 +8785,30 @@ pub mod workspace_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.WorkspaceService/CreateWorkspaceTemplate", + "/aruna.api.storage.services.v2.ServiceAccountService/CreateServiceAccount", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.WorkspaceService", - "CreateWorkspaceTemplate", + "aruna.api.storage.services.v2.ServiceAccountService", + "CreateServiceAccount", ), ); self.inner.unary(req, path, codec).await } - /// GetWorkspaceTemplatesById + /// CreateServiceAccountToken /// - /// Status: ALPHA + /// Status: BETA /// - /// Gets workspace template by id - pub async fn get_workspace_template( + /// Creates a token for a service account + /// Each service account can only have one permission -> The token will have the same permission as the + /// service account or a subset of it. + pub async fn create_service_account_token( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9732,28 +8822,29 @@ pub mod workspace_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.WorkspaceService/GetWorkspaceTemplate", + "/aruna.api.storage.services.v2.ServiceAccountService/CreateServiceAccountToken", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.WorkspaceService", - "GetWorkspaceTemplate", + "aruna.api.storage.services.v2.ServiceAccountService", + "CreateServiceAccountToken", ), ); self.inner.unary(req, path, codec).await } - /// ListOwnedWorkspaceTemplates + /// GetServiceAccountToken /// - /// Status: ALPHA + /// Status: BETA /// - /// Lists owned workspace templates - pub async fn list_owned_workspace_templates( + /// This requests the overall information about a specifc service account token (by id) + /// it will not contain the token itself. + pub async fn get_service_account_token( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9767,28 +8858,29 @@ pub mod workspace_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.WorkspaceService/ListOwnedWorkspaceTemplates", + "/aruna.api.storage.services.v2.ServiceAccountService/GetServiceAccountToken", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.WorkspaceService", - "ListOwnedWorkspaceTemplates", + "aruna.api.storage.services.v2.ServiceAccountService", + "GetServiceAccountToken", ), ); self.inner.unary(req, path, codec).await } - /// DeleteWorkspaceTemplates + /// GetServiceAccountTokens /// - /// Status: ALPHA + /// Status: BETA /// - /// Deletes specified workspace templates - pub async fn delete_workspace_template( + /// This requests the overall information about all service account tokens + /// it will not contain the token itself. + pub async fn get_service_account_tokens( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9802,28 +8894,28 @@ pub mod workspace_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.WorkspaceService/DeleteWorkspaceTemplate", + "/aruna.api.storage.services.v2.ServiceAccountService/GetServiceAccountTokens", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.WorkspaceService", - "DeleteWorkspaceTemplate", + "aruna.api.storage.services.v2.ServiceAccountService", + "GetServiceAccountTokens", ), ); self.inner.unary(req, path, codec).await } - /// CreateWorkspace + /// DeleteServiceAccountToken /// - /// Status: ALPHA + /// Status: BETA /// - /// Create a personal anonymous workspace - pub async fn create_workspace( + /// Deletes one service account token by ID + pub async fn delete_service_account_token( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9837,28 +8929,28 @@ pub mod workspace_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.WorkspaceService/CreateWorkspace", + "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccountToken", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.WorkspaceService", - "CreateWorkspace", + "aruna.api.storage.services.v2.ServiceAccountService", + "DeleteServiceAccountToken", ), ); self.inner.unary(req, path, codec).await } - /// DeleteWorkspace + /// DeleteServiceAccountTokens /// - /// Status: ALPHA + /// Status: BETA /// - /// Delete a workspace - pub async fn delete_workspace( + /// Deletes all service account tokens + pub async fn delete_service_account_tokens( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9872,28 +8964,28 @@ pub mod workspace_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.WorkspaceService/DeleteWorkspace", + "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccountTokens", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.WorkspaceService", - "DeleteWorkspace", + "aruna.api.storage.services.v2.ServiceAccountService", + "DeleteServiceAccountTokens", ), ); self.inner.unary(req, path, codec).await } - /// DeleteWorkspace + /// DeleteServiceAccount /// - /// Status: ALPHA + /// Status: BETA /// - /// Claims an anonymous workspace, and transfers the owner to a regular user account. - pub async fn claim_workspace( + /// Deletes a service account (by id) + pub async fn delete_service_account( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -9907,2943 +8999,658 @@ pub mod workspace_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.WorkspaceService/ClaimWorkspace", + "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccount", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.WorkspaceService", - "ClaimWorkspace", + "aruna.api.storage.services.v2.ServiceAccountService", + "DeleteServiceAccount", ), ); self.inner.unary(req, path, codec).await } - } -} -/// Generated server implementations. -pub mod workspace_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with WorkspaceServiceServer. - #[async_trait] - pub trait WorkspaceService: Send + Sync + 'static { - /// CreatesNewWorkspaceTemplate + /// CreateS3CredentialsSvcAccount /// /// Status: ALPHA /// - /// This will create a new template for workspaces (admin only) - async fn create_workspace_template( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetWorkspaceTemplatesById - /// - /// Status: ALPHA - /// - /// Gets workspace template by id - async fn get_workspace_template( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// ListOwnedWorkspaceTemplates - /// - /// Status: ALPHA - /// - /// Lists owned workspace templates - async fn list_owned_workspace_templates( - &self, - request: tonic::Request, + /// Creates or updates S3 credentials for a specific SvcAccount and data_proxy + pub async fn create_s3_credentials_svc_account( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// DeleteWorkspaceTemplates + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ServiceAccountService/CreateS3CredentialsSvcAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ServiceAccountService", + "CreateS3CredentialsSvcAccount", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetS3CredentialsSvcAccount /// - /// Status: ALPHA + /// Status: ALPHA /// - /// Deletes specified workspace templates - async fn delete_workspace_template( - &self, - request: tonic::Request, + /// Gets S3 credentials for a specific svc_account and data_proxy + pub async fn get_s3_credentials_svc_account( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// CreateWorkspace + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ServiceAccountService/GetS3CredentialsSvcAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ServiceAccountService", + "GetS3CredentialsSvcAccount", + ), + ); + self.inner.unary(req, path, codec).await + } + /// DeleteS3CredentialsSvcAccount /// /// Status: ALPHA /// - /// Create a personal anonymous workspace - async fn create_workspace( - &self, - request: tonic::Request, + /// Revokes existing S3 credentials for a specific user and data_proxy + pub async fn delete_s3_credentials_svc_account( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// DeleteWorkspace + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ServiceAccountService/DeleteS3CredentialsSvcAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ServiceAccountService", + "DeleteS3CredentialsSvcAccount", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetDataproxyToken /// /// Status: ALPHA /// - /// Delete a workspace - async fn delete_workspace( - &self, - request: tonic::Request, + /// Gets token for a specific SvcAccount and data_proxy + pub async fn create_dataproxy_token_svc_account( + &mut self, + request: impl tonic::IntoRequest< + super::CreateDataproxyTokenSvcAccountRequest, + >, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// DeleteWorkspace + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ServiceAccountService/CreateDataproxyTokenSvcAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ServiceAccountService", + "CreateDataproxyTokenSvcAccount", + ), + ); + self.inner.unary(req, path, codec).await + } + /// AddPubkeySvcAccount /// /// Status: ALPHA /// - /// Claims an anonymous workspace, and transfers the owner to a regular user account. - async fn claim_workspace( - &self, - request: tonic::Request, + /// Adds an ED25519 public key for the SvcAccount + pub async fn add_pubkey_svc_account( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - } - /// WorkspaceService - /// - /// Status: BETA - /// - /// Service to manage anonymous "scratch" projects / workspaces - #[derive(Debug)] - pub struct WorkspaceServiceServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl WorkspaceServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ServiceAccountService/AddPubkeySvcAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ServiceAccountService", + "AddPubkeySvcAccount", + ), + ); + self.inner.unary(req, path, codec).await } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self + /// AddTrustedEndpointsSvcAccount + /// + /// Status: ALPHA + /// + /// Adds an endpoint to the trusted endpoints list of the SvcAccount + pub async fn add_trusted_endpoints_svc_account( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ServiceAccountService/AddTrustedEndpointsSvcAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ServiceAccountService", + "AddTrustedEndpointsSvcAccount", + ), + ); + self.inner.unary(req, path, codec).await } - /// Limits the maximum size of a decoded message. + /// RemoveTrustedEndpointsSvcAccount /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self + /// Status: ALPHA + /// + /// Removes an endpoint from the trusted endpoints list of the SvcAccount + pub async fn remove_trusted_endpoints_svc_account( + &mut self, + request: impl tonic::IntoRequest< + super::RemoveTrustedEndpointsSvcAccountRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ServiceAccountService/RemoveTrustedEndpointsSvcAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ServiceAccountService", + "RemoveTrustedEndpointsSvcAccount", + ), + ); + self.inner.unary(req, path, codec).await } - /// Limits the maximum size of an encoded message. + /// AddDataProxyAttributeSvcAccount /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self + /// Status: ALPHA + /// + /// Adds an data proxy specific attribute to the SvcAccount + pub async fn add_data_proxy_attribute_svc_account( + &mut self, + request: impl tonic::IntoRequest< + super::AddDataProxyAttributeSvcAccountRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ServiceAccountService/AddDataProxyAttributeSvcAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ServiceAccountService", + "AddDataProxyAttributeSvcAccount", + ), + ); + self.inner.unary(req, path, codec).await } - } - impl tonic::codegen::Service> for WorkspaceServiceServer - where - T: WorkspaceService, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( + /// RemoveDataProxyAttributeSvcAccount + /// + /// Status: ALPHA + /// + /// Removes an data proxy specific attribute from the SvcAccount + pub async fn remove_data_proxy_attribute_svc_account( &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) + request: impl tonic::IntoRequest< + super::RemoveDataProxyAttributeSvcAccountRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ServiceAccountService/RemoveDataProxyAttributeSvcAccount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ServiceAccountService", + "RemoveDataProxyAttributeSvcAccount", + ), + ); + self.inner.unary(req, path, codec).await } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/aruna.api.storage.services.v2.WorkspaceService/CreateWorkspaceTemplate" => { - #[allow(non_camel_case_types)] - struct CreateWorkspaceTemplateSvc(pub Arc); - impl< - T: WorkspaceService, - > tonic::server::UnaryService - for CreateWorkspaceTemplateSvc { - type Response = super::CreateWorkspaceTemplateResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::CreateWorkspaceTemplateRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::create_workspace_template( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = CreateWorkspaceTemplateSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.WorkspaceService/GetWorkspaceTemplate" => { - #[allow(non_camel_case_types)] - struct GetWorkspaceTemplateSvc(pub Arc); - impl< - T: WorkspaceService, - > tonic::server::UnaryService - for GetWorkspaceTemplateSvc { - type Response = super::GetWorkspaceTemplateResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_workspace_template( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetWorkspaceTemplateSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.WorkspaceService/ListOwnedWorkspaceTemplates" => { - #[allow(non_camel_case_types)] - struct ListOwnedWorkspaceTemplatesSvc( - pub Arc, - ); - impl< - T: WorkspaceService, - > tonic::server::UnaryService< - super::ListOwnedWorkspaceTemplatesRequest, - > for ListOwnedWorkspaceTemplatesSvc { - type Response = super::ListOwnedWorkspaceTemplatesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::ListOwnedWorkspaceTemplatesRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::list_owned_workspace_templates( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = ListOwnedWorkspaceTemplatesSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.WorkspaceService/DeleteWorkspaceTemplate" => { - #[allow(non_camel_case_types)] - struct DeleteWorkspaceTemplateSvc(pub Arc); - impl< - T: WorkspaceService, - > tonic::server::UnaryService - for DeleteWorkspaceTemplateSvc { - type Response = super::DeleteWorkspaceTemplateResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::DeleteWorkspaceTemplateRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::delete_workspace_template( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = DeleteWorkspaceTemplateSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.WorkspaceService/CreateWorkspace" => { - #[allow(non_camel_case_types)] - struct CreateWorkspaceSvc(pub Arc); - impl< - T: WorkspaceService, - > tonic::server::UnaryService - for CreateWorkspaceSvc { - type Response = super::CreateWorkspaceResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::create_workspace(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = CreateWorkspaceSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.WorkspaceService/DeleteWorkspace" => { - #[allow(non_camel_case_types)] - struct DeleteWorkspaceSvc(pub Arc); - impl< - T: WorkspaceService, - > tonic::server::UnaryService - for DeleteWorkspaceSvc { - type Response = super::DeleteWorkspaceResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::delete_workspace(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = DeleteWorkspaceSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.WorkspaceService/ClaimWorkspace" => { - #[allow(non_camel_case_types)] - struct ClaimWorkspaceSvc(pub Arc); - impl< - T: WorkspaceService, - > tonic::server::UnaryService - for ClaimWorkspaceSvc { - type Response = super::ClaimWorkspaceResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::claim_workspace(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = ClaimWorkspaceSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for WorkspaceServiceServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for WorkspaceServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.WorkspaceService"; - } -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RegisterUserRequest { - /// user_displayname - #[prost(string, tag = "1")] - pub display_name: ::prost::alloc::string::String, - /// Mail address (optional) - #[prost(string, tag = "2")] - pub email: ::prost::alloc::string::String, - /// Project hint description string (optional) - #[prost(string, tag = "3")] - pub project: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RegisterUserResponse { - /// Created user id - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateApiTokenRequest { - /// Token name - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// Personal or resource specific - #[prost(message, optional, tag = "2")] - pub permission: ::core::option::Option, - /// Token expiry - #[prost(message, optional, tag = "3")] - pub expires_at: ::core::option::Option<::prost_wkt_types::Timestamp>, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateApiTokenResponse { - /// This contains only the token description - #[prost(message, optional, tag = "1")] - pub token: ::core::option::Option, - /// This is the actual secret token - /// Attention, this can not be recreated and needs to be stored securely - /// New tokens will always contain a new secret - #[prost(string, tag = "2")] - pub token_secret: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetApiTokenRequest { - /// The token id - #[prost(string, tag = "1")] - pub token_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetApiTokenResponse { - /// List of API tokens - #[prost(message, optional, tag = "1")] - pub token: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetApiTokensRequest {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetApiTokensResponse { - /// List of API tokens with redacted actual token - #[prost(message, repeated, tag = "1")] - pub tokens: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteApiTokenRequest { - /// The token_id - #[prost(string, tag = "1")] - pub token_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteApiTokenResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteApiTokensRequest { - /// This request invalidates all tokens of a specific user - /// usually the user_id is specified via the provided oidc or aruna token - /// This user_id can be used by admins to invalidate all tokens of a specific - /// user - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteApiTokensResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetUserRequest { - /// Optional user_id - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetUserResponse { - /// User info - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetUserRedactedRequest { - /// Optional user_id - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetUserRedactedResponse { - /// User info - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateUserDisplayNameRequest { - /// New display name - #[prost(string, tag = "1")] - pub new_display_name: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateUserDisplayNameResponse { - /// Updated user info - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ActivateUserRequest { - /// User to activate - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ActivateUserResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetNotActivatedUsersRequest {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetNotActivatedUsersResponse { - /// List of users that are not yet activated - #[prost(message, repeated, tag = "1")] - pub users: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAllUsersRequest {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetAllUsersResponse { - #[prost(message, repeated, tag = "1")] - pub user: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeactivateUserRequest { - /// User to activate - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeactivateUserResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateUserEmailRequest { - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, - /// If new email is empty == unsubscribe - #[prost(string, tag = "2")] - pub new_email: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateUserEmailResponse { - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateS3CredentialsUserTokenRequest { - #[prost(string, tag = "1")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateS3CredentialsUserTokenResponse { - #[prost(string, tag = "1")] - pub s3_access_key: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub s3_secret_key: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub s3_endpoint_url: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetS3CredentialsUserTokenRequest { - #[prost(string, tag = "1")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetS3CredentialsUserTokenResponse { - #[prost(string, tag = "1")] - pub s3_access_key: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub s3_secret_key: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub s3_endpoint_url: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteS3CredentialsUserTokenRequest { - #[prost(string, tag = "1")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteS3CredentialsUserResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDataproxyTokenUserRequest { - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub context: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDataproxyTokenUserResponse { - #[prost(string, tag = "1")] - pub token: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetPersonalNotificationsRequest {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetPersonalNotificationsResponse { - #[prost(message, repeated, tag = "1")] - pub notifications: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AcknowledgePersonalNotificationsRequest { - #[prost(string, repeated, tag = "1")] - pub notification_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AcknowledgePersonalNotificationsResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Reference { - #[prost(enumeration = "ReferenceType", tag = "1")] - pub ref_type: i32, - /// "User A" | file.txt - #[prost(string, tag = "2")] - pub ref_name: ::prost::alloc::string::String, - /// 0123AAA123AAA (id) - #[prost(string, tag = "3")] - pub ref_value: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PersonalNotification { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - #[prost(enumeration = "PersonalNotificationVariant", tag = "2")] - pub variant: i32, - /// User A has requested access for resource B - #[prost(string, tag = "3")] - pub message: ::prost::alloc::string::String, - /// References to resource in the "message" - #[prost(message, repeated, tag = "4")] - pub refs: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddOidcProviderRequest { - #[prost(string, tag = "1")] - pub new_access_token: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddOidcProviderResponse { - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveOidcProviderRequest { - #[prost(string, tag = "1")] - pub provider_url: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveOidcProviderResponse { - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddPubkeyUserRequest { - #[prost(string, tag = "1")] - pub public_key: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddPubkeyUserResponse { - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddTrustedEndpointsUserRequest { - #[prost(string, tag = "1")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddTrustedEndpointsUserResponse { - /// Here would be the place to add conditions - /// why the request was denied - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveTrustedEndpointsUserRequest { - #[prost(string, tag = "1")] - pub endpoint_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveTrustedEndpointsUserResponse { - #[prost(message, optional, tag = "1")] - pub user: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddDataProxyAttributeUserRequest { - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub attribute: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddDataProxyAttributeUserResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveDataProxyAttributeUserRequest { - #[prost(string, tag = "1")] - pub user_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub dataproxy_id: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub attribute_name: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RemoveDataProxyAttributeUserResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ReferenceType { - Unspecified = 0, - User = 1, - Resource = 2, -} -impl ReferenceType { - /// 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 { - ReferenceType::Unspecified => "REFERENCE_TYPE_UNSPECIFIED", - ReferenceType::User => "REFERENCE_TYPE_USER", - ReferenceType::Resource => "REFERENCE_TYPE_RESOURCE", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "REFERENCE_TYPE_UNSPECIFIED" => Some(Self::Unspecified), - "REFERENCE_TYPE_USER" => Some(Self::User), - "REFERENCE_TYPE_RESOURCE" => Some(Self::Resource), - _ => None, - } - } -} -#[derive(serde::Deserialize, serde::Serialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum PersonalNotificationVariant { - Unspecified = 0, - AccessRequested = 1, - PermissionGranted = 2, - PermissionRevoked = 3, - PermissionUpdated = 4, - Announcement = 5, -} -impl PersonalNotificationVariant { - /// 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 { - PersonalNotificationVariant::Unspecified => { - "PERSONAL_NOTIFICATION_VARIANT_UNSPECIFIED" - } - PersonalNotificationVariant::AccessRequested => { - "PERSONAL_NOTIFICATION_VARIANT_ACCESS_REQUESTED" - } - PersonalNotificationVariant::PermissionGranted => { - "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_GRANTED" - } - PersonalNotificationVariant::PermissionRevoked => { - "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_REVOKED" - } - PersonalNotificationVariant::PermissionUpdated => { - "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_UPDATED" - } - PersonalNotificationVariant::Announcement => { - "PERSONAL_NOTIFICATION_VARIANT_ANNOUNCEMENT" - } - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "PERSONAL_NOTIFICATION_VARIANT_UNSPECIFIED" => Some(Self::Unspecified), - "PERSONAL_NOTIFICATION_VARIANT_ACCESS_REQUESTED" => { - Some(Self::AccessRequested) - } - "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_GRANTED" => { - Some(Self::PermissionGranted) - } - "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_REVOKED" => { - Some(Self::PermissionRevoked) - } - "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_UPDATED" => { - Some(Self::PermissionUpdated) - } - "PERSONAL_NOTIFICATION_VARIANT_ANNOUNCEMENT" => Some(Self::Announcement), - _ => None, - } - } -} -/// Generated client implementations. -pub mod user_service_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// UserService - /// - /// Status: BETA - /// - /// Contains all CRUD methods for users and associated resource - #[derive(Debug, Clone)] - pub struct UserServiceClient { - inner: tonic::client::Grpc, - } - impl UserServiceClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> UserServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - UserServiceClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// RegisterUser - /// - /// Status: BETA - /// - /// This request should be called when a new user logs in for the first time - pub async fn register_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/RegisterUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "RegisterUser", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeActivateUser - /// - /// Status: BETA - /// - /// This deactivates a specific user (Admin request) - pub async fn deactivate_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/DeactivateUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "DeactivateUser", - ), - ); - self.inner.unary(req, path, codec).await - } - /// ActivateUser - /// - /// Status: BETA - /// - /// This activates a specific user (Admin request) - pub async fn activate_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/ActivateUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "ActivateUser", - ), - ); - self.inner.unary(req, path, codec).await - } - /// CreateAPIToken - /// - /// Status: BETA - /// - /// Creates an API token to authenticate - pub async fn create_api_token( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/CreateAPIToken", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "CreateAPIToken", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetAPIToken - /// - /// Status: BETA - /// - /// Returns one API token by id - pub async fn get_api_token( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/GetAPIToken", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "GetAPIToken", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetAPITokens - /// - /// Status: STABLE - /// - /// Returns a list of API tokens for a specific user - pub async fn get_api_tokens( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/GetAPITokens", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "GetAPITokens", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeleteAPIToken - /// - /// Status: STABLE - /// - /// Deletes the specified API Token - pub async fn delete_api_token( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/DeleteAPIToken", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "DeleteAPIToken", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeleteAPITokens - /// - /// Status: BETA - /// - /// Deletes the specified API Token - pub async fn delete_api_tokens( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/DeleteAPITokens", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "DeleteAPITokens", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetUserRequest - /// - /// Status: STABLE - /// - /// This is a request that returns the user information of the - /// current user or if invoked by an admin from another user - pub async fn get_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/GetUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "GetUser", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetUserRequestRedacted - /// - /// Status: STABLE - /// - /// This is a request that returns the user information of the - /// current user or if invoked by an admin from another user - /// Redacts personal information like name or email - pub async fn get_user_redacted( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/GetUserRedacted", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "GetUserRedacted", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateUserDisplayName - /// - /// Status: STABLE - /// - /// Updates the Displayname for the user (Personal only) - pub async fn update_user_display_name( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/UpdateUserDisplayName", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "UpdateUserDisplayName", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateUserDisplayName - /// - /// Status: ALPHA - /// - /// Updates the email for the user (Personal only) - pub async fn update_user_email( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/UpdateUserEmail", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "UpdateUserEmail", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetNotActivatedUsers - /// - /// Status: STABLE - /// - /// Get all not activated users (Admin only) - pub async fn get_not_activated_users( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/GetNotActivatedUsers", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "GetNotActivatedUsers", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetAllUsers - /// - /// Status: ALPHA - /// - /// Get all users including permissions (Admin only) - pub async fn get_all_users( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/GetAllUsers", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "GetAllUsers", - ), - ); - self.inner.unary(req, path, codec).await - } - /// CreateS3CredentialsUserToken - /// - /// Status: ALPHA - /// - /// Creates or updates S3 credentials for a specific user and data_proxy - pub async fn create_s3_credentials_user_token( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/CreateS3CredentialsUserToken", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "CreateS3CredentialsUserToken", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetS3CredentialsUserToken - /// - /// Status: ALPHA - /// - /// Gets S3 credentials for a specific token and data_proxy - pub async fn get_s3_credentials_user_token( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/GetS3CredentialsUserToken", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "GetS3CredentialsUserToken", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeleteS3CredentialsUserToken - /// - /// Status: ALPHA - /// - /// Revokes existing S3 credentials for a specific user and data_proxy - pub async fn delete_s3_credentials_user_token( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/DeleteS3CredentialsUserToken", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "DeleteS3CredentialsUserToken", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetDataproxyToken - /// - /// Status: ALPHA - /// - /// Gets token for a specific user and data_proxy - pub async fn get_dataproxy_token_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/GetDataproxyTokenUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "GetDataproxyTokenUser", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetPersonalNotifications - /// - /// Status: ALPHA - /// - /// Fetches personal notifications - pub async fn get_personal_notifications( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/GetPersonalNotifications", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "GetPersonalNotifications", - ), - ); - self.inner.unary(req, path, codec).await - } - /// AcknowledgePersonalNotifications - /// - /// Status: ALPHA - /// - /// Acknowledges personal notifications - pub async fn acknowledge_personal_notifications( - &mut self, - request: impl tonic::IntoRequest< - super::AcknowledgePersonalNotificationsRequest, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/AcknowledgePersonalNotifications", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "AcknowledgePersonalNotifications", - ), - ); - self.inner.unary(req, path, codec).await - } - /// AddOidcProvider - /// - /// Status: BETA - /// - /// Add alternative oidc login method for user - pub async fn add_oidc_provider( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/AddOidcProvider", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "AddOidcProvider", - ), - ); - self.inner.unary(req, path, codec).await - } - /// RemoveOidcProvider - /// - /// Status: BETA - /// - /// Remove alternative oidc login method from user - /// (Only works if user has more than one oidc provider) - pub async fn remove_oidc_provider( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/RemoveOidcProvider", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "RemoveOidcProvider", - ), - ); - self.inner.unary(req, path, codec).await - } - /// AddPubkeyUser - /// - /// Status: ALPHA - /// - /// Adds an ED25519 public key for the user - pub async fn add_pubkey_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/AddPubkeyUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "AddPubkeyUser", - ), - ); - self.inner.unary(req, path, codec).await - } - /// AddTrustedEndpointsUser - /// - /// Status: ALPHA - /// - /// Adds an endpoint to the trusted endpoints list of the user - pub async fn add_trusted_endpoints_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/AddTrustedEndpointsUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "AddTrustedEndpointsUser", - ), - ); - self.inner.unary(req, path, codec).await - } - /// RemoveTrustedEndpointsUser - /// - /// Status: ALPHA - /// - /// Removes an endpoint from the trusted endpoints list of the user - pub async fn remove_trusted_endpoints_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/RemoveTrustedEndpointsUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "RemoveTrustedEndpointsUser", - ), - ); - self.inner.unary(req, path, codec).await - } - /// AddDataProxyAttributeUser - /// - /// Status: ALPHA - /// - /// Adds an data proxy specific attribute to the user - pub async fn add_data_proxy_attribute_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/AddDataProxyAttributeUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "AddDataProxyAttributeUser", - ), - ); - self.inner.unary(req, path, codec).await - } - /// RemoveDataProxyAttributeUser - /// - /// Status: ALPHA - /// - /// Removes an data proxy specific attribute from the user - pub async fn remove_data_proxy_attribute_user( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.UserService/RemoveDataProxyAttributeUser", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.UserService", - "RemoveDataProxyAttributeUser", - ), - ); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod user_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with UserServiceServer. - #[async_trait] - pub trait UserService: Send + Sync + 'static { - /// RegisterUser - /// - /// Status: BETA - /// - /// This request should be called when a new user logs in for the first time - async fn register_user( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeActivateUser - /// - /// Status: BETA - /// - /// This deactivates a specific user (Admin request) - async fn deactivate_user( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// ActivateUser - /// - /// Status: BETA - /// - /// This activates a specific user (Admin request) - async fn activate_user( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// CreateAPIToken - /// - /// Status: BETA - /// - /// Creates an API token to authenticate - async fn create_api_token( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetAPIToken - /// - /// Status: BETA - /// - /// Returns one API token by id - async fn get_api_token( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetAPITokens - /// - /// Status: STABLE - /// - /// Returns a list of API tokens for a specific user - async fn get_api_tokens( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteAPIToken - /// - /// Status: STABLE - /// - /// Deletes the specified API Token - async fn delete_api_token( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteAPITokens - /// - /// Status: BETA - /// - /// Deletes the specified API Token - async fn delete_api_tokens( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetUserRequest - /// - /// Status: STABLE - /// - /// This is a request that returns the user information of the - /// current user or if invoked by an admin from another user - async fn get_user( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// GetUserRequestRedacted - /// - /// Status: STABLE - /// - /// This is a request that returns the user information of the - /// current user or if invoked by an admin from another user - /// Redacts personal information like name or email - async fn get_user_redacted( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateUserDisplayName - /// - /// Status: STABLE - /// - /// Updates the Displayname for the user (Personal only) - async fn update_user_display_name( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateUserDisplayName - /// - /// Status: ALPHA - /// - /// Updates the email for the user (Personal only) - async fn update_user_email( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetNotActivatedUsers - /// - /// Status: STABLE - /// - /// Get all not activated users (Admin only) - async fn get_not_activated_users( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetAllUsers - /// - /// Status: ALPHA - /// - /// Get all users including permissions (Admin only) - async fn get_all_users( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// CreateS3CredentialsUserToken - /// - /// Status: ALPHA - /// - /// Creates or updates S3 credentials for a specific user and data_proxy - async fn create_s3_credentials_user_token( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetS3CredentialsUserToken - /// - /// Status: ALPHA - /// - /// Gets S3 credentials for a specific token and data_proxy - async fn get_s3_credentials_user_token( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteS3CredentialsUserToken - /// - /// Status: ALPHA - /// - /// Revokes existing S3 credentials for a specific user and data_proxy - async fn delete_s3_credentials_user_token( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetDataproxyToken - /// - /// Status: ALPHA - /// - /// Gets token for a specific user and data_proxy - async fn get_dataproxy_token_user( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetPersonalNotifications - /// - /// Status: ALPHA - /// - /// Fetches personal notifications - async fn get_personal_notifications( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AcknowledgePersonalNotifications - /// - /// Status: ALPHA - /// - /// Acknowledges personal notifications - async fn acknowledge_personal_notifications( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AddOidcProvider - /// - /// Status: BETA - /// - /// Add alternative oidc login method for user - async fn add_oidc_provider( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// RemoveOidcProvider - /// - /// Status: BETA - /// - /// Remove alternative oidc login method from user - /// (Only works if user has more than one oidc provider) - async fn remove_oidc_provider( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AddPubkeyUser - /// - /// Status: ALPHA - /// - /// Adds an ED25519 public key for the user - async fn add_pubkey_user( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AddTrustedEndpointsUser - /// - /// Status: ALPHA - /// - /// Adds an endpoint to the trusted endpoints list of the user - async fn add_trusted_endpoints_user( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// RemoveTrustedEndpointsUser - /// - /// Status: ALPHA - /// - /// Removes an endpoint from the trusted endpoints list of the user - async fn remove_trusted_endpoints_user( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AddDataProxyAttributeUser - /// - /// Status: ALPHA - /// - /// Adds an data proxy specific attribute to the user - async fn add_data_proxy_attribute_user( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// RemoveDataProxyAttributeUser - /// - /// Status: ALPHA - /// - /// Removes an data proxy specific attribute from the user - async fn remove_data_proxy_attribute_user( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// UserService - /// - /// Status: BETA - /// - /// Contains all CRUD methods for users and associated resource - #[derive(Debug)] - pub struct UserServiceServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl UserServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for UserServiceServer - where - T: UserService, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/aruna.api.storage.services.v2.UserService/RegisterUser" => { - #[allow(non_camel_case_types)] - struct RegisterUserSvc(pub Arc); - impl< - T: UserService, - > tonic::server::UnaryService - for RegisterUserSvc { - type Response = super::RegisterUserResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::register_user(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = RegisterUserSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.UserService/DeactivateUser" => { - #[allow(non_camel_case_types)] - struct DeactivateUserSvc(pub Arc); - impl< - T: UserService, - > tonic::server::UnaryService - for DeactivateUserSvc { - type Response = super::DeactivateUserResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::deactivate_user(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = DeactivateUserSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.UserService/ActivateUser" => { - #[allow(non_camel_case_types)] - struct ActivateUserSvc(pub Arc); - impl< - T: UserService, - > tonic::server::UnaryService - for ActivateUserSvc { - type Response = super::ActivateUserResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::activate_user(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = ActivateUserSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.UserService/CreateAPIToken" => { - #[allow(non_camel_case_types)] - struct CreateAPITokenSvc(pub Arc); - impl< - T: UserService, - > tonic::server::UnaryService - for CreateAPITokenSvc { - type Response = super::CreateApiTokenResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::create_api_token(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = CreateAPITokenSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.UserService/GetAPIToken" => { - #[allow(non_camel_case_types)] - struct GetAPITokenSvc(pub Arc); - impl< - T: UserService, - > tonic::server::UnaryService - for GetAPITokenSvc { - type Response = super::GetApiTokenResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_api_token(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetAPITokenSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.UserService/GetAPITokens" => { - #[allow(non_camel_case_types)] - struct GetAPITokensSvc(pub Arc); - impl< - T: UserService, - > tonic::server::UnaryService - for GetAPITokensSvc { - type Response = super::GetApiTokensResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_api_tokens(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetAPITokensSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.UserService/DeleteAPIToken" => { - #[allow(non_camel_case_types)] - struct DeleteAPITokenSvc(pub Arc); - impl< - T: UserService, - > tonic::server::UnaryService - for DeleteAPITokenSvc { - type Response = super::DeleteApiTokenResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::delete_api_token(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = DeleteAPITokenSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.UserService/DeleteAPITokens" => { - #[allow(non_camel_case_types)] - struct DeleteAPITokensSvc(pub Arc); - impl< - T: UserService, - > tonic::server::UnaryService - for DeleteAPITokensSvc { - type Response = super::DeleteApiTokensResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::delete_api_tokens(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = DeleteAPITokensSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.UserService/GetUser" => { + } +} +/// Generated server implementations. +pub mod service_account_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with ServiceAccountServiceServer. + #[async_trait] + pub trait ServiceAccountService: Send + Sync + 'static { + /// CreateServiceAccount + /// + /// Status: BETA + /// + /// Creates a service account for a given project + /// If the service account has permissions for the global Admin project + /// it will be a global service account that can interact with any resource + async fn create_service_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// CreateServiceAccountToken + /// + /// Status: BETA + /// + /// Creates a token for a service account + /// Each service account can only have one permission -> The token will have the same permission as the + /// service account or a subset of it. + async fn create_service_account_token( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetServiceAccountToken + /// + /// Status: BETA + /// + /// This requests the overall information about a specifc service account token (by id) + /// it will not contain the token itself. + async fn get_service_account_token( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetServiceAccountTokens + /// + /// Status: BETA + /// + /// This requests the overall information about all service account tokens + /// it will not contain the token itself. + async fn get_service_account_tokens( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteServiceAccountToken + /// + /// Status: BETA + /// + /// Deletes one service account token by ID + async fn delete_service_account_token( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteServiceAccountTokens + /// + /// Status: BETA + /// + /// Deletes all service account tokens + async fn delete_service_account_tokens( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteServiceAccount + /// + /// Status: BETA + /// + /// Deletes a service account (by id) + async fn delete_service_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// CreateS3CredentialsSvcAccount + /// + /// Status: ALPHA + /// + /// Creates or updates S3 credentials for a specific SvcAccount and data_proxy + async fn create_s3_credentials_svc_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetS3CredentialsSvcAccount + /// + /// Status: ALPHA + /// + /// Gets S3 credentials for a specific svc_account and data_proxy + async fn get_s3_credentials_svc_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteS3CredentialsSvcAccount + /// + /// Status: ALPHA + /// + /// Revokes existing S3 credentials for a specific user and data_proxy + async fn delete_s3_credentials_svc_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetDataproxyToken + /// + /// Status: ALPHA + /// + /// Gets token for a specific SvcAccount and data_proxy + async fn create_dataproxy_token_svc_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// AddPubkeySvcAccount + /// + /// Status: ALPHA + /// + /// Adds an ED25519 public key for the SvcAccount + async fn add_pubkey_svc_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// AddTrustedEndpointsSvcAccount + /// + /// Status: ALPHA + /// + /// Adds an endpoint to the trusted endpoints list of the SvcAccount + async fn add_trusted_endpoints_svc_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// RemoveTrustedEndpointsSvcAccount + /// + /// Status: ALPHA + /// + /// Removes an endpoint from the trusted endpoints list of the SvcAccount + async fn remove_trusted_endpoints_svc_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// AddDataProxyAttributeSvcAccount + /// + /// Status: ALPHA + /// + /// Adds an data proxy specific attribute to the SvcAccount + async fn add_data_proxy_attribute_svc_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// RemoveDataProxyAttributeSvcAccount + /// + /// Status: ALPHA + /// + /// Removes an data proxy specific attribute from the SvcAccount + async fn remove_data_proxy_attribute_svc_account( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// ServiceAccountService + /// + /// Status: BETA + /// + /// Service that contains CRUD operations for service_accounts. + /// Service accounts are project specific accounts that can be used for automation. + #[derive(Debug)] + pub struct ServiceAccountServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl ServiceAccountServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> + for ServiceAccountServiceServer + where + T: ServiceAccountService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/aruna.api.storage.services.v2.ServiceAccountService/CreateServiceAccount" => { #[allow(non_camel_case_types)] - struct GetUserSvc(pub Arc); + struct CreateServiceAccountSvc(pub Arc); impl< - T: UserService, - > tonic::server::UnaryService - for GetUserSvc { - type Response = super::GetUserResponse; + T: ServiceAccountService, + > tonic::server::UnaryService + for CreateServiceAccountSvc { + type Response = super::CreateServiceAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_user(&inner, request).await + ::create_service_account( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -12855,7 +9662,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetUserSvc(inner); + let method = CreateServiceAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -12871,25 +9678,34 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/GetUserRedacted" => { + "/aruna.api.storage.services.v2.ServiceAccountService/CreateServiceAccountToken" => { #[allow(non_camel_case_types)] - struct GetUserRedactedSvc(pub Arc); + struct CreateServiceAccountTokenSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for GetUserRedactedSvc { - type Response = super::GetUserRedactedResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::CreateServiceAccountTokenRequest, + > for CreateServiceAccountTokenSvc { + type Response = super::CreateServiceAccountTokenResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::CreateServiceAccountTokenRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_user_redacted(&inner, request).await + ::create_service_account_token( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -12901,7 +9717,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetUserRedactedSvc(inner); + let method = CreateServiceAccountTokenSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -12917,25 +9733,27 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/UpdateUserDisplayName" => { + "/aruna.api.storage.services.v2.ServiceAccountService/GetServiceAccountToken" => { #[allow(non_camel_case_types)] - struct UpdateUserDisplayNameSvc(pub Arc); + struct GetServiceAccountTokenSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for UpdateUserDisplayNameSvc { - type Response = super::UpdateUserDisplayNameResponse; + T: ServiceAccountService, + > tonic::server::UnaryService + for GetServiceAccountTokenSvc { + type Response = super::GetServiceAccountTokenResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_user_display_name( + ::get_service_account_token( &inner, request, ) @@ -12951,7 +9769,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateUserDisplayNameSvc(inner); + let method = GetServiceAccountTokenSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -12967,25 +9785,33 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/UpdateUserEmail" => { + "/aruna.api.storage.services.v2.ServiceAccountService/GetServiceAccountTokens" => { #[allow(non_camel_case_types)] - struct UpdateUserEmailSvc(pub Arc); + struct GetServiceAccountTokensSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for UpdateUserEmailSvc { - type Response = super::UpdateUserEmailResponse; + T: ServiceAccountService, + > tonic::server::UnaryService + for GetServiceAccountTokensSvc { + type Response = super::GetServiceAccountTokensResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::GetServiceAccountTokensRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_user_email(&inner, request).await + ::get_service_account_tokens( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -12997,7 +9823,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateUserEmailSvc(inner); + let method = GetServiceAccountTokensSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13013,25 +9839,33 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/GetNotActivatedUsers" => { + "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccountToken" => { #[allow(non_camel_case_types)] - struct GetNotActivatedUsersSvc(pub Arc); + struct DeleteServiceAccountTokenSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for GetNotActivatedUsersSvc { - type Response = super::GetNotActivatedUsersResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::DeleteServiceAccountTokenRequest, + > for DeleteServiceAccountTokenSvc { + type Response = super::DeleteServiceAccountTokenResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::DeleteServiceAccountTokenRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_not_activated_users(&inner, request) + ::delete_service_account_token( + &inner, + request, + ) .await }; Box::pin(fut) @@ -13044,7 +9878,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetNotActivatedUsersSvc(inner); + let method = DeleteServiceAccountTokenSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13060,25 +9894,34 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/GetAllUsers" => { + "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccountTokens" => { #[allow(non_camel_case_types)] - struct GetAllUsersSvc(pub Arc); + struct DeleteServiceAccountTokensSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for GetAllUsersSvc { - type Response = super::GetAllUsersResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::DeleteServiceAccountTokensRequest, + > for DeleteServiceAccountTokensSvc { + type Response = super::DeleteServiceAccountTokensResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::DeleteServiceAccountTokensRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_all_users(&inner, request).await + ::delete_service_account_tokens( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -13090,7 +9933,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetAllUsersSvc(inner); + let method = DeleteServiceAccountTokensSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13106,28 +9949,25 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/CreateS3CredentialsUserToken" => { - #[allow(non_camel_case_types)] - struct CreateS3CredentialsUserTokenSvc(pub Arc); - impl< - T: UserService, - > tonic::server::UnaryService< - super::CreateS3CredentialsUserTokenRequest, - > for CreateS3CredentialsUserTokenSvc { - type Response = super::CreateS3CredentialsUserTokenResponse; + "/aruna.api.storage.services.v2.ServiceAccountService/DeleteServiceAccount" => { + #[allow(non_camel_case_types)] + struct DeleteServiceAccountSvc(pub Arc); + impl< + T: ServiceAccountService, + > tonic::server::UnaryService + for DeleteServiceAccountSvc { + type Response = super::DeleteServiceAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::CreateS3CredentialsUserTokenRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_s3_credentials_user_token( + ::delete_service_account( &inner, request, ) @@ -13143,7 +9983,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateS3CredentialsUserTokenSvc(inner); + let method = DeleteServiceAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13159,15 +9999,17 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/GetS3CredentialsUserToken" => { + "/aruna.api.storage.services.v2.ServiceAccountService/CreateS3CredentialsSvcAccount" => { #[allow(non_camel_case_types)] - struct GetS3CredentialsUserTokenSvc(pub Arc); + struct CreateS3CredentialsSvcAccountSvc( + pub Arc, + ); impl< - T: UserService, + T: ServiceAccountService, > tonic::server::UnaryService< - super::GetS3CredentialsUserTokenRequest, - > for GetS3CredentialsUserTokenSvc { - type Response = super::GetS3CredentialsUserTokenResponse; + super::CreateS3CredentialsSvcAccountRequest, + > for CreateS3CredentialsSvcAccountSvc { + type Response = super::CreateS3CredentialsSvcAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -13175,12 +10017,12 @@ pub mod user_service_server { fn call( &mut self, request: tonic::Request< - super::GetS3CredentialsUserTokenRequest, + super::CreateS3CredentialsSvcAccountRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_s3_credentials_user_token( + ::create_s3_credentials_svc_account( &inner, request, ) @@ -13196,7 +10038,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetS3CredentialsUserTokenSvc(inner); + let method = CreateS3CredentialsSvcAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13212,15 +10054,17 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/DeleteS3CredentialsUserToken" => { + "/aruna.api.storage.services.v2.ServiceAccountService/GetS3CredentialsSvcAccount" => { #[allow(non_camel_case_types)] - struct DeleteS3CredentialsUserTokenSvc(pub Arc); + struct GetS3CredentialsSvcAccountSvc( + pub Arc, + ); impl< - T: UserService, + T: ServiceAccountService, > tonic::server::UnaryService< - super::DeleteS3CredentialsUserTokenRequest, - > for DeleteS3CredentialsUserTokenSvc { - type Response = super::DeleteS3CredentialsUserResponse; + super::GetS3CredentialsSvcAccountRequest, + > for GetS3CredentialsSvcAccountSvc { + type Response = super::GetS3CredentialsSvcAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -13228,12 +10072,12 @@ pub mod user_service_server { fn call( &mut self, request: tonic::Request< - super::DeleteS3CredentialsUserTokenRequest, + super::GetS3CredentialsSvcAccountRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_s3_credentials_user_token( + ::get_s3_credentials_svc_account( &inner, request, ) @@ -13249,7 +10093,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteS3CredentialsUserTokenSvc(inner); + let method = GetS3CredentialsSvcAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13265,25 +10109,30 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/GetDataproxyTokenUser" => { + "/aruna.api.storage.services.v2.ServiceAccountService/DeleteS3CredentialsSvcAccount" => { #[allow(non_camel_case_types)] - struct GetDataproxyTokenUserSvc(pub Arc); + struct DeleteS3CredentialsSvcAccountSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for GetDataproxyTokenUserSvc { - type Response = super::GetDataproxyTokenUserResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::DeleteS3CredentialsSvcAccountRequest, + > for DeleteS3CredentialsSvcAccountSvc { + type Response = super::DeleteS3CredentialsSvcAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::DeleteS3CredentialsSvcAccountRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_dataproxy_token_user( + ::delete_s3_credentials_svc_account( &inner, request, ) @@ -13299,7 +10148,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetDataproxyTokenUserSvc(inner); + let method = DeleteS3CredentialsSvcAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13315,14 +10164,17 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/GetPersonalNotifications" => { + "/aruna.api.storage.services.v2.ServiceAccountService/CreateDataproxyTokenSvcAccount" => { #[allow(non_camel_case_types)] - struct GetPersonalNotificationsSvc(pub Arc); + struct CreateDataproxyTokenSvcAccountSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for GetPersonalNotificationsSvc { - type Response = super::GetPersonalNotificationsResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::CreateDataproxyTokenSvcAccountRequest, + > for CreateDataproxyTokenSvcAccountSvc { + type Response = super::CreateDataproxyTokenSvcAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -13330,12 +10182,12 @@ pub mod user_service_server { fn call( &mut self, request: tonic::Request< - super::GetPersonalNotificationsRequest, + super::CreateDataproxyTokenSvcAccountRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_personal_notifications( + ::create_dataproxy_token_svc_account( &inner, request, ) @@ -13351,7 +10203,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetPersonalNotificationsSvc(inner); + let method = CreateDataproxyTokenSvcAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13367,30 +10219,25 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/AcknowledgePersonalNotifications" => { + "/aruna.api.storage.services.v2.ServiceAccountService/AddPubkeySvcAccount" => { #[allow(non_camel_case_types)] - struct AcknowledgePersonalNotificationsSvc( - pub Arc, - ); + struct AddPubkeySvcAccountSvc(pub Arc); impl< - T: UserService, - > tonic::server::UnaryService< - super::AcknowledgePersonalNotificationsRequest, - > for AcknowledgePersonalNotificationsSvc { - type Response = super::AcknowledgePersonalNotificationsResponse; + T: ServiceAccountService, + > tonic::server::UnaryService + for AddPubkeySvcAccountSvc { + type Response = super::AddPubkeySvcAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::AcknowledgePersonalNotificationsRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::acknowledge_personal_notifications( + ::add_pubkey_svc_account( &inner, request, ) @@ -13406,7 +10253,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = AcknowledgePersonalNotificationsSvc(inner); + let method = AddPubkeySvcAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13422,25 +10269,34 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/AddOidcProvider" => { + "/aruna.api.storage.services.v2.ServiceAccountService/AddTrustedEndpointsSvcAccount" => { #[allow(non_camel_case_types)] - struct AddOidcProviderSvc(pub Arc); + struct AddTrustedEndpointsSvcAccountSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for AddOidcProviderSvc { - type Response = super::AddOidcProviderResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::AddTrustedEndpointsSvcAccountRequest, + > for AddTrustedEndpointsSvcAccountSvc { + type Response = super::AddTrustedEndpointsSvcAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::AddTrustedEndpointsSvcAccountRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::add_oidc_provider(&inner, request).await + ::add_trusted_endpoints_svc_account( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -13452,7 +10308,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = AddOidcProviderSvc(inner); + let method = AddTrustedEndpointsSvcAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13468,25 +10324,33 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/RemoveOidcProvider" => { + "/aruna.api.storage.services.v2.ServiceAccountService/RemoveTrustedEndpointsSvcAccount" => { #[allow(non_camel_case_types)] - struct RemoveOidcProviderSvc(pub Arc); + struct RemoveTrustedEndpointsSvcAccountSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for RemoveOidcProviderSvc { - type Response = super::RemoveOidcProviderResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::RemoveTrustedEndpointsSvcAccountRequest, + > for RemoveTrustedEndpointsSvcAccountSvc { + type Response = super::RemoveTrustedEndpointsSvcAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::RemoveTrustedEndpointsSvcAccountRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::remove_oidc_provider(&inner, request) + ::remove_trusted_endpoints_svc_account( + &inner, + request, + ) .await }; Box::pin(fut) @@ -13499,7 +10363,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = RemoveOidcProviderSvc(inner); + let method = RemoveTrustedEndpointsSvcAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13515,25 +10379,34 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/AddPubkeyUser" => { + "/aruna.api.storage.services.v2.ServiceAccountService/AddDataProxyAttributeSvcAccount" => { #[allow(non_camel_case_types)] - struct AddPubkeyUserSvc(pub Arc); + struct AddDataProxyAttributeSvcAccountSvc( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for AddPubkeyUserSvc { - type Response = super::AddPubkeyUserResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::AddDataProxyAttributeSvcAccountRequest, + > for AddDataProxyAttributeSvcAccountSvc { + type Response = super::AddDataProxyAttributeSvcAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::AddDataProxyAttributeSvcAccountRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::add_pubkey_user(&inner, request).await + ::add_data_proxy_attribute_svc_account( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -13545,7 +10418,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = AddPubkeyUserSvc(inner); + let method = AddDataProxyAttributeSvcAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13561,14 +10434,19 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/AddTrustedEndpointsUser" => { + "/aruna.api.storage.services.v2.ServiceAccountService/RemoveDataProxyAttributeSvcAccount" => { #[allow(non_camel_case_types)] - struct AddTrustedEndpointsUserSvc(pub Arc); + struct RemoveDataProxyAttributeSvcAccountSvc< + T: ServiceAccountService, + >( + pub Arc, + ); impl< - T: UserService, - > tonic::server::UnaryService - for AddTrustedEndpointsUserSvc { - type Response = super::AddTrustedEndpointsUserResponse; + T: ServiceAccountService, + > tonic::server::UnaryService< + super::RemoveDataProxyAttributeSvcAccountRequest, + > for RemoveDataProxyAttributeSvcAccountSvc { + type Response = super::RemoveDataProxyAttributeSvcAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -13576,12 +10454,12 @@ pub mod user_service_server { fn call( &mut self, request: tonic::Request< - super::AddTrustedEndpointsUserRequest, + super::RemoveDataProxyAttributeSvcAccountRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::add_trusted_endpoints_user( + ::remove_data_proxy_attribute_svc_account( &inner, request, ) @@ -13597,7 +10475,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = AddTrustedEndpointsUserSvc(inner); + let method = RemoveDataProxyAttributeSvcAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13613,32 +10491,451 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/RemoveTrustedEndpointsUser" => { + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for ServiceAccountServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService + for ServiceAccountServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.ServiceAccountService"; + } +} +/// CreateLicenseRequest +/// +/// Request object for CreateLicense +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateLicenseRequest { + /// CC-BY-SA-4.0 + #[prost(string, tag = "1")] + pub tag: ::prost::alloc::string::String, + /// Creative Commons Attribution-ShareAlike 4.0 International + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub text: ::prost::alloc::string::String, + /// url is optional + /// + /// + #[prost(string, tag = "4")] + pub url: ::prost::alloc::string::String, +} +/// CreateLicenseResponse +/// +/// Response object for CreateLicense +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateLicenseResponse { + /// CC-BY-SA-4.0 + #[prost(string, tag = "1")] + pub tag: ::prost::alloc::string::String, +} +/// GetLicenseRequest +/// +/// Request object for GetLicense +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetLicenseRequest { + /// 1234567890abcdef + #[prost(string, tag = "1")] + pub tag: ::prost::alloc::string::String, +} +/// GetLicenseResponse +/// +/// Response object for GetLicense +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetLicenseResponse { + #[prost(message, optional, tag = "1")] + pub license: ::core::option::Option, +} +/// ListLicensesRequest +/// +/// Request object for ListLicense +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListLicensesRequest {} +/// ListLicenseResponse +/// +/// Response object for ListLicense +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListLicensesResponse { + #[prost(message, repeated, tag = "1")] + pub licenses: ::prost::alloc::vec::Vec, +} +/// Generated client implementations. +pub mod license_service_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /// LicenseService + /// + /// Status: BETA + /// + /// Contains all methods to add, get or list (custom) licenses + #[derive(Debug, Clone)] + pub struct LicenseServiceClient { + inner: tonic::client::Grpc, + } + impl LicenseServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> LicenseServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + LicenseServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// CreateLicense + /// + /// Status: BETA + /// + /// This creates a new license + pub async fn create_license( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.LicenseService/CreateLicense", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.LicenseService", + "CreateLicense", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetLicense + /// + /// Status: BETA + /// + /// This returns the license for a given tag + pub async fn get_license( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.LicenseService/GetLicense", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.LicenseService", + "GetLicense", + ), + ); + self.inner.unary(req, path, codec).await + } + /// ListLicenses + /// + /// Status: BETA + /// + /// This returns a list of all licenses + pub async fn list_licenses( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.LicenseService/ListLicenses", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.LicenseService", + "ListLicenses", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod license_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with LicenseServiceServer. + #[async_trait] + pub trait LicenseService: Send + Sync + 'static { + /// CreateLicense + /// + /// Status: BETA + /// + /// This creates a new license + async fn create_license( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetLicense + /// + /// Status: BETA + /// + /// This returns the license for a given tag + async fn get_license( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// ListLicenses + /// + /// Status: BETA + /// + /// This returns a list of all licenses + async fn list_licenses( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// LicenseService + /// + /// Status: BETA + /// + /// Contains all methods to add, get or list (custom) licenses + #[derive(Debug)] + pub struct LicenseServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl LicenseServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for LicenseServiceServer + where + T: LicenseService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/aruna.api.storage.services.v2.LicenseService/CreateLicense" => { #[allow(non_camel_case_types)] - struct RemoveTrustedEndpointsUserSvc(pub Arc); + struct CreateLicenseSvc(pub Arc); impl< - T: UserService, - > tonic::server::UnaryService< - super::RemoveTrustedEndpointsUserRequest, - > for RemoveTrustedEndpointsUserSvc { - type Response = super::RemoveTrustedEndpointsUserResponse; + T: LicenseService, + > tonic::server::UnaryService + for CreateLicenseSvc { + type Response = super::CreateLicenseResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::RemoveTrustedEndpointsUserRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::remove_trusted_endpoints_user( - &inner, - request, - ) - .await + ::create_license(&inner, request).await }; Box::pin(fut) } @@ -13650,7 +10947,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = RemoveTrustedEndpointsUserSvc(inner); + let method = CreateLicenseSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13666,32 +10963,25 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/AddDataProxyAttributeUser" => { + "/aruna.api.storage.services.v2.LicenseService/GetLicense" => { #[allow(non_camel_case_types)] - struct AddDataProxyAttributeUserSvc(pub Arc); + struct GetLicenseSvc(pub Arc); impl< - T: UserService, - > tonic::server::UnaryService< - super::AddDataProxyAttributeUserRequest, - > for AddDataProxyAttributeUserSvc { - type Response = super::AddDataProxyAttributeUserResponse; + T: LicenseService, + > tonic::server::UnaryService + for GetLicenseSvc { + type Response = super::GetLicenseResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::AddDataProxyAttributeUserRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::add_data_proxy_attribute_user( - &inner, - request, - ) - .await + ::get_license(&inner, request).await }; Box::pin(fut) } @@ -13703,7 +10993,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = AddDataProxyAttributeUserSvc(inner); + let method = GetLicenseSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13719,32 +11009,25 @@ pub mod user_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.UserService/RemoveDataProxyAttributeUser" => { + "/aruna.api.storage.services.v2.LicenseService/ListLicenses" => { #[allow(non_camel_case_types)] - struct RemoveDataProxyAttributeUserSvc(pub Arc); + struct ListLicensesSvc(pub Arc); impl< - T: UserService, - > tonic::server::UnaryService< - super::RemoveDataProxyAttributeUserRequest, - > for RemoveDataProxyAttributeUserSvc { - type Response = super::RemoveDataProxyAttributeUserResponse; + T: LicenseService, + > tonic::server::UnaryService + for ListLicensesSvc { + type Response = super::ListLicensesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::RemoveDataProxyAttributeUserRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::remove_data_proxy_attribute_user( - &inner, - request, - ) - .await + ::list_licenses(&inner, request).await }; Box::pin(fut) } @@ -13756,7 +11039,7 @@ pub mod user_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = RemoveDataProxyAttributeUserSvc(inner); + let method = ListLicensesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -13787,7 +11070,7 @@ pub mod user_service_server { } } } - impl Clone for UserServiceServer { + impl Clone for LicenseServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -13799,7 +11082,7 @@ pub mod user_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -13809,250 +11092,545 @@ pub mod user_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for UserServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.UserService"; + impl tonic::server::NamedService for LicenseServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.LicenseService"; } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateCollectionRequest { - /// collection name - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(string, tag = "9")] - pub title: ::prost::alloc::string::String, - /// description +pub struct RegisterUserRequest { + /// user_displayname + #[prost(string, tag = "1")] + pub display_name: ::prost::alloc::string::String, + /// Mail address (optional) + #[prost(string, tag = "2")] + pub email: ::prost::alloc::string::String, + /// Project hint description string (optional) + #[prost(string, tag = "3")] + pub project: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RegisterUserResponse { + /// Created user id + #[prost(string, tag = "1")] + pub user_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateApiTokenRequest { + /// Token name + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// Personal or resource specific + #[prost(message, optional, tag = "2")] + pub permission: ::core::option::Option, + /// Token expiry + #[prost(message, optional, tag = "3")] + pub expires_at: ::core::option::Option<::prost_wkt_types::Timestamp>, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateApiTokenResponse { + /// This contains only the token description + #[prost(message, optional, tag = "1")] + pub token: ::core::option::Option, + /// This is the actual secret token + /// Attention, this can not be recreated and needs to be stored securely + /// New tokens will always contain a new secret #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// collection specific labels / hooks - #[prost(message, repeated, tag = "3")] - pub key_values: ::prost::alloc::vec::Vec, - /// Internal /External relations (URLs / IDs from external sources) - #[prost(message, repeated, tag = "4")] - pub relations: ::prost::alloc::vec::Vec, - /// DataClass - #[prost(enumeration = "super::super::models::v2::DataClass", tag = "5")] - pub data_class: i32, - #[prost(string, optional, tag = "7")] - pub metadata_license_tag: ::core::option::Option<::prost::alloc::string::String>, - #[prost(string, optional, tag = "8")] - pub default_data_license_tag: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "10")] - pub authors: ::prost::alloc::vec::Vec, - /// Parent_id MUST be project - #[prost(oneof = "create_collection_request::Parent", tags = "6")] - pub parent: ::core::option::Option, + pub token_secret: ::prost::alloc::string::String, } -/// Nested message and enum types in `CreateCollectionRequest`. -pub mod create_collection_request { - /// Parent_id MUST be project - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Parent { - #[prost(string, tag = "6")] - ProjectId(::prost::alloc::string::String), - } +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetApiTokenRequest { + /// The token id + #[prost(string, tag = "1")] + pub token_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateCollectionResponse { - /// The new collection_id +pub struct GetApiTokenResponse { + /// List of API tokens #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, + pub token: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetApiTokensRequest {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetApiTokensResponse { + /// List of API tokens with redacted actual token + #[prost(message, repeated, tag = "1")] + pub tokens: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteApiTokenRequest { + /// The token_id + #[prost(string, tag = "1")] + pub token_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteApiTokenResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteApiTokensRequest { + /// This request invalidates all tokens of a specific user + /// usually the user_id is specified via the provided oidc or aruna token + /// This user_id can be used by admins to invalidate all tokens of a specific + /// user + #[prost(string, tag = "1")] + pub user_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteApiTokensResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetUserRequest { + /// Optional user_id + #[prost(string, tag = "1")] + pub user_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetUserResponse { + /// User info + #[prost(message, optional, tag = "1")] + pub user: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetUserRedactedRequest { + /// Optional user_id + #[prost(string, tag = "1")] + pub user_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetUserRedactedResponse { + /// User info + #[prost(message, optional, tag = "1")] + pub user: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateUserDisplayNameRequest { + /// New display name + #[prost(string, tag = "1")] + pub new_display_name: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateUserDisplayNameResponse { + /// Updated user info + #[prost(message, optional, tag = "1")] + pub user: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ActivateUserRequest { + /// User to activate + #[prost(string, tag = "1")] + pub user_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ActivateUserResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetNotActivatedUsersRequest {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetNotActivatedUsersResponse { + /// List of users that are not yet activated + #[prost(message, repeated, tag = "1")] + pub users: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAllUsersRequest {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetAllUsersResponse { + #[prost(message, repeated, tag = "1")] + pub user: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeactivateUserRequest { + /// User to activate + #[prost(string, tag = "1")] + pub user_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeactivateUserResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateUserEmailRequest { + #[prost(string, tag = "1")] + pub user_id: ::prost::alloc::string::String, + /// If new email is empty == unsubscribe + #[prost(string, tag = "2")] + pub new_email: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateUserEmailResponse { + #[prost(message, optional, tag = "1")] + pub user: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateS3CredentialsUserTokenRequest { + #[prost(string, tag = "1")] + pub endpoint_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateS3CredentialsUserTokenResponse { + #[prost(string, tag = "1")] + pub s3_access_key: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub s3_secret_key: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub s3_endpoint_url: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetS3CredentialsUserTokenRequest { + #[prost(string, tag = "1")] + pub endpoint_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetS3CredentialsUserTokenResponse { + #[prost(string, tag = "1")] + pub s3_access_key: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub s3_secret_key: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub s3_endpoint_url: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteS3CredentialsUserTokenRequest { + #[prost(string, tag = "1")] + pub endpoint_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetCollectionRequest { - /// Requested id +pub struct DeleteS3CredentialsUserResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetDataproxyTokenUserRequest { #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, + pub user_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub endpoint_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub context: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetCollectionResponse { - /// Overview of the requested collection - #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, +pub struct GetDataproxyTokenUserResponse { + #[prost(string, tag = "1")] + pub token: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetCollectionsRequest { - #[prost(string, repeated, tag = "1")] - pub collection_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} +pub struct GetPersonalNotificationsRequest {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetCollectionsResponse { - /// List of collection overviews +pub struct GetPersonalNotificationsResponse { #[prost(message, repeated, tag = "1")] - pub collections: ::prost::alloc::vec::Vec, + pub notifications: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteCollectionRequest { - #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, +pub struct AcknowledgePersonalNotificationsRequest { + #[prost(string, repeated, tag = "1")] + pub notification_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteCollectionResponse {} +pub struct AcknowledgePersonalNotificationsResponse {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionNameRequest { - #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, +pub struct Reference { + #[prost(enumeration = "ReferenceType", tag = "1")] + pub ref_type: i32, + /// "User A" | file.txt #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, + pub ref_name: ::prost::alloc::string::String, + /// 0123AAA123AAA (id) + #[prost(string, tag = "3")] + pub ref_value: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionNameResponse { - #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, +pub struct PersonalNotification { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + #[prost(enumeration = "PersonalNotificationVariant", tag = "2")] + pub variant: i32, + /// User A has requested access for resource B + #[prost(string, tag = "3")] + pub message: ::prost::alloc::string::String, + /// References to resource in the "message" + #[prost(message, repeated, tag = "4")] + pub refs: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionDescriptionRequest { +pub struct AddOidcProviderRequest { #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, + pub new_access_token: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionDescriptionResponse { +pub struct AddOidcProviderResponse { #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, + pub user: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionKeyValuesRequest { +pub struct RemoveOidcProviderRequest { #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub add_key_values: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub remove_key_values: ::prost::alloc::vec::Vec, + pub provider_url: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionKeyValuesResponse { +pub struct RemoveOidcProviderResponse { #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, + pub user: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionDataClassRequest { +pub struct AddPubkeyUserRequest { #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::DataClass", tag = "2")] - pub data_class: i32, + pub public_key: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionDataClassResponse { +pub struct AddPubkeyUserResponse { #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, + pub user: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotCollectionRequest { +pub struct AddTrustedEndpointsUserRequest { #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, + pub endpoint_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotCollectionResponse { - /// This collection will be returned via an Persistent Identifier! Updates will be impossible +pub struct AddTrustedEndpointsUserResponse { + /// Here would be the place to add conditions + /// why the request was denied #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, + pub user: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionLicensesRequest { +pub struct RemoveTrustedEndpointsUserRequest { #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub metadata_license_tag: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub default_data_license_tag: ::prost::alloc::string::String, + pub endpoint_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionLicensesResponse { +pub struct RemoveTrustedEndpointsUserResponse { #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, + pub user: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionTitleRequest { +pub struct AddDataProxyAttributeUserRequest { #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub title: ::prost::alloc::string::String, + pub user_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub attribute: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionTitleResponse { - #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, -} +pub struct AddDataProxyAttributeUserResponse {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionAuthorsRequest { +pub struct RemoveDataProxyAttributeUserRequest { #[prost(string, tag = "1")] - pub collection_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub add_authors: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub remove_authors: ::prost::alloc::vec::Vec, + pub user_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub dataproxy_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub attribute_name: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateCollectionAuthorsResponse { - #[prost(message, optional, tag = "1")] - pub collection: ::core::option::Option, +pub struct RemoveDataProxyAttributeUserResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ReferenceType { + Unspecified = 0, + User = 1, + Resource = 2, +} +impl ReferenceType { + /// 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 { + ReferenceType::Unspecified => "REFERENCE_TYPE_UNSPECIFIED", + ReferenceType::User => "REFERENCE_TYPE_USER", + ReferenceType::Resource => "REFERENCE_TYPE_RESOURCE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "REFERENCE_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "REFERENCE_TYPE_USER" => Some(Self::User), + "REFERENCE_TYPE_RESOURCE" => Some(Self::Resource), + _ => None, + } + } +} +#[derive(serde::Deserialize, serde::Serialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum PersonalNotificationVariant { + Unspecified = 0, + AccessRequested = 1, + PermissionGranted = 2, + PermissionRevoked = 3, + PermissionUpdated = 4, + Announcement = 5, +} +impl PersonalNotificationVariant { + /// 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 { + PersonalNotificationVariant::Unspecified => { + "PERSONAL_NOTIFICATION_VARIANT_UNSPECIFIED" + } + PersonalNotificationVariant::AccessRequested => { + "PERSONAL_NOTIFICATION_VARIANT_ACCESS_REQUESTED" + } + PersonalNotificationVariant::PermissionGranted => { + "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_GRANTED" + } + PersonalNotificationVariant::PermissionRevoked => { + "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_REVOKED" + } + PersonalNotificationVariant::PermissionUpdated => { + "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_UPDATED" + } + PersonalNotificationVariant::Announcement => { + "PERSONAL_NOTIFICATION_VARIANT_ANNOUNCEMENT" + } + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PERSONAL_NOTIFICATION_VARIANT_UNSPECIFIED" => Some(Self::Unspecified), + "PERSONAL_NOTIFICATION_VARIANT_ACCESS_REQUESTED" => { + Some(Self::AccessRequested) + } + "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_GRANTED" => { + Some(Self::PermissionGranted) + } + "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_REVOKED" => { + Some(Self::PermissionRevoked) + } + "PERSONAL_NOTIFICATION_VARIANT_PERMISSION_UPDATED" => { + Some(Self::PermissionUpdated) + } + "PERSONAL_NOTIFICATION_VARIANT_ANNOUNCEMENT" => Some(Self::Announcement), + _ => None, + } + } } /// Generated client implementations. -pub mod collection_service_client { +pub mod user_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// CollectionService + /// UserService /// /// Status: BETA /// - /// Contains all methods that get/create or update Collection and associated resources + /// Contains all CRUD methods for users and associated resource #[derive(Debug, Clone)] - pub struct CollectionServiceClient { + pub struct UserServiceClient { inner: tonic::client::Grpc, } - impl CollectionServiceClient + impl UserServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -14063,70 +11641,668 @@ pub mod collection_service_client { let inner = tonic::client::Grpc::new(inner); Self { inner } } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> UserServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + UserServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// RegisterUser + /// + /// Status: BETA + /// + /// This request should be called when a new user logs in for the first time + pub async fn register_user( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/RegisterUser", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "RegisterUser", + ), + ); + self.inner.unary(req, path, codec).await + } + /// DeActivateUser + /// + /// Status: BETA + /// + /// This deactivates a specific user (Admin request) + pub async fn deactivate_user( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/DeactivateUser", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "DeactivateUser", + ), + ); + self.inner.unary(req, path, codec).await + } + /// ActivateUser + /// + /// Status: BETA + /// + /// This activates a specific user (Admin request) + pub async fn activate_user( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/ActivateUser", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "ActivateUser", + ), + ); + self.inner.unary(req, path, codec).await + } + /// CreateAPIToken + /// + /// Status: BETA + /// + /// Creates an API token to authenticate + pub async fn create_api_token( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/CreateAPIToken", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "CreateAPIToken", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetAPIToken + /// + /// Status: BETA + /// + /// Returns one API token by id + pub async fn get_api_token( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/GetAPIToken", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "GetAPIToken", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetAPITokens + /// + /// Status: STABLE + /// + /// Returns a list of API tokens for a specific user + pub async fn get_api_tokens( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/GetAPITokens", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "GetAPITokens", + ), + ); + self.inner.unary(req, path, codec).await + } + /// DeleteAPIToken + /// + /// Status: STABLE + /// + /// Deletes the specified API Token + pub async fn delete_api_token( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/DeleteAPIToken", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "DeleteAPIToken", + ), + ); + self.inner.unary(req, path, codec).await + } + /// DeleteAPITokens + /// + /// Status: BETA + /// + /// Deletes the specified API Token + pub async fn delete_api_tokens( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/DeleteAPITokens", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "DeleteAPITokens", + ), + ); + self.inner.unary(req, path, codec).await } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> CollectionServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - CollectionServiceClient::new(InterceptedService::new(inner, interceptor)) + /// GetUserRequest + /// + /// Status: STABLE + /// + /// This is a request that returns the user information of the + /// current user or if invoked by an admin from another user + pub async fn get_user( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/GetUser", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "GetUser", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetUserRequestRedacted + /// + /// Status: STABLE + /// + /// This is a request that returns the user information of the + /// current user or if invoked by an admin from another user + /// Redacts personal information like name or email + pub async fn get_user_redacted( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/GetUserRedacted", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "GetUserRedacted", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateUserDisplayName + /// + /// Status: STABLE + /// + /// Updates the Displayname for the user (Personal only) + pub async fn update_user_display_name( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/UpdateUserDisplayName", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "UpdateUserDisplayName", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateUserDisplayName + /// + /// Status: ALPHA + /// + /// Updates the email for the user (Personal only) + pub async fn update_user_email( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/UpdateUserEmail", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "UpdateUserEmail", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetNotActivatedUsers + /// + /// Status: STABLE + /// + /// Get all not activated users (Admin only) + pub async fn get_not_activated_users( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/GetNotActivatedUsers", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "GetNotActivatedUsers", + ), + ); + self.inner.unary(req, path, codec).await } - /// Compress requests with the given encoding. + /// GetAllUsers /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self + /// Status: ALPHA + /// + /// Get all users including permissions (Admin only) + pub async fn get_all_users( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/GetAllUsers", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "GetAllUsers", + ), + ); + self.inner.unary(req, path, codec).await } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self + /// CreateS3CredentialsUserToken + /// + /// Status: ALPHA + /// + /// Creates or updates S3 credentials for a specific user and data_proxy + pub async fn create_s3_credentials_user_token( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/CreateS3CredentialsUserToken", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "CreateS3CredentialsUserToken", + ), + ); + self.inner.unary(req, path, codec).await } - /// Limits the maximum size of a decoded message. + /// GetS3CredentialsUserToken /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self + /// Status: ALPHA + /// + /// Gets S3 credentials for a specific token and data_proxy + pub async fn get_s3_credentials_user_token( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/GetS3CredentialsUserToken", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "GetS3CredentialsUserToken", + ), + ); + self.inner.unary(req, path, codec).await } - /// Limits the maximum size of an encoded message. + /// DeleteS3CredentialsUserToken /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self + /// Status: ALPHA + /// + /// Revokes existing S3 credentials for a specific user and data_proxy + pub async fn delete_s3_credentials_user_token( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/DeleteS3CredentialsUserToken", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "DeleteS3CredentialsUserToken", + ), + ); + self.inner.unary(req, path, codec).await } - /// CreateNewCollection + /// GetDataproxyToken /// - /// Status: BETA + /// Status: ALPHA /// - /// creates a new Collection - pub async fn create_collection( + /// Gets token for a specific user and data_proxy + pub async fn get_dataproxy_token_user( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -14140,28 +12316,28 @@ pub mod collection_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/CreateCollection", + "/aruna.api.storage.services.v2.UserService/GetDataproxyTokenUser", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "CreateCollection", + "aruna.api.storage.services.v2.UserService", + "GetDataproxyTokenUser", ), ); self.inner.unary(req, path, codec).await } - /// GetCollection + /// GetPersonalNotifications /// - /// Status: BETA + /// Status: ALPHA /// - /// Request a specific collection by ID - pub async fn get_collection( + /// Fetches personal notifications + pub async fn get_personal_notifications( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -14175,28 +12351,65 @@ pub mod collection_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/GetCollection", + "/aruna.api.storage.services.v2.UserService/GetPersonalNotifications", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "GetCollection", + "aruna.api.storage.services.v2.UserService", + "GetPersonalNotifications", ), ); self.inner.unary(req, path, codec).await } - /// GetCollections + /// AcknowledgePersonalNotifications + /// + /// Status: ALPHA + /// + /// Acknowledges personal notifications + pub async fn acknowledge_personal_notifications( + &mut self, + request: impl tonic::IntoRequest< + super::AcknowledgePersonalNotificationsRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.UserService/AcknowledgePersonalNotifications", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.UserService", + "AcknowledgePersonalNotifications", + ), + ); + self.inner.unary(req, path, codec).await + } + /// AddOidcProvider /// /// Status: BETA /// - /// Queries multiple collections by ID - pub async fn get_collections( + /// Add alternative oidc login method for user + pub async fn add_oidc_provider( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -14210,28 +12423,29 @@ pub mod collection_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/GetCollections", + "/aruna.api.storage.services.v2.UserService/AddOidcProvider", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "GetCollections", + "aruna.api.storage.services.v2.UserService", + "AddOidcProvider", ), ); self.inner.unary(req, path, codec).await } - /// DeleteCollection + /// RemoveOidcProvider /// - /// Status: STABLE + /// Status: BETA /// - /// This request deletes the collection. - pub async fn delete_collection( + /// Remove alternative oidc login method from user + /// (Only works if user has more than one oidc provider) + pub async fn remove_oidc_provider( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -14245,28 +12459,28 @@ pub mod collection_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/DeleteCollection", + "/aruna.api.storage.services.v2.UserService/RemoveOidcProvider", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "DeleteCollection", + "aruna.api.storage.services.v2.UserService", + "RemoveOidcProvider", ), ); self.inner.unary(req, path, codec).await } - /// UpdateCollectionName + /// AddPubkeyUser /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the collection name. Caveat! Will rename the "s3 bucket" for data proxies! - pub async fn update_collection_name( + /// Adds an ED25519 public key for the user + pub async fn add_pubkey_user( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -14280,28 +12494,28 @@ pub mod collection_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionName", + "/aruna.api.storage.services.v2.UserService/AddPubkeyUser", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "UpdateCollectionName", + "aruna.api.storage.services.v2.UserService", + "AddPubkeyUser", ), ); self.inner.unary(req, path, codec).await } - /// UpdateCollectionDescription + /// AddTrustedEndpointsUser /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the collection description. - pub async fn update_collection_description( + /// Adds an endpoint to the trusted endpoints list of the user + pub async fn add_trusted_endpoints_user( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -14315,28 +12529,28 @@ pub mod collection_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionDescription", + "/aruna.api.storage.services.v2.UserService/AddTrustedEndpointsUser", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "UpdateCollectionDescription", + "aruna.api.storage.services.v2.UserService", + "AddTrustedEndpointsUser", ), ); self.inner.unary(req, path, codec).await } - /// UpdateCollectionKeyValues + /// RemoveTrustedEndpointsUser /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the collection key values. - pub async fn update_collection_key_values( + /// Removes an endpoint from the trusted endpoints list of the user + pub async fn remove_trusted_endpoints_user( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -14350,28 +12564,28 @@ pub mod collection_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionKeyValues", + "/aruna.api.storage.services.v2.UserService/RemoveTrustedEndpointsUser", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "UpdateCollectionKeyValues", + "aruna.api.storage.services.v2.UserService", + "RemoveTrustedEndpointsUser", ), ); self.inner.unary(req, path, codec).await } - /// UpdateCollectionDataClass + /// AddDataProxyAttributeUser /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the collection name. All (meta) data will be overwritten. - pub async fn update_collection_data_class( + /// Adds an data proxy specific attribute to the user + pub async fn add_data_proxy_attribute_user( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -14385,28 +12599,28 @@ pub mod collection_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionDataClass", + "/aruna.api.storage.services.v2.UserService/AddDataProxyAttributeUser", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "UpdateCollectionDataClass", + "aruna.api.storage.services.v2.UserService", + "AddDataProxyAttributeUser", ), ); self.inner.unary(req, path, codec).await } - /// SnapshotCollectionRequest + /// RemoveDataProxyAttributeUser /// - /// Status: BETA + /// Status: ALPHA /// - /// Archives the full collection, rendering all downstream relations immutable - pub async fn snapshot_collection( + /// Removes an data proxy specific attribute from the user + pub async fn remove_data_proxy_attribute_user( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -14420,284 +12634,360 @@ pub mod collection_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/SnapshotCollection", + "/aruna.api.storage.services.v2.UserService/RemoveDataProxyAttributeUser", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "SnapshotCollection", + "aruna.api.storage.services.v2.UserService", + "RemoveDataProxyAttributeUser", ), ); self.inner.unary(req, path, codec).await } - /// UpdateLicenses + } +} +/// Generated server implementations. +pub mod user_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with UserServiceServer. + #[async_trait] + pub trait UserService: Send + Sync + 'static { + /// RegisterUser + /// + /// Status: BETA + /// + /// This request should be called when a new user logs in for the first time + async fn register_user( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeActivateUser + /// + /// Status: BETA + /// + /// This deactivates a specific user (Admin request) + async fn deactivate_user( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// ActivateUser + /// + /// Status: BETA + /// + /// This activates a specific user (Admin request) + async fn activate_user( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// CreateAPIToken + /// + /// Status: BETA + /// + /// Creates an API token to authenticate + async fn create_api_token( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetAPIToken + /// + /// Status: BETA + /// + /// Returns one API token by id + async fn get_api_token( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetAPITokens + /// + /// Status: STABLE + /// + /// Returns a list of API tokens for a specific user + async fn get_api_tokens( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteAPIToken + /// + /// Status: STABLE + /// + /// Deletes the specified API Token + async fn delete_api_token( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteAPITokens + /// + /// Status: BETA + /// + /// Deletes the specified API Token + async fn delete_api_tokens( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetUserRequest + /// + /// Status: STABLE + /// + /// This is a request that returns the user information of the + /// current user or if invoked by an admin from another user + async fn get_user( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// GetUserRequestRedacted + /// + /// Status: STABLE + /// + /// This is a request that returns the user information of the + /// current user or if invoked by an admin from another user + /// Redacts personal information like name or email + async fn get_user_redacted( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateUserDisplayName + /// + /// Status: STABLE + /// + /// Updates the Displayname for the user (Personal only) + async fn update_user_display_name( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateUserDisplayName + /// + /// Status: ALPHA + /// + /// Updates the email for the user (Personal only) + async fn update_user_email( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetNotActivatedUsers /// - /// Status: BETA + /// Status: STABLE /// - /// Updates the collections metadata license and/or default data license. - pub async fn update_collection_licenses( - &mut self, - request: impl tonic::IntoRequest, + /// Get all not activated users (Admin only) + async fn get_not_activated_users( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionLicenses", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "UpdateCollectionLicenses", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateTitle + >; + /// GetAllUsers /// /// Status: ALPHA /// - /// Updates the collections metadata title. - pub async fn update_collection_title( - &mut self, - request: impl tonic::IntoRequest, + /// Get all users including permissions (Admin only) + async fn get_all_users( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionTitle", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "UpdateCollectionTitle", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateAuthors + >; + /// CreateS3CredentialsUserToken /// /// Status: ALPHA /// - /// Updates the collections metadata title. - pub async fn update_collection_authors( - &mut self, - request: impl tonic::IntoRequest, + /// Creates or updates S3 credentials for a specific user and data_proxy + async fn create_s3_credentials_user_token( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionAuthors", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.CollectionService", - "UpdateCollectionAuthors", - ), - ); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod collection_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with CollectionServiceServer. - #[async_trait] - pub trait CollectionService: Send + Sync + 'static { - /// CreateNewCollection + >; + /// GetS3CredentialsUserToken /// - /// Status: BETA + /// Status: ALPHA /// - /// creates a new Collection - async fn create_collection( + /// Gets S3 credentials for a specific token and data_proxy + async fn get_s3_credentials_user_token( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetCollection + /// DeleteS3CredentialsUserToken /// - /// Status: BETA + /// Status: ALPHA /// - /// Request a specific collection by ID - async fn get_collection( + /// Revokes existing S3 credentials for a specific user and data_proxy + async fn delete_s3_credentials_user_token( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetCollections + /// GetDataproxyToken /// - /// Status: BETA + /// Status: ALPHA /// - /// Queries multiple collections by ID - async fn get_collections( + /// Gets token for a specific user and data_proxy + async fn get_dataproxy_token_user( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// DeleteCollection + /// GetPersonalNotifications /// - /// Status: STABLE + /// Status: ALPHA /// - /// This request deletes the collection. - async fn delete_collection( + /// Fetches personal notifications + async fn get_personal_notifications( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateCollectionName + /// AcknowledgePersonalNotifications /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the collection name. Caveat! Will rename the "s3 bucket" for data proxies! - async fn update_collection_name( + /// Acknowledges personal notifications + async fn acknowledge_personal_notifications( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateCollectionDescription + /// AddOidcProvider /// /// Status: BETA /// - /// Updates the collection description. - async fn update_collection_description( + /// Add alternative oidc login method for user + async fn add_oidc_provider( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateCollectionKeyValues + /// RemoveOidcProvider /// /// Status: BETA /// - /// Updates the collection key values. - async fn update_collection_key_values( + /// Remove alternative oidc login method from user + /// (Only works if user has more than one oidc provider) + async fn remove_oidc_provider( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateCollectionDataClass + /// AddPubkeyUser /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the collection name. All (meta) data will be overwritten. - async fn update_collection_data_class( + /// Adds an ED25519 public key for the user + async fn add_pubkey_user( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// SnapshotCollectionRequest + /// AddTrustedEndpointsUser /// - /// Status: BETA + /// Status: ALPHA /// - /// Archives the full collection, rendering all downstream relations immutable - async fn snapshot_collection( + /// Adds an endpoint to the trusted endpoints list of the user + async fn add_trusted_endpoints_user( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateLicenses + /// RemoveTrustedEndpointsUser /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the collections metadata license and/or default data license. - async fn update_collection_licenses( + /// Removes an endpoint from the trusted endpoints list of the user + async fn remove_trusted_endpoints_user( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateTitle + /// AddDataProxyAttributeUser /// /// Status: ALPHA /// - /// Updates the collections metadata title. - async fn update_collection_title( + /// Adds an data proxy specific attribute to the user + async fn add_data_proxy_attribute_user( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateAuthors + /// RemoveDataProxyAttributeUser /// /// Status: ALPHA - /// - /// Updates the collections metadata title. - async fn update_collection_authors( + /// + /// Removes an data proxy specific attribute from the user + async fn remove_data_proxy_attribute_user( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// CollectionService + /// UserService /// /// Status: BETA /// - /// Contains all methods that get/create or update Collection and associated resources + /// Contains all CRUD methods for users and associated resource #[derive(Debug)] - pub struct CollectionServiceServer { + pub struct UserServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -14705,7 +12995,7 @@ pub mod collection_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl CollectionServiceServer { + impl UserServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -14757,9 +13047,9 @@ pub mod collection_service_server { self } } - impl tonic::codegen::Service> for CollectionServiceServer + impl tonic::codegen::Service> for UserServiceServer where - T: CollectionService, + T: UserService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -14775,25 +13065,581 @@ pub mod collection_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.CollectionService/CreateCollection" => { + "/aruna.api.storage.services.v2.UserService/RegisterUser" => { + #[allow(non_camel_case_types)] + struct RegisterUserSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for RegisterUserSvc { + type Response = super::RegisterUserResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::register_user(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RegisterUserSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/DeactivateUser" => { + #[allow(non_camel_case_types)] + struct DeactivateUserSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for DeactivateUserSvc { + type Response = super::DeactivateUserResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::deactivate_user(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeactivateUserSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/ActivateUser" => { + #[allow(non_camel_case_types)] + struct ActivateUserSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for ActivateUserSvc { + type Response = super::ActivateUserResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::activate_user(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ActivateUserSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/CreateAPIToken" => { + #[allow(non_camel_case_types)] + struct CreateAPITokenSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for CreateAPITokenSvc { + type Response = super::CreateApiTokenResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::create_api_token(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateAPITokenSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/GetAPIToken" => { + #[allow(non_camel_case_types)] + struct GetAPITokenSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for GetAPITokenSvc { + type Response = super::GetApiTokenResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_api_token(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetAPITokenSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/GetAPITokens" => { + #[allow(non_camel_case_types)] + struct GetAPITokensSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for GetAPITokensSvc { + type Response = super::GetApiTokensResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_api_tokens(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetAPITokensSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/DeleteAPIToken" => { + #[allow(non_camel_case_types)] + struct DeleteAPITokenSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for DeleteAPITokenSvc { + type Response = super::DeleteApiTokenResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_api_token(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteAPITokenSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/DeleteAPITokens" => { + #[allow(non_camel_case_types)] + struct DeleteAPITokensSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for DeleteAPITokensSvc { + type Response = super::DeleteApiTokensResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_api_tokens(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteAPITokensSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/GetUser" => { + #[allow(non_camel_case_types)] + struct GetUserSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for GetUserSvc { + type Response = super::GetUserResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_user(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetUserSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/GetUserRedacted" => { + #[allow(non_camel_case_types)] + struct GetUserRedactedSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for GetUserRedactedSvc { + type Response = super::GetUserRedactedResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_user_redacted(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetUserRedactedSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/UpdateUserDisplayName" => { + #[allow(non_camel_case_types)] + struct UpdateUserDisplayNameSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for UpdateUserDisplayNameSvc { + type Response = super::UpdateUserDisplayNameResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_user_display_name( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateUserDisplayNameSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/UpdateUserEmail" => { #[allow(non_camel_case_types)] - struct CreateCollectionSvc(pub Arc); + struct UpdateUserEmailSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService - for CreateCollectionSvc { - type Response = super::CreateCollectionResponse; + T: UserService, + > tonic::server::UnaryService + for UpdateUserEmailSvc { + type Response = super::UpdateUserEmailResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_collection(&inner, request) + ::update_user_email(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateUserEmailSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/GetNotActivatedUsers" => { + #[allow(non_camel_case_types)] + struct GetNotActivatedUsersSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService + for GetNotActivatedUsersSvc { + type Response = super::GetNotActivatedUsersResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_not_activated_users(&inner, request) .await }; Box::pin(fut) @@ -14806,7 +13652,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateCollectionSvc(inner); + let method = GetNotActivatedUsersSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -14822,25 +13668,77 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/GetCollection" => { + "/aruna.api.storage.services.v2.UserService/GetAllUsers" => { #[allow(non_camel_case_types)] - struct GetCollectionSvc(pub Arc); + struct GetAllUsersSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService - for GetCollectionSvc { - type Response = super::GetCollectionResponse; + T: UserService, + > tonic::server::UnaryService + for GetAllUsersSvc { + type Response = super::GetAllUsersResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_collection(&inner, request) + ::get_all_users(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetAllUsersSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/CreateS3CredentialsUserToken" => { + #[allow(non_camel_case_types)] + struct CreateS3CredentialsUserTokenSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService< + super::CreateS3CredentialsUserTokenRequest, + > for CreateS3CredentialsUserTokenSvc { + type Response = super::CreateS3CredentialsUserTokenResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::CreateS3CredentialsUserTokenRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::create_s3_credentials_user_token( + &inner, + request, + ) .await }; Box::pin(fut) @@ -14853,7 +13751,113 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetCollectionSvc(inner); + let method = CreateS3CredentialsUserTokenSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/GetS3CredentialsUserToken" => { + #[allow(non_camel_case_types)] + struct GetS3CredentialsUserTokenSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService< + super::GetS3CredentialsUserTokenRequest, + > for GetS3CredentialsUserTokenSvc { + type Response = super::GetS3CredentialsUserTokenResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::GetS3CredentialsUserTokenRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_s3_credentials_user_token( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetS3CredentialsUserTokenSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.UserService/DeleteS3CredentialsUserToken" => { + #[allow(non_camel_case_types)] + struct DeleteS3CredentialsUserTokenSvc(pub Arc); + impl< + T: UserService, + > tonic::server::UnaryService< + super::DeleteS3CredentialsUserTokenRequest, + > for DeleteS3CredentialsUserTokenSvc { + type Response = super::DeleteS3CredentialsUserResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::DeleteS3CredentialsUserTokenRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_s3_credentials_user_token( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteS3CredentialsUserTokenSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -14869,25 +13873,28 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/GetCollections" => { + "/aruna.api.storage.services.v2.UserService/GetDataproxyTokenUser" => { #[allow(non_camel_case_types)] - struct GetCollectionsSvc(pub Arc); + struct GetDataproxyTokenUserSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService - for GetCollectionsSvc { - type Response = super::GetCollectionsResponse; + T: UserService, + > tonic::server::UnaryService + for GetDataproxyTokenUserSvc { + type Response = super::GetDataproxyTokenUserResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_collections(&inner, request) + ::get_dataproxy_token_user( + &inner, + request, + ) .await }; Box::pin(fut) @@ -14900,7 +13907,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetCollectionsSvc(inner); + let method = GetDataproxyTokenUserSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -14916,25 +13923,30 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/DeleteCollection" => { + "/aruna.api.storage.services.v2.UserService/GetPersonalNotifications" => { #[allow(non_camel_case_types)] - struct DeleteCollectionSvc(pub Arc); + struct GetPersonalNotificationsSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService - for DeleteCollectionSvc { - type Response = super::DeleteCollectionResponse; + T: UserService, + > tonic::server::UnaryService + for GetPersonalNotificationsSvc { + type Response = super::GetPersonalNotificationsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::GetPersonalNotificationsRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_collection(&inner, request) + ::get_personal_notifications( + &inner, + request, + ) .await }; Box::pin(fut) @@ -14947,7 +13959,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteCollectionSvc(inner); + let method = GetPersonalNotificationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -14963,25 +13975,30 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionName" => { + "/aruna.api.storage.services.v2.UserService/AcknowledgePersonalNotifications" => { #[allow(non_camel_case_types)] - struct UpdateCollectionNameSvc(pub Arc); + struct AcknowledgePersonalNotificationsSvc( + pub Arc, + ); impl< - T: CollectionService, - > tonic::server::UnaryService - for UpdateCollectionNameSvc { - type Response = super::UpdateCollectionNameResponse; + T: UserService, + > tonic::server::UnaryService< + super::AcknowledgePersonalNotificationsRequest, + > for AcknowledgePersonalNotificationsSvc { + type Response = super::AcknowledgePersonalNotificationsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::AcknowledgePersonalNotificationsRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_collection_name( + ::acknowledge_personal_notifications( &inner, request, ) @@ -14997,7 +14014,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateCollectionNameSvc(inner); + let method = AcknowledgePersonalNotificationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15013,34 +14030,25 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionDescription" => { + "/aruna.api.storage.services.v2.UserService/AddOidcProvider" => { #[allow(non_camel_case_types)] - struct UpdateCollectionDescriptionSvc( - pub Arc, - ); + struct AddOidcProviderSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService< - super::UpdateCollectionDescriptionRequest, - > for UpdateCollectionDescriptionSvc { - type Response = super::UpdateCollectionDescriptionResponse; + T: UserService, + > tonic::server::UnaryService + for AddOidcProviderSvc { + type Response = super::AddOidcProviderResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::UpdateCollectionDescriptionRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_collection_description( - &inner, - request, - ) - .await + ::add_oidc_provider(&inner, request).await }; Box::pin(fut) } @@ -15052,7 +14060,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateCollectionDescriptionSvc(inner); + let method = AddOidcProviderSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15068,33 +14076,25 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionKeyValues" => { + "/aruna.api.storage.services.v2.UserService/RemoveOidcProvider" => { #[allow(non_camel_case_types)] - struct UpdateCollectionKeyValuesSvc( - pub Arc, - ); + struct RemoveOidcProviderSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService< - super::UpdateCollectionKeyValuesRequest, - > for UpdateCollectionKeyValuesSvc { - type Response = super::UpdateCollectionKeyValuesResponse; + T: UserService, + > tonic::server::UnaryService + for RemoveOidcProviderSvc { + type Response = super::RemoveOidcProviderResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::UpdateCollectionKeyValuesRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_collection_key_values( - &inner, - request, - ) + ::remove_oidc_provider(&inner, request) .await }; Box::pin(fut) @@ -15107,7 +14107,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateCollectionKeyValuesSvc(inner); + let method = RemoveOidcProviderSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15123,34 +14123,25 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionDataClass" => { + "/aruna.api.storage.services.v2.UserService/AddPubkeyUser" => { #[allow(non_camel_case_types)] - struct UpdateCollectionDataClassSvc( - pub Arc, - ); + struct AddPubkeyUserSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService< - super::UpdateCollectionDataClassRequest, - > for UpdateCollectionDataClassSvc { - type Response = super::UpdateCollectionDataClassResponse; + T: UserService, + > tonic::server::UnaryService + for AddPubkeyUserSvc { + type Response = super::AddPubkeyUserResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::UpdateCollectionDataClassRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_collection_data_class( - &inner, - request, - ) - .await + ::add_pubkey_user(&inner, request).await }; Box::pin(fut) } @@ -15162,7 +14153,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateCollectionDataClassSvc(inner); + let method = AddPubkeyUserSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15178,25 +14169,27 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/SnapshotCollection" => { + "/aruna.api.storage.services.v2.UserService/AddTrustedEndpointsUser" => { #[allow(non_camel_case_types)] - struct SnapshotCollectionSvc(pub Arc); + struct AddTrustedEndpointsUserSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService - for SnapshotCollectionSvc { - type Response = super::SnapshotCollectionResponse; + T: UserService, + > tonic::server::UnaryService + for AddTrustedEndpointsUserSvc { + type Response = super::AddTrustedEndpointsUserResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::AddTrustedEndpointsUserRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::snapshot_collection( + ::add_trusted_endpoints_user( &inner, request, ) @@ -15212,7 +14205,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = SnapshotCollectionSvc(inner); + let method = AddTrustedEndpointsUserSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15228,14 +14221,15 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionLicenses" => { + "/aruna.api.storage.services.v2.UserService/RemoveTrustedEndpointsUser" => { #[allow(non_camel_case_types)] - struct UpdateCollectionLicensesSvc(pub Arc); + struct RemoveTrustedEndpointsUserSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService - for UpdateCollectionLicensesSvc { - type Response = super::UpdateCollectionLicensesResponse; + T: UserService, + > tonic::server::UnaryService< + super::RemoveTrustedEndpointsUserRequest, + > for RemoveTrustedEndpointsUserSvc { + type Response = super::RemoveTrustedEndpointsUserResponse; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -15243,12 +14237,12 @@ pub mod collection_service_server { fn call( &mut self, request: tonic::Request< - super::UpdateCollectionLicensesRequest, + super::RemoveTrustedEndpointsUserRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_collection_licenses( + ::remove_trusted_endpoints_user( &inner, request, ) @@ -15264,7 +14258,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateCollectionLicensesSvc(inner); + let method = RemoveTrustedEndpointsUserSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15280,25 +14274,28 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionTitle" => { + "/aruna.api.storage.services.v2.UserService/AddDataProxyAttributeUser" => { #[allow(non_camel_case_types)] - struct UpdateCollectionTitleSvc(pub Arc); + struct AddDataProxyAttributeUserSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService - for UpdateCollectionTitleSvc { - type Response = super::UpdateCollectionTitleResponse; + T: UserService, + > tonic::server::UnaryService< + super::AddDataProxyAttributeUserRequest, + > for AddDataProxyAttributeUserSvc { + type Response = super::AddDataProxyAttributeUserResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::AddDataProxyAttributeUserRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_collection_title( + ::add_data_proxy_attribute_user( &inner, request, ) @@ -15314,7 +14311,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateCollectionTitleSvc(inner); + let method = AddDataProxyAttributeUserSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15330,14 +14327,15 @@ pub mod collection_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.CollectionService/UpdateCollectionAuthors" => { + "/aruna.api.storage.services.v2.UserService/RemoveDataProxyAttributeUser" => { #[allow(non_camel_case_types)] - struct UpdateCollectionAuthorsSvc(pub Arc); + struct RemoveDataProxyAttributeUserSvc(pub Arc); impl< - T: CollectionService, - > tonic::server::UnaryService - for UpdateCollectionAuthorsSvc { - type Response = super::UpdateCollectionAuthorsResponse; + T: UserService, + > tonic::server::UnaryService< + super::RemoveDataProxyAttributeUserRequest, + > for RemoveDataProxyAttributeUserSvc { + type Response = super::RemoveDataProxyAttributeUserResponse; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -15345,12 +14343,12 @@ pub mod collection_service_server { fn call( &mut self, request: tonic::Request< - super::UpdateCollectionAuthorsRequest, + super::RemoveDataProxyAttributeUserRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_collection_authors( + ::remove_data_proxy_attribute_user( &inner, request, ) @@ -15366,7 +14364,7 @@ pub mod collection_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateCollectionAuthorsSvc(inner); + let method = RemoveDataProxyAttributeUserSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15397,7 +14395,7 @@ pub mod collection_service_server { } } } - impl Clone for CollectionServiceServer { + impl Clone for UserServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -15409,150 +14407,413 @@ pub mod collection_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for UserServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.UserService"; + } +} +/// Models +/// These are the models for the above described requests and responses. +/// gRPC best practises advice each Request and Response message in a RPC to be +/// called {rpc_name}Request and {rpc_name}Response. +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateObjectRequest { + /// collection name + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// title + #[prost(string, tag = "12")] + pub title: ::prost::alloc::string::String, + /// description + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// collection specific labels / hooks + #[prost(message, repeated, tag = "3")] + pub key_values: ::prost::alloc::vec::Vec, + /// Internal / External relations (URLs / IDs from external sources) + #[prost(message, repeated, tag = "4")] + pub relations: ::prost::alloc::vec::Vec, + /// DataClass + #[prost(enumeration = "super::super::models::v2::DataClass", tag = "5")] + pub data_class: i32, + #[prost(message, repeated, tag = "9")] + pub hashes: ::prost::alloc::vec::Vec, + #[prost(string, tag = "10")] + pub metadata_license_tag: ::prost::alloc::string::String, + #[prost(string, tag = "11")] + pub data_license_tag: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "13")] + pub authors: ::prost::alloc::vec::Vec, + /// Parent can be one of all other resources + #[prost(oneof = "create_object_request::Parent", tags = "6, 7, 8")] + pub parent: ::core::option::Option, +} +/// Nested message and enum types in `CreateObjectRequest`. +pub mod create_object_request { + /// Parent can be one of all other resources + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Parent { + #[prost(string, tag = "6")] + ProjectId(::prost::alloc::string::String), + #[prost(string, tag = "7")] + CollectionId(::prost::alloc::string::String), + #[prost(string, tag = "8")] + DatasetId(::prost::alloc::string::String), + } +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateObjectResponse { + #[prost(message, optional, tag = "1")] + pub object: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetUploadUrlRequest { + /// ObjectId + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, + /// Is this a multipart upload? + #[prost(bool, tag = "2")] + pub multipart: bool, + /// (optional) if multi was initialized + #[prost(int32, tag = "3")] + pub part_number: i32, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetUploadUrlResponse { + /// URL + #[prost(string, tag = "1")] + pub url: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetDownloadUrlRequest { + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetDownloadUrlResponse { + /// URL + #[prost(string, tag = "1")] + pub url: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CompletedPart { + /// Multipart identifier + #[prost(string, tag = "1")] + pub etag: ::prost::alloc::string::String, + /// Part number + #[prost(int64, tag = "2")] + pub part: i64, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FinishObjectStagingRequest { + /// ObjectId + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, + /// Final content len + #[prost(int64, tag = "2")] + pub content_len: i64, + /// Hash of the uploaded data - used to verify the data integrity. + /// This supports multiple hashing algorithms. + #[prost(message, repeated, tag = "3")] + pub hashes: ::prost::alloc::vec::Vec, + /// If the upload was multipart, this is the list of parts that were uploaded. + /// Should be empty if the upload was not multipart. + /// (optional) + #[prost(message, repeated, tag = "4")] + pub completed_parts: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FinishObjectStagingResponse { + /// (new) Object overview + #[prost(message, optional, tag = "1")] + pub object: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateObjectRequest { + /// Existing object ID + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, + /// object name + #[prost(string, optional, tag = "2")] + pub name: ::core::option::Option<::prost::alloc::string::String>, + /// object description + #[prost(string, optional, tag = "3")] + pub description: ::core::option::Option<::prost::alloc::string::String>, + /// key_values to add + #[prost(message, repeated, tag = "4")] + pub add_key_values: ::prost::alloc::vec::Vec, + /// key_values to remove + #[prost(message, repeated, tag = "5")] + pub remove_key_values: ::prost::alloc::vec::Vec, + /// New DataClass + #[prost(enumeration = "super::super::models::v2::DataClass", tag = "7")] + pub data_class: i32, + #[prost(message, repeated, tag = "12")] + pub hashes: ::prost::alloc::vec::Vec, + /// Force new object revision + #[prost(bool, tag = "13")] + pub force_revision: bool, + #[prost(string, optional, tag = "14")] + pub metadata_license_tag: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag = "15")] + pub data_license_tag: ::core::option::Option<::prost::alloc::string::String>, + /// Parent can be one of all other resources + #[prost(oneof = "update_object_request::Parent", tags = "8, 9, 10")] + pub parent: ::core::option::Option, +} +/// Nested message and enum types in `UpdateObjectRequest`. +pub mod update_object_request { + /// Parent can be one of all other resources + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Parent { + #[prost(string, tag = "8")] + ProjectId(::prost::alloc::string::String), + #[prost(string, tag = "9")] + CollectionId(::prost::alloc::string::String), + #[prost(string, tag = "10")] + DatasetId(::prost::alloc::string::String), } - impl tonic::server::NamedService - for CollectionServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.CollectionService"; +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateObjectResponse { + #[prost(message, optional, tag = "1")] + pub object: ::core::option::Option, + #[prost(bool, tag = "2")] + pub new_revision: bool, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CloneObjectRequest { + /// ObjectId + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, + /// + #[prost(oneof = "clone_object_request::Parent", tags = "2, 3, 4")] + pub parent: ::core::option::Option, +} +/// Nested message and enum types in `CloneObjectRequest`. +pub mod clone_object_request { + /// + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Parent { + #[prost(string, tag = "2")] + ProjectId(::prost::alloc::string::String), + #[prost(string, tag = "3")] + CollectionId(::prost::alloc::string::String), + #[prost(string, tag = "4")] + DatasetId(::prost::alloc::string::String), } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ReplicateProjectDataRequest { - #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, +pub struct CloneObjectResponse { + /// This describes the new object. + #[prost(message, optional, tag = "1")] + pub object: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteObjectRequest { + /// ObjectId + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, + /// Delete including revisions + #[prost(bool, tag = "2")] + pub with_revisions: bool, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteObjectResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetObjectRequest { + /// Object Id + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetObjectResponse { + #[prost(message, optional, tag = "1")] + pub object: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetObjectsRequest { + /// Object ids + #[prost(string, repeated, tag = "1")] + pub object_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetObjectsResponse { + /// A List of objects + #[prost(message, repeated, tag = "1")] + pub objects: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetObjectRevisionsRequest { + /// Object id #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, + pub object_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ReplicateProjectDataResponse { - #[prost(enumeration = "super::super::models::v2::ReplicationStatus", tag = "1")] - pub status: i32, +pub struct GetObjectRevisionsResponse { + /// List of objects + #[prost(message, repeated, tag = "1")] + pub objects: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct PartialReplicateDataRequest { - #[prost(string, tag = "4")] - pub endpoint_id: ::prost::alloc::string::String, - #[prost(oneof = "partial_replicate_data_request::DataVariant", tags = "1, 2, 3")] - pub data_variant: ::core::option::Option< - partial_replicate_data_request::DataVariant, - >, -} -/// Nested message and enum types in `PartialReplicateDataRequest`. -pub mod partial_replicate_data_request { - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum DataVariant { - #[prost(string, tag = "1")] - CollectionId(::prost::alloc::string::String), - #[prost(string, tag = "2")] - DatasetId(::prost::alloc::string::String), - #[prost(string, tag = "3")] - ObjectId(::prost::alloc::string::String), - } +pub struct GetLatestObjectRevisionRequest { + /// Object id + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct PartialReplicateDataResponse { - #[prost(enumeration = "super::super::models::v2::ReplicationStatus", tag = "1")] - pub status: i32, +pub struct GetLatestObjectRevisionResponse { + /// The object with the latest revision + #[prost(message, optional, tag = "1")] + pub object: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateReplicationStatusRequest { +pub struct GetObjectEndpointsRequest { + /// Collection id #[prost(string, tag = "1")] - pub object_id: ::prost::alloc::string::String, + pub collection_id: ::prost::alloc::string::String, + /// Object id #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::ReplicationStatus", tag = "3")] - pub status: i32, + pub object_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateReplicationStatusResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetReplicationStatusRequest { +pub struct UpdateObjectTitleRequest { + /// Object id #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, + pub object_id: ::prost::alloc::string::String, + /// New title #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, + pub title: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetReplicationStatusResponse { - #[prost(message, repeated, tag = "1")] - pub infos: ::prost::alloc::vec::Vec, +pub struct UpdateObjectTitleResponse { + /// The updated object + #[prost(message, optional, tag = "1")] + pub object: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ReplicationInfo { - #[prost(message, optional, tag = "5")] - pub endpoint_info: ::core::option::Option, - #[prost(oneof = "replication_info::Resource", tags = "1, 2, 3, 4")] - pub resource: ::core::option::Option, +pub struct UpdateObjectAuthorsRequest { + /// Object id + #[prost(string, tag = "1")] + pub object_id: ::prost::alloc::string::String, + /// Add authors + #[prost(message, repeated, tag = "2")] + pub add_authors: ::prost::alloc::vec::Vec, + /// Remove authors + #[prost(message, repeated, tag = "3")] + pub remove_authors: ::prost::alloc::vec::Vec, } -/// Nested message and enum types in `ReplicationInfo`. -pub mod replication_info { - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Resource { - #[prost(string, tag = "1")] - ProjectId(::prost::alloc::string::String), - #[prost(string, tag = "2")] - CollectionId(::prost::alloc::string::String), - #[prost(string, tag = "3")] - DatasetId(::prost::alloc::string::String), - #[prost(string, tag = "4")] - ObjectId(::prost::alloc::string::String), - } +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateObjectAuthorsResponse { + /// The updated object + #[prost(message, optional, tag = "1")] + pub object: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteReplicationRequest { +pub struct SetObjectHashesRequest { + /// Object id #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub endpoint_id: ::prost::alloc::string::String, + pub object_id: ::prost::alloc::string::String, + /// Hashes + #[prost(message, repeated, tag = "2")] + pub hashes: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteReplicationResponse {} +pub struct SetObjectHashesResponse { + /// The updated object (possibly with error status) + #[prost(message, optional, tag = "1")] + pub object: ::core::option::Option, +} /// Generated client implementations. -pub mod data_replication_service_client { +pub mod object_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// DataReplicationService - /// Endpoint specific methods for syncing data + /// ObjectService + /// + /// Status: BETA + /// + /// Contains all methods that get/create or update objects and associated resources #[derive(Debug, Clone)] - pub struct DataReplicationServiceClient { + pub struct ObjectServiceClient { inner: tonic::client::Grpc, } - impl DataReplicationServiceClient + impl ObjectServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -15570,7 +14831,7 @@ pub mod data_replication_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> DataReplicationServiceClient> + ) -> ObjectServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -15584,51 +14845,271 @@ pub mod data_replication_service_client { http::Request, >>::Error: Into + Send + Sync, { - DataReplicationServiceClient::new( - InterceptedService::new(inner, interceptor), - ) + ObjectServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// CreateObject + /// + /// Status: BETA + /// + /// This creates a new object and puts it in a staging area. + /// Staging objects have an "INITIALIZING" status + /// and need to be finished either manually or by uploading data. + pub async fn create_object( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ObjectService/CreateObject", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ObjectService", + "CreateObject", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetUploadURL + /// + /// Status: BETA + /// + /// This is a proxy method that will call the apropriate method at dataproxy level + /// This method will return a (multi-part) url that can be used to upload a + /// file to S3. Part is a optional query parameter that can be used to upload a + /// part of the file / multipart upload. + pub async fn get_upload_url( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ObjectService/GetUploadURL", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ObjectService", + "GetUploadURL", + ), + ); + self.inner.unary(req, path, codec).await } - /// Compress requests with the given encoding. + /// GetDownloadUrl /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self + /// Status: BETA + /// + /// This is a proxy method that will call the apropriate method at dataproxy level + /// will return a url that can be used to download a file from S3. + pub async fn get_download_url( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ObjectService/GetDownloadURL", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ObjectService", + "GetDownloadURL", + ), + ); + self.inner.unary(req, path, codec).await } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self + /// FinishObjectStaging + /// + /// Status: BETA + /// + /// This method completes the staging of an object. + pub async fn finish_object_staging( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ObjectService/FinishObjectStaging", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ObjectService", + "FinishObjectStaging", + ), + ); + self.inner.unary(req, path, codec).await } - /// Limits the maximum size of a decoded message. + /// UpdateObject /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self + /// Status: BETA + /// + /// Objects are immutable! + /// Updating an object will create a new revision for the object + /// This method will put the new revision in a staging area. + /// Staged objects will get a separate staging id and need to be finished + /// before they can be used. + pub async fn update_object( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ObjectService/UpdateObject", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ObjectService", + "UpdateObject", + ), + ); + self.inner.unary(req, path, codec).await } - /// Limits the maximum size of an encoded message. + /// CloneObject /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self + /// Status: BETA + /// + /// This method clones an object and creates a copy in the same collection. + /// This copy has a new id and revision and will not receive any updates from + /// the original object. + pub async fn clone_object( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ObjectService/CloneObject", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ObjectService", + "CloneObject", + ), + ); + self.inner.unary(req, path, codec).await } - /// ReplicateProjectData + /// DeleteObject /// - /// Status: ALPHA + /// Status: BETA /// - /// Replicates the (full) project data from one endpoint to another - pub async fn replicate_project_data( + /// Deletes the object with the complete revision history. + pub async fn delete_object( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -15642,28 +15123,31 @@ pub mod data_replication_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DataReplicationService/ReplicateProjectData", + "/aruna.api.storage.services.v2.ObjectService/DeleteObject", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DataReplicationService", - "ReplicateProjectData", + "aruna.api.storage.services.v2.ObjectService", + "DeleteObject", ), ); self.inner.unary(req, path, codec).await } - /// PartialReplicateData + /// GetObject /// - /// Status: ALPHA + /// Status: BETA /// - /// Partial replicate data between endpoints - pub async fn partial_replicate_data( + /// gets a specific Object by ID that is associated to the + /// current collection By default only the latest revision of an object will be + /// returned Specify a revision_number to select an older revision With the + /// optional with_url boolean a download link can automatically be requested + pub async fn get_object( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -15677,28 +15161,63 @@ pub mod data_replication_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DataReplicationService/PartialReplicateData", + "/aruna.api.storage.services.v2.ObjectService/GetObject", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DataReplicationService", - "PartialReplicateData", + "aruna.api.storage.services.v2.ObjectService", + "GetObject", ), ); self.inner.unary(req, path, codec).await } - /// UpdateReplicationStatus + /// GetObjects + /// + /// Status: BETA + /// + /// Get multiple objects by ID at once + pub async fn get_objects( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.ObjectService/GetObjects", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.ObjectService", + "GetObjects", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateTitle /// /// Status: ALPHA /// - /// Update the replication status of a project - pub async fn update_replication_status( + /// This method updates the title of an object + pub async fn update_object_title( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -15712,28 +15231,28 @@ pub mod data_replication_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DataReplicationService/UpdateReplicationStatus", + "/aruna.api.storage.services.v2.ObjectService/UpdateObjectTitle", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DataReplicationService", - "UpdateReplicationStatus", + "aruna.api.storage.services.v2.ObjectService", + "UpdateObjectTitle", ), ); self.inner.unary(req, path, codec).await } - /// GetReplicationStatus + /// UpdateAuthors /// /// Status: ALPHA /// - /// Get the replication status of a project - pub async fn get_replication_status( + /// This method updates the authors of an object + pub async fn update_object_authors( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -15747,28 +15266,30 @@ pub mod data_replication_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DataReplicationService/GetReplicationStatus", + "/aruna.api.storage.services.v2.ObjectService/UpdateObjectAuthors", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DataReplicationService", - "GetReplicationStatus", + "aruna.api.storage.services.v2.ObjectService", + "UpdateObjectAuthors", ), ); self.inner.unary(req, path, codec).await } - /// DeleteReplication + /// SetObjectHashes /// /// Status: ALPHA /// - /// Delete the replication status of a project - pub async fn delete_replication( + /// This method sets the object hashes if not already set + /// if a hash is already set, it will be compared to the new hash and + /// set the status to ERROR if they do not match + pub async fn set_object_hashes( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -15782,14 +15303,14 @@ pub mod data_replication_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.DataReplicationService/DeleteReplication", + "/aruna.api.storage.services.v2.ObjectService/SetObjectHashes", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.DataReplicationService", - "DeleteReplication", + "aruna.api.storage.services.v2.ObjectService", + "SetObjectHashes", ), ); self.inner.unary(req, path, codec).await @@ -15797,77 +15318,181 @@ pub mod data_replication_service_client { } } /// Generated server implementations. -pub mod data_replication_service_server { +pub mod object_service_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with DataReplicationServiceServer. + /// Generated trait containing gRPC methods that should be implemented for use with ObjectServiceServer. #[async_trait] - pub trait DataReplicationService: Send + Sync + 'static { - /// ReplicateProjectData + pub trait ObjectService: Send + Sync + 'static { + /// CreateObject /// - /// Status: ALPHA + /// Status: BETA /// - /// Replicates the (full) project data from one endpoint to another - async fn replicate_project_data( + /// This creates a new object and puts it in a staging area. + /// Staging objects have an "INITIALIZING" status + /// and need to be finished either manually or by uploading data. + async fn create_object( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// PartialReplicateData + /// GetUploadURL /// - /// Status: ALPHA + /// Status: BETA /// - /// Partial replicate data between endpoints - async fn partial_replicate_data( + /// This is a proxy method that will call the apropriate method at dataproxy level + /// This method will return a (multi-part) url that can be used to upload a + /// file to S3. Part is a optional query parameter that can be used to upload a + /// part of the file / multipart upload. + async fn get_upload_url( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateReplicationStatus + /// GetDownloadUrl + /// + /// Status: BETA + /// + /// This is a proxy method that will call the apropriate method at dataproxy level + /// will return a url that can be used to download a file from S3. + async fn get_download_url( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// FinishObjectStaging + /// + /// Status: BETA + /// + /// This method completes the staging of an object. + async fn finish_object_staging( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateObject + /// + /// Status: BETA + /// + /// Objects are immutable! + /// Updating an object will create a new revision for the object + /// This method will put the new revision in a staging area. + /// Staged objects will get a separate staging id and need to be finished + /// before they can be used. + async fn update_object( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// CloneObject + /// + /// Status: BETA + /// + /// This method clones an object and creates a copy in the same collection. + /// This copy has a new id and revision and will not receive any updates from + /// the original object. + async fn clone_object( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteObject + /// + /// Status: BETA + /// + /// Deletes the object with the complete revision history. + async fn delete_object( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetObject + /// + /// Status: BETA + /// + /// gets a specific Object by ID that is associated to the + /// current collection By default only the latest revision of an object will be + /// returned Specify a revision_number to select an older revision With the + /// optional with_url boolean a download link can automatically be requested + async fn get_object( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetObjects + /// + /// Status: BETA + /// + /// Get multiple objects by ID at once + async fn get_objects( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateTitle /// /// Status: ALPHA /// - /// Update the replication status of a project - async fn update_replication_status( + /// This method updates the title of an object + async fn update_object_title( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetReplicationStatus + /// UpdateAuthors /// /// Status: ALPHA /// - /// Get the replication status of a project - async fn get_replication_status( + /// This method updates the authors of an object + async fn update_object_authors( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// DeleteReplication + /// SetObjectHashes /// /// Status: ALPHA /// - /// Delete the replication status of a project - async fn delete_replication( + /// This method sets the object hashes if not already set + /// if a hash is already set, it will be compared to the new hash and + /// set the status to ERROR if they do not match + async fn set_object_hashes( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// DataReplicationService - /// Endpoint specific methods for syncing data + /// ObjectService + /// + /// Status: BETA + /// + /// Contains all methods that get/create or update objects and associated resources #[derive(Debug)] - pub struct DataReplicationServiceServer { + pub struct ObjectServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -15875,7 +15500,7 @@ pub mod data_replication_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl DataReplicationServiceServer { + impl ObjectServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -15927,10 +15552,9 @@ pub mod data_replication_service_server { self } } - impl tonic::codegen::Service> - for DataReplicationServiceServer + impl tonic::codegen::Service> for ObjectServiceServer where - T: DataReplicationService, + T: ObjectService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -15946,31 +15570,349 @@ pub mod data_replication_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.DataReplicationService/ReplicateProjectData" => { + "/aruna.api.storage.services.v2.ObjectService/CreateObject" => { + #[allow(non_camel_case_types)] + struct CreateObjectSvc(pub Arc); + impl< + T: ObjectService, + > tonic::server::UnaryService + for CreateObjectSvc { + type Response = super::CreateObjectResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::create_object(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateObjectSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.ObjectService/GetUploadURL" => { + #[allow(non_camel_case_types)] + struct GetUploadURLSvc(pub Arc); + impl< + T: ObjectService, + > tonic::server::UnaryService + for GetUploadURLSvc { + type Response = super::GetUploadUrlResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_upload_url(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetUploadURLSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.ObjectService/GetDownloadURL" => { + #[allow(non_camel_case_types)] + struct GetDownloadURLSvc(pub Arc); + impl< + T: ObjectService, + > tonic::server::UnaryService + for GetDownloadURLSvc { + type Response = super::GetDownloadUrlResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_download_url(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetDownloadURLSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.ObjectService/FinishObjectStaging" => { + #[allow(non_camel_case_types)] + struct FinishObjectStagingSvc(pub Arc); + impl< + T: ObjectService, + > tonic::server::UnaryService + for FinishObjectStagingSvc { + type Response = super::FinishObjectStagingResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::finish_object_staging(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = FinishObjectStagingSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.ObjectService/UpdateObject" => { + #[allow(non_camel_case_types)] + struct UpdateObjectSvc(pub Arc); + impl< + T: ObjectService, + > tonic::server::UnaryService + for UpdateObjectSvc { + type Response = super::UpdateObjectResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_object(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateObjectSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.ObjectService/CloneObject" => { + #[allow(non_camel_case_types)] + struct CloneObjectSvc(pub Arc); + impl< + T: ObjectService, + > tonic::server::UnaryService + for CloneObjectSvc { + type Response = super::CloneObjectResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::clone_object(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CloneObjectSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.ObjectService/DeleteObject" => { + #[allow(non_camel_case_types)] + struct DeleteObjectSvc(pub Arc); + impl< + T: ObjectService, + > tonic::server::UnaryService + for DeleteObjectSvc { + type Response = super::DeleteObjectResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_object(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteObjectSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.ObjectService/GetObject" => { #[allow(non_camel_case_types)] - struct ReplicateProjectDataSvc( - pub Arc, - ); + struct GetObjectSvc(pub Arc); impl< - T: DataReplicationService, - > tonic::server::UnaryService - for ReplicateProjectDataSvc { - type Response = super::ReplicateProjectDataResponse; + T: ObjectService, + > tonic::server::UnaryService + for GetObjectSvc { + type Response = super::GetObjectResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::replicate_project_data( - &inner, - request, - ) - .await + ::get_object(&inner, request).await }; Box::pin(fut) } @@ -15982,7 +15924,7 @@ pub mod data_replication_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ReplicateProjectDataSvc(inner); + let method = GetObjectSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -15998,31 +15940,25 @@ pub mod data_replication_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DataReplicationService/PartialReplicateData" => { + "/aruna.api.storage.services.v2.ObjectService/GetObjects" => { #[allow(non_camel_case_types)] - struct PartialReplicateDataSvc( - pub Arc, - ); + struct GetObjectsSvc(pub Arc); impl< - T: DataReplicationService, - > tonic::server::UnaryService - for PartialReplicateDataSvc { - type Response = super::PartialReplicateDataResponse; + T: ObjectService, + > tonic::server::UnaryService + for GetObjectsSvc { + type Response = super::GetObjectsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::partial_replicate_data( - &inner, - request, - ) - .await + ::get_objects(&inner, request).await }; Box::pin(fut) } @@ -16034,7 +15970,7 @@ pub mod data_replication_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = PartialReplicateDataSvc(inner); + let method = GetObjectsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -16050,32 +15986,25 @@ pub mod data_replication_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DataReplicationService/UpdateReplicationStatus" => { + "/aruna.api.storage.services.v2.ObjectService/UpdateObjectTitle" => { #[allow(non_camel_case_types)] - struct UpdateReplicationStatusSvc( - pub Arc, - ); + struct UpdateObjectTitleSvc(pub Arc); impl< - T: DataReplicationService, - > tonic::server::UnaryService - for UpdateReplicationStatusSvc { - type Response = super::UpdateReplicationStatusResponse; + T: ObjectService, + > tonic::server::UnaryService + for UpdateObjectTitleSvc { + type Response = super::UpdateObjectTitleResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::UpdateReplicationStatusRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_replication_status( - &inner, - request, - ) + ::update_object_title(&inner, request) .await }; Box::pin(fut) @@ -16088,7 +16017,7 @@ pub mod data_replication_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateReplicationStatusSvc(inner); + let method = UpdateObjectTitleSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -16104,30 +16033,25 @@ pub mod data_replication_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DataReplicationService/GetReplicationStatus" => { + "/aruna.api.storage.services.v2.ObjectService/UpdateObjectAuthors" => { #[allow(non_camel_case_types)] - struct GetReplicationStatusSvc( - pub Arc, - ); + struct UpdateObjectAuthorsSvc(pub Arc); impl< - T: DataReplicationService, - > tonic::server::UnaryService - for GetReplicationStatusSvc { - type Response = super::GetReplicationStatusResponse; + T: ObjectService, + > tonic::server::UnaryService + for UpdateObjectAuthorsSvc { + type Response = super::UpdateObjectAuthorsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_replication_status( - &inner, - request, - ) + ::update_object_authors(&inner, request) .await }; Box::pin(fut) @@ -16140,7 +16064,7 @@ pub mod data_replication_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetReplicationStatusSvc(inner); + let method = UpdateObjectAuthorsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -16156,28 +16080,25 @@ pub mod data_replication_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.DataReplicationService/DeleteReplication" => { + "/aruna.api.storage.services.v2.ObjectService/SetObjectHashes" => { #[allow(non_camel_case_types)] - struct DeleteReplicationSvc(pub Arc); + struct SetObjectHashesSvc(pub Arc); impl< - T: DataReplicationService, - > tonic::server::UnaryService - for DeleteReplicationSvc { - type Response = super::DeleteReplicationResponse; + T: ObjectService, + > tonic::server::UnaryService + for SetObjectHashesSvc { + type Response = super::SetObjectHashesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_replication( - &inner, - request, - ) + ::set_object_hashes(&inner, request) .await }; Box::pin(fut) @@ -16190,7 +16111,7 @@ pub mod data_replication_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteReplicationSvc(inner); + let method = SetObjectHashesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -16221,7 +16142,7 @@ pub mod data_replication_service_server { } } } - impl Clone for DataReplicationServiceServer { + impl Clone for ObjectServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -16233,7 +16154,7 @@ pub mod data_replication_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -16243,102 +16164,164 @@ pub mod data_replication_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService - for DataReplicationServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.DataReplicationService"; + impl tonic::server::NamedService for ObjectServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.ObjectService"; } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ModifyRelationsRequest { +pub struct CreateWorkspaceTemplateRequest { + /// The user id of the template owner (will be automatically added as "admin" to each associated workspace) #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub add_relations: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub remove_relations: ::prost::alloc::vec::Vec, + pub owner_id: ::prost::alloc::string::String, + /// Short prefix for each workspace_project (will be prepended by a random id) example: test-i12ashj9g2 + #[prost(string, tag = "2")] + pub prefix: ::prost::alloc::string::String, + /// The name of the workspace template + #[prost(string, tag = "3")] + pub name: ::prost::alloc::string::String, + /// Hooks that are added to created workspaces + #[prost(string, repeated, tag = "5")] + pub hook_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Description of the workspace + #[prost(string, tag = "6")] + pub description: ::prost::alloc::string::String, + /// Endpoint ids that are used for this template + #[prost(string, repeated, tag = "7")] + pub endpoint_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Rule ids that are enforced on workspace-level + #[prost(string, repeated, tag = "8")] + pub rules: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ModifyRelationsResponse {} +pub struct CreateWorkspaceTemplateResponse { + #[prost(string, tag = "1")] + pub template_id: ::prost::alloc::string::String, +} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetHierarchyRequest { +pub struct GetWorkspaceTemplateRequest { #[prost(string, tag = "1")] - pub resource_id: ::prost::alloc::string::String, + pub template_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetWorkspaceTemplateResponse { + #[prost(message, optional, tag = "1")] + pub workspace: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteWorkspaceTemplateRequest { + #[prost(string, tag = "1")] + pub template_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteWorkspaceTemplateResponse {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListOwnedWorkspaceTemplatesRequest {} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListOwnedWorkspaceTemplatesResponse { + #[prost(message, repeated, tag = "1")] + pub workspaces: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct WorkspaceInfo { + #[prost(string, tag = "1")] + pub workspace_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub description: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub owner: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub prefix: ::prost::alloc::string::String, + #[prost(string, tag = "6")] + pub hook_ids: ::prost::alloc::string::String, + #[prost(string, tag = "7")] + pub endpoint_ids: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateWorkspaceRequest { + /// Workspace template id + #[prost(string, tag = "1")] + pub workspace_template: ::prost::alloc::string::String, + /// Description of this workspace instance + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateWorkspaceResponse { + #[prost(string, tag = "1")] + pub workspace_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub token: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub access_key: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub secret_key: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DatasetRelations { +pub struct DeleteWorkspaceRequest { #[prost(string, tag = "1")] - pub origin: ::prost::alloc::string::String, - #[prost(string, repeated, tag = "2")] - pub object_children: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + pub workspace_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CollectionRelations { - #[prost(string, tag = "1")] - pub origin: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub dataset_children: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "3")] - pub object_children: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} +pub struct DeleteWorkspaceResponse {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ProjectRelations { +pub struct ClaimWorkspaceRequest { + /// This can only be called by an registered user, + /// that is in possesion of the workspace_id and workspace token + /// It will remove the service account and claim all references "as" the user. #[prost(string, tag = "1")] - pub origin: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub collection_children: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub dataset_children: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "4")] - pub object_children: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + pub workspace_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub token: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetHierarchyResponse { - #[prost(oneof = "get_hierarchy_response::Graph", tags = "1, 2, 3")] - pub graph: ::core::option::Option, -} -/// Nested message and enum types in `GetHierarchyResponse`. -pub mod get_hierarchy_response { - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Graph { - #[prost(message, tag = "1")] - Project(super::ProjectRelations), - #[prost(message, tag = "2")] - Collection(super::CollectionRelations), - #[prost(message, tag = "3")] - Dataset(super::DatasetRelations), - } -} +pub struct ClaimWorkspaceResponse {} /// Generated client implementations. -pub mod relations_service_client { +pub mod workspace_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// RelationsService + /// WorkspaceService /// /// Status: BETA /// - /// Contains all methods to edit and change resource relations + /// Service to manage anonymous "scratch" projects / workspaces #[derive(Debug, Clone)] - pub struct RelationsServiceClient { + pub struct WorkspaceServiceClient { inner: tonic::client::Grpc, } - impl RelationsServiceClient + impl WorkspaceServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -16356,7 +16339,7 @@ pub mod relations_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> RelationsServiceClient> + ) -> WorkspaceServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -16370,7 +16353,7 @@ pub mod relations_service_client { http::Request, >>::Error: Into + Send + Sync, { - RelationsServiceClient::new(InterceptedService::new(inner, interceptor)) + WorkspaceServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -16403,17 +16386,16 @@ pub mod relations_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// ModifyRelation + /// CreatesNewWorkspaceTemplate /// - /// Status: BETA + /// Status: ALPHA /// - /// Add/Remove/Modifies all relation types to / from a resource - /// Works for internal and external relations - pub async fn modify_relations( + /// This will create a new template for workspaces (admin only) + pub async fn create_workspace_template( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -16427,29 +16409,203 @@ pub mod relations_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.RelationsService/ModifyRelations", + "/aruna.api.storage.services.v2.WorkspaceService/CreateWorkspaceTemplate", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.WorkspaceService", + "CreateWorkspaceTemplate", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetWorkspaceTemplatesById + /// + /// Status: ALPHA + /// + /// Gets workspace template by id + pub async fn get_workspace_template( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.WorkspaceService/GetWorkspaceTemplate", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.WorkspaceService", + "GetWorkspaceTemplate", + ), + ); + self.inner.unary(req, path, codec).await + } + /// ListOwnedWorkspaceTemplates + /// + /// Status: ALPHA + /// + /// Lists owned workspace templates + pub async fn list_owned_workspace_templates( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.WorkspaceService/ListOwnedWorkspaceTemplates", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.WorkspaceService", + "ListOwnedWorkspaceTemplates", + ), + ); + self.inner.unary(req, path, codec).await + } + /// DeleteWorkspaceTemplates + /// + /// Status: ALPHA + /// + /// Deletes specified workspace templates + pub async fn delete_workspace_template( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.WorkspaceService/DeleteWorkspaceTemplate", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.WorkspaceService", + "DeleteWorkspaceTemplate", + ), + ); + self.inner.unary(req, path, codec).await + } + /// CreateWorkspace + /// + /// Status: ALPHA + /// + /// Create a personal anonymous workspace + pub async fn create_workspace( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.WorkspaceService/CreateWorkspace", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.WorkspaceService", + "CreateWorkspace", + ), + ); + self.inner.unary(req, path, codec).await + } + /// DeleteWorkspace + /// + /// Status: ALPHA + /// + /// Delete a workspace + pub async fn delete_workspace( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.WorkspaceService/DeleteWorkspace", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.RelationsService", - "ModifyRelations", + "aruna.api.storage.services.v2.WorkspaceService", + "DeleteWorkspace", ), ); self.inner.unary(req, path, codec).await } - /// GetHierachy + /// DeleteWorkspace /// - /// Status: BETA + /// Status: ALPHA /// - /// Gets all downstream hierarchy relations from a resource - /// results in a tree structure - pub async fn get_hierarchy( + /// Claims an anonymous workspace, and transfers the owner to a regular user account. + pub async fn claim_workspace( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -16463,14 +16619,14 @@ pub mod relations_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.RelationsService/GetHierarchy", + "/aruna.api.storage.services.v2.WorkspaceService/ClaimWorkspace", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.RelationsService", - "GetHierarchy", + "aruna.api.storage.services.v2.WorkspaceService", + "ClaimWorkspace", ), ); self.inner.unary(req, path, codec).await @@ -16478,46 +16634,104 @@ pub mod relations_service_client { } } /// Generated server implementations. -pub mod relations_service_server { +pub mod workspace_service_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with RelationsServiceServer. + /// Generated trait containing gRPC methods that should be implemented for use with WorkspaceServiceServer. #[async_trait] - pub trait RelationsService: Send + Sync + 'static { - /// ModifyRelation + pub trait WorkspaceService: Send + Sync + 'static { + /// CreatesNewWorkspaceTemplate /// - /// Status: BETA + /// Status: ALPHA /// - /// Add/Remove/Modifies all relation types to / from a resource - /// Works for internal and external relations - async fn modify_relations( + /// This will create a new template for workspaces (admin only) + async fn create_workspace_template( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetHierachy + /// GetWorkspaceTemplatesById /// - /// Status: BETA + /// Status: ALPHA /// - /// Gets all downstream hierarchy relations from a resource - /// results in a tree structure - async fn get_hierarchy( + /// Gets workspace template by id + async fn get_workspace_template( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, + tonic::Status, + >; + /// ListOwnedWorkspaceTemplates + /// + /// Status: ALPHA + /// + /// Lists owned workspace templates + async fn list_owned_workspace_templates( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteWorkspaceTemplates + /// + /// Status: ALPHA + /// + /// Deletes specified workspace templates + async fn delete_workspace_template( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// CreateWorkspace + /// + /// Status: ALPHA + /// + /// Create a personal anonymous workspace + async fn create_workspace( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteWorkspace + /// + /// Status: ALPHA + /// + /// Delete a workspace + async fn delete_workspace( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DeleteWorkspace + /// + /// Status: ALPHA + /// + /// Claims an anonymous workspace, and transfers the owner to a regular user account. + async fn claim_workspace( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, tonic::Status, >; } - /// RelationsService + /// WorkspaceService /// /// Status: BETA /// - /// Contains all methods to edit and change resource relations + /// Service to manage anonymous "scratch" projects / workspaces #[derive(Debug)] - pub struct RelationsServiceServer { + pub struct WorkspaceServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -16525,7 +16739,7 @@ pub mod relations_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl RelationsServiceServer { + impl WorkspaceServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -16577,9 +16791,9 @@ pub mod relations_service_server { self } } - impl tonic::codegen::Service> for RelationsServiceServer + impl tonic::codegen::Service> for WorkspaceServiceServer where - T: RelationsService, + T: WorkspaceService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -16595,25 +16809,187 @@ pub mod relations_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.RelationsService/ModifyRelations" => { + "/aruna.api.storage.services.v2.WorkspaceService/CreateWorkspaceTemplate" => { + #[allow(non_camel_case_types)] + struct CreateWorkspaceTemplateSvc(pub Arc); + impl< + T: WorkspaceService, + > tonic::server::UnaryService + for CreateWorkspaceTemplateSvc { + type Response = super::CreateWorkspaceTemplateResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::CreateWorkspaceTemplateRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::create_workspace_template( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateWorkspaceTemplateSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.WorkspaceService/GetWorkspaceTemplate" => { + #[allow(non_camel_case_types)] + struct GetWorkspaceTemplateSvc(pub Arc); + impl< + T: WorkspaceService, + > tonic::server::UnaryService + for GetWorkspaceTemplateSvc { + type Response = super::GetWorkspaceTemplateResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_workspace_template( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetWorkspaceTemplateSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.WorkspaceService/ListOwnedWorkspaceTemplates" => { + #[allow(non_camel_case_types)] + struct ListOwnedWorkspaceTemplatesSvc( + pub Arc, + ); + impl< + T: WorkspaceService, + > tonic::server::UnaryService< + super::ListOwnedWorkspaceTemplatesRequest, + > for ListOwnedWorkspaceTemplatesSvc { + type Response = super::ListOwnedWorkspaceTemplatesResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::ListOwnedWorkspaceTemplatesRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::list_owned_workspace_templates( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ListOwnedWorkspaceTemplatesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.WorkspaceService/DeleteWorkspaceTemplate" => { #[allow(non_camel_case_types)] - struct ModifyRelationsSvc(pub Arc); + struct DeleteWorkspaceTemplateSvc(pub Arc); impl< - T: RelationsService, - > tonic::server::UnaryService - for ModifyRelationsSvc { - type Response = super::ModifyRelationsResponse; + T: WorkspaceService, + > tonic::server::UnaryService + for DeleteWorkspaceTemplateSvc { + type Response = super::DeleteWorkspaceTemplateResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::DeleteWorkspaceTemplateRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::modify_relations(&inner, request) + ::delete_workspace_template( + &inner, + request, + ) .await }; Box::pin(fut) @@ -16626,7 +17002,7 @@ pub mod relations_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ModifyRelationsSvc(inner); + let method = DeleteWorkspaceTemplateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -16642,25 +17018,25 @@ pub mod relations_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.RelationsService/GetHierarchy" => { + "/aruna.api.storage.services.v2.WorkspaceService/CreateWorkspace" => { #[allow(non_camel_case_types)] - struct GetHierarchySvc(pub Arc); + struct CreateWorkspaceSvc(pub Arc); impl< - T: RelationsService, - > tonic::server::UnaryService - for GetHierarchySvc { - type Response = super::GetHierarchyResponse; + T: WorkspaceService, + > tonic::server::UnaryService + for CreateWorkspaceSvc { + type Response = super::CreateWorkspaceResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_hierarchy(&inner, request) + ::create_workspace(&inner, request) .await }; Box::pin(fut) @@ -16673,7 +17049,101 @@ pub mod relations_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetHierarchySvc(inner); + let method = CreateWorkspaceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.WorkspaceService/DeleteWorkspace" => { + #[allow(non_camel_case_types)] + struct DeleteWorkspaceSvc(pub Arc); + impl< + T: WorkspaceService, + > tonic::server::UnaryService + for DeleteWorkspaceSvc { + type Response = super::DeleteWorkspaceResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::delete_workspace(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeleteWorkspaceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/aruna.api.storage.services.v2.WorkspaceService/ClaimWorkspace" => { + #[allow(non_camel_case_types)] + struct ClaimWorkspaceSvc(pub Arc); + impl< + T: WorkspaceService, + > tonic::server::UnaryService + for ClaimWorkspaceSvc { + type Response = super::ClaimWorkspaceResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::claim_workspace(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ClaimWorkspaceSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -16704,7 +17174,7 @@ pub mod relations_service_server { } } } - impl Clone for RelationsServiceServer { + impl Clone for WorkspaceServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -16716,174 +17186,111 @@ pub mod relations_service_server { } } } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for RelationsServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.RelationsService"; - } -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateEndpointRequest { - /// Endpoint name - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// Endpoint type - #[prost(enumeration = "super::super::models::v2::EndpointVariant", tag = "2")] - pub ep_variant: i32, - /// Is this endpoint public - #[prost(bool, tag = "3")] - pub is_public: bool, - /// required public_key - #[prost(string, tag = "4")] - pub pubkey: ::prost::alloc::string::String, - /// List of EndpointHostConfigs - #[prost(message, repeated, tag = "5")] - pub host_configs: ::prost::alloc::vec::Vec< - super::super::models::v2::EndpointHostConfig, - >, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateEndpointResponse { - /// Overview of the created endpoint - #[prost(message, optional, tag = "1")] - pub endpoint: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FullSyncEndpointRequest {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FullSyncEndpointResponse { - #[prost(oneof = "full_sync_endpoint_response::Target", tags = "1, 2, 3")] - pub target: ::core::option::Option, -} -/// Nested message and enum types in `FullSyncEndpointResponse`. -pub mod full_sync_endpoint_response { - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Target { - #[prost(message, tag = "1")] - GenericResource(super::super::super::models::v2::GenericResource), - #[prost(message, tag = "2")] - User(super::super::super::models::v2::User), - #[prost(message, tag = "3")] - Pubkey(super::super::super::models::v2::Pubkey), - } -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetEndpointRequest { - /// Either endpoint_name or id - #[prost(oneof = "get_endpoint_request::Endpoint", tags = "1, 2")] - pub endpoint: ::core::option::Option, -} -/// Nested message and enum types in `GetEndpointRequest`. -pub mod get_endpoint_request { - /// Either endpoint_name or id - #[derive(serde::Deserialize, serde::Serialize)] - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Endpoint { - /// The name of the endpoint - #[prost(string, tag = "1")] - EndpointName(::prost::alloc::string::String), - /// Id of the endpoint - #[prost(string, tag = "2")] - EndpointId(::prost::alloc::string::String), - } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for WorkspaceServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.WorkspaceService"; + } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetEndpointResponse { - /// Overview of the requested endpoint - #[prost(message, optional, tag = "1")] - pub endpoint: ::core::option::Option, +pub struct ModifyRelationsRequest { + #[prost(string, tag = "1")] + pub resource_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub add_relations: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub remove_relations: ::prost::alloc::vec::Vec, } -/// Requests all endpoints #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetEndpointsRequest {} +pub struct ModifyRelationsResponse {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetEndpointsResponse { - /// List of endpoints - #[prost(message, repeated, tag = "1")] - pub endpoints: ::prost::alloc::vec::Vec, +pub struct GetHierarchyRequest { + #[prost(string, tag = "1")] + pub resource_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteEndpointRequest { - /// Endpoint_id to delete +pub struct DatasetRelations { #[prost(string, tag = "1")] - pub endpoint_id: ::prost::alloc::string::String, + pub origin: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "2")] + pub object_children: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteEndpointResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDefaultEndpointRequest {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetDefaultEndpointResponse { - /// Default endpoint of the server instance - #[prost(message, optional, tag = "1")] - pub endpoint: ::core::option::Option, +pub struct CollectionRelations { + #[prost(string, tag = "1")] + pub origin: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub dataset_children: ::prost::alloc::vec::Vec, + #[prost(string, repeated, tag = "3")] + pub object_children: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct SetEndpointStatusRequest { +pub struct ProjectRelations { #[prost(string, tag = "1")] - pub endpoint_id: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::ComponentStatus", tag = "2")] - pub status: i32, + pub origin: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub collection_children: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub dataset_children: ::prost::alloc::vec::Vec, + #[prost(string, repeated, tag = "4")] + pub object_children: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct SetEndpointStatusResponse { - #[prost(message, optional, tag = "1")] - pub endpoint: ::core::option::Option, +pub struct GetHierarchyResponse { + #[prost(oneof = "get_hierarchy_response::Graph", tags = "1, 2, 3")] + pub graph: ::core::option::Option, +} +/// Nested message and enum types in `GetHierarchyResponse`. +pub mod get_hierarchy_response { + #[derive(serde::Deserialize, serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Graph { + #[prost(message, tag = "1")] + Project(super::ProjectRelations), + #[prost(message, tag = "2")] + Collection(super::CollectionRelations), + #[prost(message, tag = "3")] + Dataset(super::DatasetRelations), + } } /// Generated client implementations. -pub mod endpoint_service_client { +pub mod relations_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// EndpointService + /// RelationsService /// /// Status: BETA /// - /// Contains all methods that get/create or update Endpoint (Dataproxies) and associated resources + /// Contains all methods to edit and change resource relations #[derive(Debug, Clone)] - pub struct EndpointServiceClient { + pub struct RelationsServiceClient { inner: tonic::client::Grpc, } - impl EndpointServiceClient + impl RelationsServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -16901,7 +17308,7 @@ pub mod endpoint_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> EndpointServiceClient> + ) -> RelationsServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -16915,7 +17322,7 @@ pub mod endpoint_service_client { http::Request, >>::Error: Into + Send + Sync, { - EndpointServiceClient::new(InterceptedService::new(inner, interceptor)) + RelationsServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -16938,203 +17345,27 @@ pub mod endpoint_service_client { #[must_use] pub fn max_decoding_message_size(mut self, limit: usize) -> Self { self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// CreateEndpoint - /// - /// Status: BETA - /// - /// Registers a new Endpoint (Aruna DataProxy) to the server - /// requires admin permissions - pub async fn create_endpoint( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.EndpointService/CreateEndpoint", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.EndpointService", - "CreateEndpoint", - ), - ); - self.inner.unary(req, path, codec).await - } - /// FullSyncEndpoint - /// - /// Status: BETA - /// - /// Requests a full sync of all endpoint related data - pub async fn full_sync_endpoint( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response>, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.EndpointService/FullSyncEndpoint", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.EndpointService", - "FullSyncEndpoint", - ), - ); - self.inner.server_streaming(req, path, codec).await - } - /// SetEndpointStatus - /// - /// Status: BETA - /// - /// This request sets the status of a specific Endpoint - pub async fn set_endpoint_status( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.EndpointService/SetEndpointStatus", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.EndpointService", - "SetEndpointStatus", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetEndpoint - /// - /// Status: BETA - /// - /// Gets an specific endpoint by ID or Name - pub async fn get_endpoint( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.EndpointService/GetEndpoint", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.EndpointService", - "GetEndpoint", - ), - ); - self.inner.unary(req, path, codec).await + self } - /// GetEndpoints - /// - /// Status: BETA + /// Limits the maximum size of an encoded message. /// - /// Gets all available endpoints - pub async fn get_endpoints( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.EndpointService/GetEndpoints", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.EndpointService", - "GetEndpoints", - ), - ); - self.inner.unary(req, path, codec).await + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self } - /// DeleteEndpoint + /// ModifyRelation /// /// Status: BETA /// - /// Deletes a specific endpoint by id - /// This needs admin permissions - pub async fn delete_endpoint( + /// Add/Remove/Modifies all relation types to / from a resource + /// Works for internal and external relations + pub async fn modify_relations( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -17148,29 +17379,29 @@ pub mod endpoint_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.EndpointService/DeleteEndpoint", + "/aruna.api.storage.services.v2.RelationsService/ModifyRelations", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.EndpointService", - "DeleteEndpoint", + "aruna.api.storage.services.v2.RelationsService", + "ModifyRelations", ), ); self.inner.unary(req, path, codec).await } - /// GetDefaultEndpoint + /// GetHierachy /// /// Status: BETA /// - /// This request returns the default endpoint for the current aruna_server - /// It may produce different results depending on the used server - pub async fn get_default_endpoint( + /// Gets all downstream hierarchy relations from a resource + /// results in a tree structure + pub async fn get_hierarchy( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -17184,14 +17415,14 @@ pub mod endpoint_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.EndpointService/GetDefaultEndpoint", + "/aruna.api.storage.services.v2.RelationsService/GetHierarchy", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.EndpointService", - "GetDefaultEndpoint", + "aruna.api.storage.services.v2.RelationsService", + "GetHierarchy", ), ); self.inner.unary(req, path, codec).await @@ -17199,447 +17430,142 @@ pub mod endpoint_service_client { } } /// Generated server implementations. -pub mod endpoint_service_server { +pub mod relations_service_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with EndpointServiceServer. + /// Generated trait containing gRPC methods that should be implemented for use with RelationsServiceServer. #[async_trait] - pub trait EndpointService: Send + Sync + 'static { - /// CreateEndpoint - /// - /// Status: BETA - /// - /// Registers a new Endpoint (Aruna DataProxy) to the server - /// requires admin permissions - async fn create_endpoint( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Server streaming response type for the FullSyncEndpoint method. - type FullSyncEndpointStream: tonic::codegen::tokio_stream::Stream< - Item = std::result::Result< - super::FullSyncEndpointResponse, - tonic::Status, - >, - > - + Send - + 'static; - /// FullSyncEndpoint - /// - /// Status: BETA - /// - /// Requests a full sync of all endpoint related data - async fn full_sync_endpoint( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// SetEndpointStatus - /// - /// Status: BETA - /// - /// This request sets the status of a specific Endpoint - async fn set_endpoint_status( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetEndpoint - /// - /// Status: BETA - /// - /// Gets an specific endpoint by ID or Name - async fn get_endpoint( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetEndpoints - /// - /// Status: BETA - /// - /// Gets all available endpoints - async fn get_endpoints( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteEndpoint + pub trait RelationsService: Send + Sync + 'static { + /// ModifyRelation /// /// Status: BETA /// - /// Deletes a specific endpoint by id - /// This needs admin permissions - async fn delete_endpoint( + /// Add/Remove/Modifies all relation types to / from a resource + /// Works for internal and external relations + async fn modify_relations( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// GetDefaultEndpoint + /// GetHierachy /// /// Status: BETA /// - /// This request returns the default endpoint for the current aruna_server - /// It may produce different results depending on the used server - async fn get_default_endpoint( + /// Gets all downstream hierarchy relations from a resource + /// results in a tree structure + async fn get_hierarchy( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// EndpointService - /// - /// Status: BETA - /// - /// Contains all methods that get/create or update Endpoint (Dataproxies) and associated resources - #[derive(Debug)] - pub struct EndpointServiceServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl EndpointServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for EndpointServiceServer - where - T: EndpointService, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) + /// RelationsService + /// + /// Status: BETA + /// + /// Contains all methods to edit and change resource relations + #[derive(Debug)] + pub struct RelationsServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl RelationsServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/aruna.api.storage.services.v2.EndpointService/CreateEndpoint" => { - #[allow(non_camel_case_types)] - struct CreateEndpointSvc(pub Arc); - impl< - T: EndpointService, - > tonic::server::UnaryService - for CreateEndpointSvc { - type Response = super::CreateEndpointResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::create_endpoint(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = CreateEndpointSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.EndpointService/FullSyncEndpoint" => { - #[allow(non_camel_case_types)] - struct FullSyncEndpointSvc(pub Arc); - impl< - T: EndpointService, - > tonic::server::ServerStreamingService< - super::FullSyncEndpointRequest, - > for FullSyncEndpointSvc { - type Response = super::FullSyncEndpointResponse; - type ResponseStream = T::FullSyncEndpointStream; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::full_sync_endpoint(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = FullSyncEndpointSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.server_streaming(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.EndpointService/SetEndpointStatus" => { - #[allow(non_camel_case_types)] - struct SetEndpointStatusSvc(pub Arc); - impl< - T: EndpointService, - > tonic::server::UnaryService - for SetEndpointStatusSvc { - type Response = super::SetEndpointStatusResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::set_endpoint_status(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = SetEndpointStatusSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.EndpointService/GetEndpoint" => { - #[allow(non_camel_case_types)] - struct GetEndpointSvc(pub Arc); - impl< - T: EndpointService, - > tonic::server::UnaryService - for GetEndpointSvc { - type Response = super::GetEndpointResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_endpoint(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetEndpointSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.EndpointService/GetEndpoints" => { - #[allow(non_camel_case_types)] - struct GetEndpointsSvc(pub Arc); - impl< - T: EndpointService, - > tonic::server::UnaryService - for GetEndpointsSvc { - type Response = super::GetEndpointsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::get_endpoints(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetEndpointsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/aruna.api.storage.services.v2.EndpointService/DeleteEndpoint" => { + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for RelationsServiceServer + where + T: RelationsService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/aruna.api.storage.services.v2.RelationsService/ModifyRelations" => { #[allow(non_camel_case_types)] - struct DeleteEndpointSvc(pub Arc); + struct ModifyRelationsSvc(pub Arc); impl< - T: EndpointService, - > tonic::server::UnaryService - for DeleteEndpointSvc { - type Response = super::DeleteEndpointResponse; + T: RelationsService, + > tonic::server::UnaryService + for ModifyRelationsSvc { + type Response = super::ModifyRelationsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_endpoint(&inner, request) + ::modify_relations(&inner, request) .await }; Box::pin(fut) @@ -17652,7 +17578,7 @@ pub mod endpoint_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteEndpointSvc(inner); + let method = ModifyRelationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -17668,28 +17594,25 @@ pub mod endpoint_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.EndpointService/GetDefaultEndpoint" => { + "/aruna.api.storage.services.v2.RelationsService/GetHierarchy" => { #[allow(non_camel_case_types)] - struct GetDefaultEndpointSvc(pub Arc); + struct GetHierarchySvc(pub Arc); impl< - T: EndpointService, - > tonic::server::UnaryService - for GetDefaultEndpointSvc { - type Response = super::GetDefaultEndpointResponse; + T: RelationsService, + > tonic::server::UnaryService + for GetHierarchySvc { + type Response = super::GetHierarchyResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_default_endpoint( - &inner, - request, - ) + ::get_hierarchy(&inner, request) .await }; Box::pin(fut) @@ -17702,7 +17625,7 @@ pub mod endpoint_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetDefaultEndpointSvc(inner); + let method = GetHierarchySvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -17733,7 +17656,7 @@ pub mod endpoint_service_server { } } } - impl Clone for EndpointServiceServer { + impl Clone for RelationsServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -17745,7 +17668,7 @@ pub mod endpoint_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -17755,250 +17678,149 @@ pub mod endpoint_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for EndpointServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.EndpointService"; + impl tonic::server::NamedService for RelationsServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.RelationsService"; } } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateProjectRequest { - /// Project name +pub struct CreateRuleRequest { #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// title - #[prost(string, tag = "9")] - pub title: ::prost::alloc::string::String, - /// Description + pub rule: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, - /// Project specific labels / hooks - #[prost(message, repeated, tag = "3")] - pub key_values: ::prost::alloc::vec::Vec, - /// Internal / External relations (URLs / IDs from external sources) - #[prost(message, repeated, tag = "4")] - pub relations: ::prost::alloc::vec::Vec, - /// DataClass - #[prost(enumeration = "super::super::models::v2::DataClass", tag = "5")] - pub data_class: i32, - /// Preferred endpoint - #[prost(string, tag = "6")] - pub preferred_endpoint: ::prost::alloc::string::String, - /// - #[prost(string, tag = "7")] - pub metadata_license_tag: ::prost::alloc::string::String, - #[prost(string, tag = "8")] - pub default_data_license_tag: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "10")] - pub authors: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateProjectResponse { - /// The freshly created project - #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetProjectRequest { - /// The id of the project to get - #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetProjectResponse { - /// Overview of the projectroject - #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetProjectsRequest { - /// optional filter for specific ids - #[prost(string, repeated, tag = "1")] - pub project_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetProjectsResponse { - /// Overview of the projects - #[prost(message, repeated, tag = "1")] - pub projects: ::prost::alloc::vec::Vec, + #[prost(bool, tag = "3")] + pub public: bool, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteProjectRequest { - /// The id of the project to destroy +pub struct CreateRuleResponse { #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, + pub id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeleteProjectResponse {} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectNameRequest { +pub struct GetRuleRequest { #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectNameResponse { - #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, + pub id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectDescriptionRequest { +pub struct Rule { #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, + pub id: ::prost::alloc::string::String, #[prost(string, tag = "2")] + pub rule: ::prost::alloc::string::String, + #[prost(string, tag = "3")] pub description: ::prost::alloc::string::String, + #[prost(bool, tag = "4")] + pub public: bool, + #[prost(string, tag = "5")] + pub owner: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectDescriptionResponse { - #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectKeyValuesRequest { - #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub add_key_values: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub remove_key_values: ::prost::alloc::vec::Vec, -} -#[derive(serde::Deserialize, serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectKeyValuesResponse { +pub struct GetRuleResponse { #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, + pub rule: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectDataClassRequest { - #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, - #[prost(enumeration = "super::super::models::v2::DataClass", tag = "2")] - pub data_class: i32, -} +pub struct ListRuleRequest {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectDataClassResponse { - #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, +pub struct ListRuleResponse { + #[prost(message, repeated, tag = "1")] + pub rules: ::prost::alloc::vec::Vec, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ArchiveProjectRequest { +pub struct UpdateRuleRequest { #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, + pub id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub rule: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub description: ::prost::alloc::string::String, + #[prost(bool, tag = "4")] + pub public: bool, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ArchiveProjectResponse { - /// This project will be returned via an Persistent Identifier! Updates will be impossible +pub struct UpdateRuleResponse { #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, + pub rule: ::core::option::Option, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectLicensesRequest { +pub struct DeleteRuleRequest { #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub metadata_license_tag: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub default_data_license_tag: ::prost::alloc::string::String, + pub id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectLicensesResponse { - #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, -} +pub struct DeleteRuleResponse {} #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectTitleRequest { - /// Project id +pub struct CreateRuleBindingRequest { #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, - /// New title + pub rule_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] - pub title: ::prost::alloc::string::String, + pub object_id: ::prost::alloc::string::String, + #[prost(bool, tag = "3")] + pub cascading: bool, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectTitleResponse { - /// The updated object - #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, +pub struct CreateRuleBindingResponse { + #[prost(string, tag = "1")] + pub rule_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub object_id: ::prost::alloc::string::String, + #[prost(bool, tag = "3")] + pub cascading: bool, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectAuthorsRequest { - /// Project id +pub struct DeleteRuleBindingRequest { #[prost(string, tag = "1")] - pub project_id: ::prost::alloc::string::String, - /// Add authors - #[prost(message, repeated, tag = "2")] - pub add_authors: ::prost::alloc::vec::Vec, - /// Remove authors - #[prost(message, repeated, tag = "3")] - pub remove_authors: ::prost::alloc::vec::Vec, + pub rule_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub object_id: ::prost::alloc::string::String, } #[derive(serde::Deserialize, serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateProjectAuthorsResponse { - /// The updated project - #[prost(message, optional, tag = "1")] - pub project: ::core::option::Option, -} +pub struct DeleteRuleBindingResponse {} /// Generated client implementations. -pub mod project_service_client { +pub mod rules_service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// ProjectService + /// RulesService /// /// Status: BETA /// - /// Contains all methods that get/create or update Projects and associated resources + /// Contains all methods to edit and change rules #[derive(Debug, Clone)] - pub struct ProjectServiceClient { + pub struct RulesServiceClient { inner: tonic::client::Grpc, } - impl ProjectServiceClient + impl RulesServiceClient where T: tonic::client::GrpcService, T::Error: Into, @@ -18016,7 +17838,7 @@ pub mod project_service_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> ProjectServiceClient> + ) -> RulesServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -18030,7 +17852,7 @@ pub mod project_service_client { http::Request, >>::Error: Into + Send + Sync, { - ProjectServiceClient::new(InterceptedService::new(inner, interceptor)) + RulesServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -18063,191 +17885,16 @@ pub mod project_service_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// CreateProject - /// - /// Status: BETA - /// - /// Creates a new project. All subsequent resources are part of a project. - pub async fn create_project( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/CreateProject", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "CreateProject", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetProject - /// - /// Status: BETA - /// - /// Requests a project (by id) - pub async fn get_project( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/GetProject", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "GetProject", - ), - ); - self.inner.unary(req, path, codec).await - } - /// GetProjects - /// - /// Status: BETA - /// - /// Admin request to get all projects - pub async fn get_projects( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/GetProjects", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "GetProjects", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DeleteProject - /// - /// Status: BETA - /// - /// Deletes the project and all its associated data. Must be empty! - pub async fn delete_project( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/DeleteProject", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "DeleteProject", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateProjectName - /// - /// Status: BETA - /// - /// Updates the project name. Caveat! Will rename the "s3 bucket" for data proxies! - pub async fn update_project_name( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectName", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "UpdateProjectName", - ), - ); - self.inner.unary(req, path, codec).await - } - /// UpdateProjectDescription + /// CreateRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the project name. - pub async fn update_project_description( + /// Create a new rule + pub async fn create_rule( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -18261,28 +17908,28 @@ pub mod project_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectDescription", + "/aruna.api.storage.services.v2.RulesService/CreateRule", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "UpdateProjectDescription", + "aruna.api.storage.services.v2.RulesService", + "CreateRule", ), ); self.inner.unary(req, path, codec).await } - /// UpdateProjectKeyValues + /// GetRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the project key values. - pub async fn update_project_key_values( + /// Gets an existing rule + pub async fn get_rule( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -18296,28 +17943,28 @@ pub mod project_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectKeyValues", + "/aruna.api.storage.services.v2.RulesService/GetRule", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "UpdateProjectKeyValues", + "aruna.api.storage.services.v2.RulesService", + "GetRule", ), ); self.inner.unary(req, path, codec).await } - /// UpdateProjectDataClass + /// ListRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the project name. All (meta) data will be overwritten. - pub async fn update_project_data_class( + /// Lists rules -> Owned and public rules + pub async fn list_rule( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -18331,28 +17978,28 @@ pub mod project_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectDataClass", + "/aruna.api.storage.services.v2.RulesService/ListRule", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "UpdateProjectDataClass", + "aruna.api.storage.services.v2.RulesService", + "ListRule", ), ); self.inner.unary(req, path, codec).await } - /// UpdateLicense + /// UpdateRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the project license. All (meta) data will be overwritten. - pub async fn update_project_licenses( + /// Updates an existing rule + pub async fn update_rule( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -18366,28 +18013,28 @@ pub mod project_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectLicenses", + "/aruna.api.storage.services.v2.RulesService/UpdateRule", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "UpdateProjectLicenses", + "aruna.api.storage.services.v2.RulesService", + "UpdateRule", ), ); self.inner.unary(req, path, codec).await } - /// ArchiveProjectRequest + /// DeleteRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Archives the full project, rendering all downstream relations immutable - pub async fn archive_project( + /// Deletes an existing rule + pub async fn delete_rule( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -18401,28 +18048,28 @@ pub mod project_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/ArchiveProject", + "/aruna.api.storage.services.v2.RulesService/DeleteRule", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "ArchiveProject", + "aruna.api.storage.services.v2.RulesService", + "DeleteRule", ), ); self.inner.unary(req, path, codec).await } - /// UpdateTitle + /// CreateRuleBinding /// /// Status: ALPHA /// - /// This method updates the title of a project - pub async fn update_project_title( + /// Associates a rule with an object, optionally cascading the rule to all children + pub async fn create_rule_binding( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -18436,28 +18083,28 @@ pub mod project_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectTitle", + "/aruna.api.storage.services.v2.RulesService/CreateRuleBinding", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "UpdateProjectTitle", + "aruna.api.storage.services.v2.RulesService", + "CreateRuleBinding", ), ); self.inner.unary(req, path, codec).await } - /// UpdateAuthors + /// DeleteRuleBinding /// /// Status: ALPHA /// - /// This method updates the authors of an object - pub async fn update_project_authors( + /// Disassociates a rule from an object + pub async fn delete_rule_binding( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -18471,14 +18118,14 @@ pub mod project_service_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectAuthors", + "/aruna.api.storage.services.v2.RulesService/DeleteRuleBinding", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "aruna.api.storage.services.v2.ProjectService", - "UpdateProjectAuthors", + "aruna.api.storage.services.v2.RulesService", + "DeleteRuleBinding", ), ); self.inner.unary(req, path, codec).await @@ -18486,164 +18133,101 @@ pub mod project_service_client { } } /// Generated server implementations. -pub mod project_service_server { +pub mod rules_service_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with ProjectServiceServer. + /// Generated trait containing gRPC methods that should be implemented for use with RulesServiceServer. #[async_trait] - pub trait ProjectService: Send + Sync + 'static { - /// CreateProject - /// - /// Status: BETA - /// - /// Creates a new project. All subsequent resources are part of a project. - async fn create_project( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetProject - /// - /// Status: BETA - /// - /// Requests a project (by id) - async fn get_project( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// GetProjects - /// - /// Status: BETA - /// - /// Admin request to get all projects - async fn get_projects( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DeleteProject - /// - /// Status: BETA - /// - /// Deletes the project and all its associated data. Must be empty! - async fn delete_project( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateProjectName - /// - /// Status: BETA - /// - /// Updates the project name. Caveat! Will rename the "s3 bucket" for data proxies! - async fn update_project_name( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateProjectDescription + pub trait RulesService: Send + Sync + 'static { + /// CreateRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the project name. - async fn update_project_description( + /// Create a new rule + async fn create_rule( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateProjectKeyValues + /// GetRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the project key values. - async fn update_project_key_values( + /// Gets an existing rule + async fn get_rule( &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateProjectDataClass + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// ListRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the project name. All (meta) data will be overwritten. - async fn update_project_data_class( + /// Lists rules -> Owned and public rules + async fn list_rule( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateLicense + /// UpdateRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Updates the project license. All (meta) data will be overwritten. - async fn update_project_licenses( + /// Updates an existing rule + async fn update_rule( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ArchiveProjectRequest + /// DeleteRule /// - /// Status: BETA + /// Status: ALPHA /// - /// Archives the full project, rendering all downstream relations immutable - async fn archive_project( + /// Deletes an existing rule + async fn delete_rule( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateTitle + /// CreateRuleBinding /// /// Status: ALPHA /// - /// This method updates the title of a project - async fn update_project_title( + /// Associates a rule with an object, optionally cascading the rule to all children + async fn create_rule_binding( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateAuthors + /// DeleteRuleBinding /// /// Status: ALPHA /// - /// This method updates the authors of an object - async fn update_project_authors( + /// Disassociates a rule from an object + async fn delete_rule_binding( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// ProjectService + /// RulesService /// /// Status: BETA /// - /// Contains all methods that get/create or update Projects and associated resources + /// Contains all methods to edit and change rules #[derive(Debug)] - pub struct ProjectServiceServer { + pub struct RulesServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -18651,7 +18235,7 @@ pub mod project_service_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl ProjectServiceServer { + impl RulesServiceServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -18703,9 +18287,9 @@ pub mod project_service_server { self } } - impl tonic::codegen::Service> for ProjectServiceServer + impl tonic::codegen::Service> for RulesServiceServer where - T: ProjectService, + T: RulesService, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -18721,25 +18305,25 @@ pub mod project_service_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/aruna.api.storage.services.v2.ProjectService/CreateProject" => { + "/aruna.api.storage.services.v2.RulesService/CreateRule" => { #[allow(non_camel_case_types)] - struct CreateProjectSvc(pub Arc); + struct CreateRuleSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for CreateProjectSvc { - type Response = super::CreateProjectResponse; + T: RulesService, + > tonic::server::UnaryService + for CreateRuleSvc { + type Response = super::CreateRuleResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_project(&inner, request).await + ::create_rule(&inner, request).await }; Box::pin(fut) } @@ -18751,7 +18335,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateProjectSvc(inner); + let method = CreateRuleSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -18767,25 +18351,25 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/GetProject" => { + "/aruna.api.storage.services.v2.RulesService/GetRule" => { #[allow(non_camel_case_types)] - struct GetProjectSvc(pub Arc); + struct GetRuleSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for GetProjectSvc { - type Response = super::GetProjectResponse; + T: RulesService, + > tonic::server::UnaryService + for GetRuleSvc { + type Response = super::GetRuleResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_project(&inner, request).await + ::get_rule(&inner, request).await }; Box::pin(fut) } @@ -18797,7 +18381,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetProjectSvc(inner); + let method = GetRuleSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -18813,25 +18397,25 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/GetProjects" => { + "/aruna.api.storage.services.v2.RulesService/ListRule" => { #[allow(non_camel_case_types)] - struct GetProjectsSvc(pub Arc); + struct ListRuleSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for GetProjectsSvc { - type Response = super::GetProjectsResponse; + T: RulesService, + > tonic::server::UnaryService + for ListRuleSvc { + type Response = super::ListRuleResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_projects(&inner, request).await + ::list_rule(&inner, request).await }; Box::pin(fut) } @@ -18843,7 +18427,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = GetProjectsSvc(inner); + let method = ListRuleSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -18859,25 +18443,25 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/DeleteProject" => { + "/aruna.api.storage.services.v2.RulesService/UpdateRule" => { #[allow(non_camel_case_types)] - struct DeleteProjectSvc(pub Arc); + struct UpdateRuleSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for DeleteProjectSvc { - type Response = super::DeleteProjectResponse; + T: RulesService, + > tonic::server::UnaryService + for UpdateRuleSvc { + type Response = super::UpdateRuleResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delete_project(&inner, request).await + ::update_rule(&inner, request).await }; Box::pin(fut) } @@ -18889,7 +18473,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DeleteProjectSvc(inner); + let method = UpdateRuleSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -18905,26 +18489,25 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectName" => { + "/aruna.api.storage.services.v2.RulesService/DeleteRule" => { #[allow(non_camel_case_types)] - struct UpdateProjectNameSvc(pub Arc); + struct DeleteRuleSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for UpdateProjectNameSvc { - type Response = super::UpdateProjectNameResponse; + T: RulesService, + > tonic::server::UnaryService + for DeleteRuleSvc { + type Response = super::DeleteRuleResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_project_name(&inner, request) - .await + ::delete_rule(&inner, request).await }; Box::pin(fut) } @@ -18936,7 +18519,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateProjectNameSvc(inner); + let method = DeleteRuleSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -18952,30 +18535,25 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectDescription" => { + "/aruna.api.storage.services.v2.RulesService/CreateRuleBinding" => { #[allow(non_camel_case_types)] - struct UpdateProjectDescriptionSvc(pub Arc); + struct CreateRuleBindingSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for UpdateProjectDescriptionSvc { - type Response = super::UpdateProjectDescriptionResponse; + T: RulesService, + > tonic::server::UnaryService + for CreateRuleBindingSvc { + type Response = super::CreateRuleBindingResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::UpdateProjectDescriptionRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_project_description( - &inner, - request, - ) + ::create_rule_binding(&inner, request) .await }; Box::pin(fut) @@ -18988,7 +18566,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateProjectDescriptionSvc(inner); + let method = CreateRuleBindingSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -19004,28 +18582,25 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectKeyValues" => { + "/aruna.api.storage.services.v2.RulesService/DeleteRuleBinding" => { #[allow(non_camel_case_types)] - struct UpdateProjectKeyValuesSvc(pub Arc); + struct DeleteRuleBindingSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for UpdateProjectKeyValuesSvc { - type Response = super::UpdateProjectKeyValuesResponse; + T: RulesService, + > tonic::server::UnaryService + for DeleteRuleBindingSvc { + type Response = super::DeleteRuleBindingResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_project_key_values( - &inner, - request, - ) + ::delete_rule_binding(&inner, request) .await }; Box::pin(fut) @@ -19038,7 +18613,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateProjectKeyValuesSvc(inner); + let method = DeleteRuleBindingSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -19054,78 +18629,504 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectDataClass" => { - #[allow(non_camel_case_types)] - struct UpdateProjectDataClassSvc(pub Arc); - impl< - T: ProjectService, - > tonic::server::UnaryService - for UpdateProjectDataClassSvc { - type Response = super::UpdateProjectDataClassResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::update_project_data_class( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = UpdateProjectDataClassSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) } - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectLicenses" => { + } + } + } + impl Clone for RulesServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for RulesServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.RulesService"; + } +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SearchResourcesRequest { + #[prost(string, tag = "1")] + pub query: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub filter: ::prost::alloc::string::String, + #[prost(int64, tag = "3")] + pub limit: i64, + #[prost(int64, tag = "4")] + pub offset: i64, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SearchResourcesResponse { + /// Json list for each found resource + #[prost(message, repeated, tag = "1")] + pub resources: ::prost::alloc::vec::Vec, + /// How many results are expected to be found ? + #[prost(int64, tag = "2")] + pub estimated_total: i64, + /// The last index returned + #[prost(int64, tag = "3")] + pub last_index: i64, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetResourceRequest { + #[prost(string, tag = "1")] + pub resource_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ResourceWithPermission { + #[prost(message, optional, tag = "1")] + pub resource: ::core::option::Option, + #[prost(enumeration = "super::super::models::v2::PermissionLevel", tag = "2")] + pub permission: i32, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetResourceResponse { + #[prost(message, optional, tag = "1")] + pub resource: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetResourcesRequest { + #[prost(string, repeated, tag = "1")] + pub resource_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetResourcesResponse { + #[prost(message, repeated, tag = "1")] + pub resources: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RequestResourceAccessRequest { + #[prost(string, tag = "1")] + pub resource_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub message: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RequestResourceAccessResponse {} +/// Generated client implementations. +pub mod search_service_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /// SearchService + /// + /// Status: BETA + /// + /// SearchService is used to query resources in the index and get a public view of them. + #[derive(Debug, Clone)] + pub struct SearchServiceClient { + inner: tonic::client::Grpc, + } + impl SearchServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> SearchServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + SearchServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// SearchResources + /// + /// Status: BETA + /// + /// Searches the index for applicable resources (only public + private can be searched) + pub async fn search_resources( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.SearchService/SearchResources", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.SearchService", + "SearchResources", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetResource + /// + /// Status: BETA + /// + /// Retrieves resource by its ID. + pub async fn get_resource( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.SearchService/GetResource", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.SearchService", + "GetResource", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetResources + /// + /// Status: BETA + /// + /// Retrieves resources by a list of IDs. + pub async fn get_resources( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.SearchService/GetResources", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.SearchService", + "GetResources", + ), + ); + self.inner.unary(req, path, codec).await + } + /// RequestResourceAccess + /// + /// Status: ALPHA + /// + /// Requests access to resources + pub async fn request_resource_access( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/aruna.api.storage.services.v2.SearchService/RequestResourceAccess", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "aruna.api.storage.services.v2.SearchService", + "RequestResourceAccess", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod search_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with SearchServiceServer. + #[async_trait] + pub trait SearchService: Send + Sync + 'static { + /// SearchResources + /// + /// Status: BETA + /// + /// Searches the index for applicable resources (only public + private can be searched) + async fn search_resources( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetResource + /// + /// Status: BETA + /// + /// Retrieves resource by its ID. + async fn get_resource( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// GetResources + /// + /// Status: BETA + /// + /// Retrieves resources by a list of IDs. + async fn get_resources( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// RequestResourceAccess + /// + /// Status: ALPHA + /// + /// Requests access to resources + async fn request_resource_access( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// SearchService + /// + /// Status: BETA + /// + /// SearchService is used to query resources in the index and get a public view of them. + #[derive(Debug)] + pub struct SearchServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl SearchServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for SearchServiceServer + where + T: SearchService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/aruna.api.storage.services.v2.SearchService/SearchResources" => { #[allow(non_camel_case_types)] - struct UpdateProjectLicensesSvc(pub Arc); + struct SearchResourcesSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for UpdateProjectLicensesSvc { - type Response = super::UpdateProjectLicensesResponse; + T: SearchService, + > tonic::server::UnaryService + for SearchResourcesSvc { + type Response = super::SearchResourcesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_project_licenses( - &inner, - request, - ) + ::search_resources(&inner, request) .await }; Box::pin(fut) @@ -19138,7 +19139,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateProjectLicensesSvc(inner); + let method = SearchResourcesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -19154,26 +19155,25 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/ArchiveProject" => { + "/aruna.api.storage.services.v2.SearchService/GetResource" => { #[allow(non_camel_case_types)] - struct ArchiveProjectSvc(pub Arc); + struct GetResourceSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for ArchiveProjectSvc { - type Response = super::ArchiveProjectResponse; + T: SearchService, + > tonic::server::UnaryService + for GetResourceSvc { + type Response = super::GetResourceResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::archive_project(&inner, request) - .await + ::get_resource(&inner, request).await }; Box::pin(fut) } @@ -19185,7 +19185,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ArchiveProjectSvc(inner); + let method = GetResourceSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -19201,26 +19201,25 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectTitle" => { + "/aruna.api.storage.services.v2.SearchService/GetResources" => { #[allow(non_camel_case_types)] - struct UpdateProjectTitleSvc(pub Arc); + struct GetResourcesSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for UpdateProjectTitleSvc { - type Response = super::UpdateProjectTitleResponse; + T: SearchService, + > tonic::server::UnaryService + for GetResourcesSvc { + type Response = super::GetResourcesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_project_title(&inner, request) - .await + ::get_resources(&inner, request).await }; Box::pin(fut) } @@ -19232,7 +19231,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateProjectTitleSvc(inner); + let method = GetResourcesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -19248,25 +19247,25 @@ pub mod project_service_server { }; Box::pin(fut) } - "/aruna.api.storage.services.v2.ProjectService/UpdateProjectAuthors" => { + "/aruna.api.storage.services.v2.SearchService/RequestResourceAccess" => { #[allow(non_camel_case_types)] - struct UpdateProjectAuthorsSvc(pub Arc); + struct RequestResourceAccessSvc(pub Arc); impl< - T: ProjectService, - > tonic::server::UnaryService - for UpdateProjectAuthorsSvc { - type Response = super::UpdateProjectAuthorsResponse; + T: SearchService, + > tonic::server::UnaryService + for RequestResourceAccessSvc { + type Response = super::RequestResourceAccessResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_project_authors( + ::request_resource_access( &inner, request, ) @@ -19282,7 +19281,7 @@ pub mod project_service_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateProjectAuthorsSvc(inner); + let method = RequestResourceAccessSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -19313,7 +19312,7 @@ pub mod project_service_server { } } } - impl Clone for ProjectServiceServer { + impl Clone for SearchServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -19325,7 +19324,7 @@ pub mod project_service_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -19335,7 +19334,7 @@ pub mod project_service_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for ProjectServiceServer { - const NAME: &'static str = "aruna.api.storage.services.v2.ProjectService"; + impl tonic::server::NamedService for SearchServiceServer { + const NAME: &'static str = "aruna.api.storage.services.v2.SearchService"; } } diff --git a/src/aruna_no_transport/google.api.rs b/src/aruna_no_transport/google.api.rs index ceb2028..a075656 100644 --- a/src/aruna_no_transport/google.api.rs +++ b/src/aruna_no_transport/google.api.rs @@ -1,4 +1,3 @@ -// This file is @generated by prost-build. /// Defines the HTTP configuration for an API service. It contains a list of /// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method /// to one or more HTTP REST API methods. diff --git a/src/aruna_no_transport/grpc.gateway.protoc_gen_openapiv2.options.rs b/src/aruna_no_transport/grpc.gateway.protoc_gen_openapiv2.options.rs index 030f6ea..dee292a 100644 --- a/src/aruna_no_transport/grpc.gateway.protoc_gen_openapiv2.options.rs +++ b/src/aruna_no_transport/grpc.gateway.protoc_gen_openapiv2.options.rs @@ -1,4 +1,3 @@ -// This file is @generated by prost-build. /// `Swagger` is a representation of OpenAPI v2 specification's Swagger object. /// /// See: