#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateWorkloadRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub workload: ::core::option::Option<Workload>,
#[prost(string, tag = "3")]
pub external_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateWorkloadRequest {
#[prost(message, optional, tag = "1")]
pub workload: ::core::option::Option<Workload>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteWorkloadRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub etag: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetWorkloadRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListWorkloadsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub page_size: i32,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub filter: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListWorkloadsResponse {
#[prost(message, repeated, tag = "1")]
pub workloads: ::prost::alloc::vec::Vec<Workload>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Workload {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub display_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub resources: ::prost::alloc::vec::Vec<workload::ResourceInfo>,
#[prost(enumeration = "workload::ComplianceRegime", tag = "4")]
pub compliance_regime: i32,
#[prost(message, optional, tag = "5")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "6")]
pub billing_account: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub etag: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "10")]
pub labels:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(string, tag = "13")]
pub provisioned_resources_parent: ::prost::alloc::string::String,
#[prost(message, optional, tag = "14")]
pub kms_settings: ::core::option::Option<workload::KmsSettings>,
#[prost(message, repeated, tag = "15")]
pub resource_settings: ::prost::alloc::vec::Vec<workload::ResourceSettings>,
}
pub mod workload {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResourceInfo {
#[prost(int64, tag = "1")]
pub resource_id: i64,
#[prost(enumeration = "resource_info::ResourceType", tag = "2")]
pub resource_type: i32,
}
pub mod resource_info {
#[derive(
Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration,
)]
#[repr(i32)]
pub enum ResourceType {
Unspecified = 0,
ConsumerProject = 1,
EncryptionKeysProject = 2,
Keyring = 3,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KmsSettings {
#[prost(message, optional, tag = "1")]
pub next_rotation_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub rotation_period: ::core::option::Option<::prost_types::Duration>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResourceSettings {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
#[prost(enumeration = "resource_info::ResourceType", tag = "2")]
pub resource_type: i32,
#[prost(string, tag = "3")]
pub display_name: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ComplianceRegime {
Unspecified = 0,
Il4 = 1,
Cjis = 2,
FedrampHigh = 3,
FedrampModerate = 4,
UsRegionalAccess = 5,
Hipaa = 6,
Hitrust = 7,
EuRegionsAndSupport = 8,
CaRegionsAndSupport = 9,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateWorkloadOperationMetadata {
#[prost(message, optional, tag = "1")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "2")]
pub display_name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub parent: ::prost::alloc::string::String,
#[prost(enumeration = "workload::ComplianceRegime", tag = "4")]
pub compliance_regime: i32,
}
#[doc = r" Generated client implementations."]
pub mod assured_workloads_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " Service to manage AssuredWorkloads."]
#[derive(Debug, Clone)]
pub struct AssuredWorkloadsServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> AssuredWorkloadsServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> AssuredWorkloadsServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
Into<StdError> + Send + Sync,
{
AssuredWorkloadsServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " Creates Assured Workload."]
pub async fn create_workload(
&mut self,
request: impl tonic::IntoRequest<super::CreateWorkloadRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
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(
"/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/CreateWorkload",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates an existing workload."]
#[doc = " Currently allows updating of workload display_name and labels."]
#[doc = " For force updates don't set etag field in the Workload."]
#[doc = " Only one update operation per workload can be in progress."]
pub async fn update_workload(
&mut self,
request: impl tonic::IntoRequest<super::UpdateWorkloadRequest>,
) -> Result<tonic::Response<super::Workload>, 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(
"/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/UpdateWorkload",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes the workload. Make sure that workload's direct children are already"]
#[doc = " in a deleted state, otherwise the request will fail with a"]
#[doc = " FAILED_PRECONDITION error."]
pub async fn delete_workload(
&mut self,
request: impl tonic::IntoRequest<super::DeleteWorkloadRequest>,
) -> 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(
"/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/DeleteWorkload",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets Assured Workload associated with a CRM Node"]
pub async fn get_workload(
&mut self,
request: impl tonic::IntoRequest<super::GetWorkloadRequest>,
) -> Result<tonic::Response<super::Workload>, 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(
"/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/GetWorkload",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists Assured Workloads under a CRM Node."]
pub async fn list_workloads(
&mut self,
request: impl tonic::IntoRequest<super::ListWorkloadsRequest>,
) -> Result<tonic::Response<super::ListWorkloadsResponse>, 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(
"/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/ListWorkloads",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}