#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Folder {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub display_name: ::prost::alloc::string::String,
#[prost(enumeration = "folder::State", tag = "4")]
pub state: i32,
#[prost(message, optional, tag = "5")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "6")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "7")]
pub delete_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "8")]
pub etag: ::prost::alloc::string::String,
}
pub mod folder {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum State {
Unspecified = 0,
Active = 1,
DeleteRequested = 2,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFolderRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFoldersRequest {
#[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(bool, tag = "4")]
pub show_deleted: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFoldersResponse {
#[prost(message, repeated, tag = "1")]
pub folders: ::prost::alloc::vec::Vec<Folder>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchFoldersRequest {
#[prost(int32, tag = "1")]
pub page_size: i32,
#[prost(string, tag = "2")]
pub page_token: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub query: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchFoldersResponse {
#[prost(message, repeated, tag = "1")]
pub folders: ::prost::alloc::vec::Vec<Folder>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateFolderRequest {
#[prost(message, optional, tag = "2")]
pub folder: ::core::option::Option<Folder>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateFolderMetadata {
#[prost(string, tag = "1")]
pub display_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub parent: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateFolderRequest {
#[prost(message, optional, tag = "1")]
pub folder: ::core::option::Option<Folder>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateFolderMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveFolderRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub destination_parent: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveFolderMetadata {
#[prost(string, tag = "1")]
pub display_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub source_parent: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub destination_parent: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteFolderRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteFolderMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UndeleteFolderRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UndeleteFolderMetadata {}
#[doc = r" Generated client implementations."]
pub mod folders_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " Manages Cloud Platform folder resources."]
#[doc = " Folders can be used to organize the resources under an"]
#[doc = " organization and to control the policies applied to groups of resources."]
#[derive(Debug, Clone)]
pub struct FoldersClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> FoldersClient<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,
) -> FoldersClient<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,
{
FoldersClient::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 = " Retrieves a folder identified by the supplied resource name."]
#[doc = " Valid folder resource names have the format `folders/{folder_id}`"]
#[doc = " (for example, `folders/1234`)."]
#[doc = " The caller must have `resourcemanager.folders.get` permission on the"]
#[doc = " identified folder."]
pub async fn get_folder(
&mut self,
request: impl tonic::IntoRequest<super::GetFolderRequest>,
) -> Result<tonic::Response<super::Folder>, 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.resourcemanager.v3.Folders/GetFolder",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists the folders that are direct descendants of supplied parent resource."]
#[doc = " `list()` provides a strongly consistent view of the folders underneath"]
#[doc = " the specified parent resource."]
#[doc = " `list()` returns folders sorted based upon the (ascending) lexical ordering"]
#[doc = " of their display_name."]
#[doc = " The caller must have `resourcemanager.folders.list` permission on the"]
#[doc = " identified parent."]
pub async fn list_folders(
&mut self,
request: impl tonic::IntoRequest<super::ListFoldersRequest>,
) -> Result<tonic::Response<super::ListFoldersResponse>, 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.resourcemanager.v3.Folders/ListFolders",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Search for folders that match specific filter criteria."]
#[doc = " `search()` provides an eventually consistent view of the folders a user has"]
#[doc = " access to which meet the specified filter criteria."]
#[doc = ""]
#[doc = " This will only return folders on which the caller has the"]
#[doc = " permission `resourcemanager.folders.get`."]
pub async fn search_folders(
&mut self,
request: impl tonic::IntoRequest<super::SearchFoldersRequest>,
) -> Result<tonic::Response<super::SearchFoldersResponse>, 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.resourcemanager.v3.Folders/SearchFolders",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates a folder in the resource hierarchy."]
#[doc = " Returns an `Operation` which can be used to track the progress of the"]
#[doc = " folder creation workflow."]
#[doc = " Upon success, the `Operation.response` field will be populated with the"]
#[doc = " created Folder."]
#[doc = ""]
#[doc = " In order to succeed, the addition of this new folder must not violate"]
#[doc = " the folder naming, height, or fanout constraints."]
#[doc = ""]
#[doc = " + The folder's `display_name` must be distinct from all other folders that"]
#[doc = " share its parent."]
#[doc = " + The addition of the folder must not cause the active folder hierarchy"]
#[doc = " to exceed a height of 10. Note, the full active + deleted folder hierarchy"]
#[doc = " is allowed to reach a height of 20; this provides additional headroom when"]
#[doc = " moving folders that contain deleted folders."]
#[doc = " + The addition of the folder must not cause the total number of folders"]
#[doc = " under its parent to exceed 300."]
#[doc = ""]
#[doc = " If the operation fails due to a folder constraint violation, some errors"]
#[doc = " may be returned by the `CreateFolder` request, with status code"]
#[doc = " `FAILED_PRECONDITION` and an error description. Other folder constraint"]
#[doc = " violations will be communicated in the `Operation`, with the specific"]
#[doc = " `PreconditionFailure` returned in the details list in the `Operation.error`"]
#[doc = " field."]
#[doc = ""]
#[doc = " The caller must have `resourcemanager.folders.create` permission on the"]
#[doc = " identified parent."]
pub async fn create_folder(
&mut self,
request: impl tonic::IntoRequest<super::CreateFolderRequest>,
) -> 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.resourcemanager.v3.Folders/CreateFolder",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates a folder, changing its `display_name`."]
#[doc = " Changes to the folder `display_name` will be rejected if they violate"]
#[doc = " either the `display_name` formatting rules or the naming constraints"]
#[doc = " described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation."]
#[doc = ""]
#[doc = " The folder's `display_name` must start and end with a letter or digit,"]
#[doc = " may contain letters, digits, spaces, hyphens and underscores and can be"]
#[doc = " between 3 and 30 characters. This is captured by the regular expression:"]
#[doc = " `[\\p{L}\\p{N}][\\p{L}\\p{N}_- ]{1,28}[\\p{L}\\p{N}]`."]
#[doc = " The caller must have `resourcemanager.folders.update` permission on the"]
#[doc = " identified folder."]
#[doc = ""]
#[doc = " If the update fails due to the unique name constraint then a"]
#[doc = " `PreconditionFailure` explaining this violation will be returned"]
#[doc = " in the Status.details field."]
pub async fn update_folder(
&mut self,
request: impl tonic::IntoRequest<super::UpdateFolderRequest>,
) -> 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.resourcemanager.v3.Folders/UpdateFolder",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Moves a folder under a new resource parent."]
#[doc = " Returns an `Operation` which can be used to track the progress of the"]
#[doc = " folder move workflow."]
#[doc = " Upon success, the `Operation.response` field will be populated with the"]
#[doc = " moved folder."]
#[doc = " Upon failure, a `FolderOperationError` categorizing the failure cause will"]
#[doc = " be returned - if the failure occurs synchronously then the"]
#[doc = " `FolderOperationError` will be returned in the `Status.details` field."]
#[doc = " If it occurs asynchronously, then the FolderOperation will be returned"]
#[doc = " in the `Operation.error` field."]
#[doc = " In addition, the `Operation.metadata` field will be populated with a"]
#[doc = " `FolderOperation` message as an aid to stateless clients."]
#[doc = " Folder moves will be rejected if they violate either the naming, height,"]
#[doc = " or fanout constraints described in the"]
#[doc = " [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation."]
#[doc = " The caller must have `resourcemanager.folders.move` permission on the"]
#[doc = " folder's current and proposed new parent."]
pub async fn move_folder(
&mut self,
request: impl tonic::IntoRequest<super::MoveFolderRequest>,
) -> 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.resourcemanager.v3.Folders/MoveFolder",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Requests deletion of a folder. The folder is moved into the"]
#[doc = " [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state"]
#[doc = " immediately, and is deleted approximately 30 days later. This method may"]
#[doc = " only be called on an empty folder, where a folder is empty if it doesn't"]
#[doc = " contain any folders or projects in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state."]
#[doc = " If called on a folder in [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED]"]
#[doc = " state the operation will result in a no-op success."]
#[doc = " The caller must have `resourcemanager.folders.delete` permission on the"]
#[doc = " identified folder."]
pub async fn delete_folder(
&mut self,
request: impl tonic::IntoRequest<super::DeleteFolderRequest>,
) -> 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.resourcemanager.v3.Folders/DeleteFolder",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Cancels the deletion request for a folder. This method may be called on a"]
#[doc = " folder in any state. If the folder is in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE]"]
#[doc = " state the result will be a no-op success. In order to succeed, the folder's"]
#[doc = " parent must be in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In addition,"]
#[doc = " reintroducing the folder into the tree must not violate folder naming,"]
#[doc = " height, and fanout constraints described in the"]
#[doc = " [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation."]
#[doc = " The caller must have `resourcemanager.folders.undelete` permission on the"]
#[doc = " identified folder."]
pub async fn undelete_folder(
&mut self,
request: impl tonic::IntoRequest<super::UndeleteFolderRequest>,
) -> 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.resourcemanager.v3.Folders/UndeleteFolder",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets the access control policy for a folder. The returned policy may be"]
#[doc = " empty if no such policy or resource exists. The `resource` field should"]
#[doc = " be the folder's resource name, for example: \"folders/1234\"."]
#[doc = " The caller must have `resourcemanager.folders.getIamPolicy` permission"]
#[doc = " on the identified folder."]
pub async fn get_iam_policy(
&mut self,
request: impl tonic::IntoRequest<super::super::super::super::iam::v1::GetIamPolicyRequest>,
) -> Result<tonic::Response<super::super::super::super::iam::v1::Policy>, 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.resourcemanager.v3.Folders/GetIamPolicy",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Sets the access control policy on a folder, replacing any existing policy."]
#[doc = " The `resource` field should be the folder's resource name, for example:"]
#[doc = " \"folders/1234\"."]
#[doc = " The caller must have `resourcemanager.folders.setIamPolicy` permission"]
#[doc = " on the identified folder."]
pub async fn set_iam_policy(
&mut self,
request: impl tonic::IntoRequest<super::super::super::super::iam::v1::SetIamPolicyRequest>,
) -> Result<tonic::Response<super::super::super::super::iam::v1::Policy>, 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.resourcemanager.v3.Folders/SetIamPolicy",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Returns permissions that a caller has on the specified folder."]
#[doc = " The `resource` field should be the folder's resource name,"]
#[doc = " for example: \"folders/1234\"."]
#[doc = ""]
#[doc = " There are no permissions required for making this API call."]
pub async fn test_iam_permissions(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::super::iam::v1::TestIamPermissionsRequest,
>,
) -> Result<
tonic::Response<super::super::super::super::iam::v1::TestIamPermissionsResponse>,
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.resourcemanager.v3.Folders/TestIamPermissions",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Organization {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub display_name: ::prost::alloc::string::String,
#[prost(enumeration = "organization::State", tag = "4")]
pub state: i32,
#[prost(message, optional, tag = "5")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "6")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "7")]
pub delete_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "8")]
pub etag: ::prost::alloc::string::String,
#[prost(oneof = "organization::Owner", tags = "3")]
pub owner: ::core::option::Option<organization::Owner>,
}
pub mod organization {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum State {
Unspecified = 0,
Active = 1,
DeleteRequested = 2,
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Owner {
#[prost(string, tag = "3")]
DirectoryCustomerId(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOrganizationRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchOrganizationsRequest {
#[prost(int32, tag = "1")]
pub page_size: i32,
#[prost(string, tag = "2")]
pub page_token: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub query: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchOrganizationsResponse {
#[prost(message, repeated, tag = "1")]
pub organizations: ::prost::alloc::vec::Vec<Organization>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteOrganizationMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UndeleteOrganizationMetadata {}
#[doc = r" Generated client implementations."]
pub mod organizations_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " Allows users to manage their organization resources."]
#[derive(Debug, Clone)]
pub struct OrganizationsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> OrganizationsClient<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,
) -> OrganizationsClient<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,
{
OrganizationsClient::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 = " Fetches an organization resource identified by the specified resource name."]
pub async fn get_organization(
&mut self,
request: impl tonic::IntoRequest<super::GetOrganizationRequest>,
) -> Result<tonic::Response<super::Organization>, 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.resourcemanager.v3.Organizations/GetOrganization",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Searches organization resources that are visible to the user and satisfy"]
#[doc = " the specified filter. This method returns organizations in an unspecified"]
#[doc = " order. New organizations do not necessarily appear at the end of the"]
#[doc = " results, and may take a small amount of time to appear."]
#[doc = ""]
#[doc = " Search will only return organizations on which the user has the permission"]
#[doc = " `resourcemanager.organizations.get`"]
pub async fn search_organizations(
&mut self,
request: impl tonic::IntoRequest<super::SearchOrganizationsRequest>,
) -> Result<tonic::Response<super::SearchOrganizationsResponse>, 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.resourcemanager.v3.Organizations/SearchOrganizations",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets the access control policy for an organization resource. The policy may"]
#[doc = " be empty if no such policy or resource exists. The `resource` field should"]
#[doc = " be the organization's resource name, for example: \"organizations/123\"."]
#[doc = ""]
#[doc = " Authorization requires the IAM permission"]
#[doc = " `resourcemanager.organizations.getIamPolicy` on the specified organization."]
pub async fn get_iam_policy(
&mut self,
request: impl tonic::IntoRequest<super::super::super::super::iam::v1::GetIamPolicyRequest>,
) -> Result<tonic::Response<super::super::super::super::iam::v1::Policy>, 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.resourcemanager.v3.Organizations/GetIamPolicy",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Sets the access control policy on an organization resource. Replaces any"]
#[doc = " existing policy. The `resource` field should be the organization's resource"]
#[doc = " name, for example: \"organizations/123\"."]
#[doc = ""]
#[doc = " Authorization requires the IAM permission"]
#[doc = " `resourcemanager.organizations.setIamPolicy` on the specified organization."]
pub async fn set_iam_policy(
&mut self,
request: impl tonic::IntoRequest<super::super::super::super::iam::v1::SetIamPolicyRequest>,
) -> Result<tonic::Response<super::super::super::super::iam::v1::Policy>, 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.resourcemanager.v3.Organizations/SetIamPolicy",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Returns the permissions that a caller has on the specified organization."]
#[doc = " The `resource` field should be the organization's resource name,"]
#[doc = " for example: \"organizations/123\"."]
#[doc = ""]
#[doc = " There are no permissions required for making this API call."]
pub async fn test_iam_permissions(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::super::iam::v1::TestIamPermissionsRequest,
>,
) -> Result<
tonic::Response<super::super::super::super::iam::v1::TestIamPermissionsResponse>,
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.resourcemanager.v3.Organizations/TestIamPermissions",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Project {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub project_id: ::prost::alloc::string::String,
#[prost(enumeration = "project::State", tag = "4")]
pub state: i32,
#[prost(string, tag = "5")]
pub display_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "7")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "8")]
pub delete_time: ::core::option::Option<::prost_types::Timestamp>,
#[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>,
}
pub mod project {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum State {
Unspecified = 0,
Active = 1,
DeleteRequested = 2,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetProjectRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListProjectsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub page_token: ::prost::alloc::string::String,
#[prost(int32, tag = "3")]
pub page_size: i32,
#[prost(bool, tag = "4")]
pub show_deleted: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListProjectsResponse {
#[prost(message, repeated, tag = "1")]
pub projects: ::prost::alloc::vec::Vec<Project>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchProjectsRequest {
#[prost(string, tag = "1")]
pub query: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub page_token: ::prost::alloc::string::String,
#[prost(int32, tag = "3")]
pub page_size: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchProjectsResponse {
#[prost(message, repeated, tag = "1")]
pub projects: ::prost::alloc::vec::Vec<Project>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateProjectRequest {
#[prost(message, optional, tag = "1")]
pub project: ::core::option::Option<Project>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateProjectMetadata {
#[prost(message, optional, tag = "1")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(bool, tag = "2")]
pub gettable: bool,
#[prost(bool, tag = "3")]
pub ready: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateProjectRequest {
#[prost(message, optional, tag = "1")]
pub project: ::core::option::Option<Project>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateProjectMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveProjectRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub destination_parent: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveProjectMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteProjectRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteProjectMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UndeleteProjectRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UndeleteProjectMetadata {}
#[doc = r" Generated client implementations."]
pub mod projects_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " Manages Google Cloud Projects."]
#[derive(Debug, Clone)]
pub struct ProjectsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> ProjectsClient<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,
) -> ProjectsClient<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,
{
ProjectsClient::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 = " Retrieves the project identified by the specified `name` (for example,"]
#[doc = " `projects/415104041262`)."]
#[doc = ""]
#[doc = " The caller must have `resourcemanager.projects.get` permission"]
#[doc = " for this project."]
pub async fn get_project(
&mut self,
request: impl tonic::IntoRequest<super::GetProjectRequest>,
) -> Result<tonic::Response<super::Project>, 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.resourcemanager.v3.Projects/GetProject",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists projects that are direct children of the specified folder or"]
#[doc = " organization resource. `list()` provides a strongly consistent view of the"]
#[doc = " projects underneath the specified parent resource. `list()` returns"]
#[doc = " projects sorted based upon the (ascending) lexical ordering of their"]
#[doc = " `display_name`. The caller must have `resourcemanager.projects.list`"]
#[doc = " permission on the identified parent."]
pub async fn list_projects(
&mut self,
request: impl tonic::IntoRequest<super::ListProjectsRequest>,
) -> Result<tonic::Response<super::ListProjectsResponse>, 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.resourcemanager.v3.Projects/ListProjects",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Search for projects that the caller has both `resourcemanager.projects.get`"]
#[doc = " permission on, and also satisfy the specified query."]
#[doc = ""]
#[doc = " This method returns projects in an unspecified order."]
#[doc = ""]
#[doc = " This method is eventually consistent with project mutations; this means"]
#[doc = " that a newly created project may not appear in the results or recent"]
#[doc = " updates to an existing project may not be reflected in the results. To"]
#[doc = " retrieve the latest state of a project, use the"]
#[doc = " [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject] method."]
pub async fn search_projects(
&mut self,
request: impl tonic::IntoRequest<super::SearchProjectsRequest>,
) -> Result<tonic::Response<super::SearchProjectsResponse>, 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.resourcemanager.v3.Projects/SearchProjects",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Request that a new project be created. The result is an `Operation` which"]
#[doc = " can be used to track the creation process. This process usually takes a few"]
#[doc = " seconds, but can sometimes take much longer. The tracking `Operation` is"]
#[doc = " automatically deleted after a few hours, so there is no need to call"]
#[doc = " `DeleteOperation`."]
pub async fn create_project(
&mut self,
request: impl tonic::IntoRequest<super::CreateProjectRequest>,
) -> 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.resourcemanager.v3.Projects/CreateProject",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates the `display_name` and labels of the project identified by the"]
#[doc = " specified `name` (for example, `projects/415104041262`). Deleting all"]
#[doc = " labels requires an update mask for labels field."]
#[doc = ""]
#[doc = " The caller must have `resourcemanager.projects.update` permission for this"]
#[doc = " project."]
pub async fn update_project(
&mut self,
request: impl tonic::IntoRequest<super::UpdateProjectRequest>,
) -> 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.resourcemanager.v3.Projects/UpdateProject",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Move a project to another place in your resource hierarchy, under a new"]
#[doc = " resource parent."]
#[doc = ""]
#[doc = " Returns an operation which can be used to track the process of the project"]
#[doc = " move workflow."]
#[doc = " Upon success, the `Operation.response` field will be populated with the"]
#[doc = " moved project."]
#[doc = ""]
#[doc = " The caller must have `resourcemanager.projects.update` permission on the"]
#[doc = " project and have `resourcemanager.projects.move` permission on the"]
#[doc = " project's current and proposed new parent."]
#[doc = ""]
#[doc = ""]
pub async fn move_project(
&mut self,
request: impl tonic::IntoRequest<super::MoveProjectRequest>,
) -> 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.resourcemanager.v3.Projects/MoveProject",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Marks the project identified by the specified"]
#[doc = " `name` (for example, `projects/415104041262`) for deletion."]
#[doc = ""]
#[doc = " This method will only affect the project if it has a lifecycle state of"]
#[doc = " [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE]."]
#[doc = ""]
#[doc = " This method changes the Project's lifecycle state from"]
#[doc = " [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE]"]
#[doc = " to [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]."]
#[doc = " The deletion starts at an unspecified time,"]
#[doc = " at which point the Project is no longer accessible."]
#[doc = ""]
#[doc = " Until the deletion completes, you can check the lifecycle state"]
#[doc = " checked by retrieving the project with [GetProject]"]
#[doc = " [google.cloud.resourcemanager.v3.Projects.GetProject],"]
#[doc = " and the project remains visible to [ListProjects]"]
#[doc = " [google.cloud.resourcemanager.v3.Projects.ListProjects]."]
#[doc = " However, you cannot update the project."]
#[doc = ""]
#[doc = " After the deletion completes, the project is not retrievable by"]
#[doc = " the [GetProject]"]
#[doc = " [google.cloud.resourcemanager.v3.Projects.GetProject],"]
#[doc = " [ListProjects]"]
#[doc = " [google.cloud.resourcemanager.v3.Projects.ListProjects], and"]
#[doc = " [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects]"]
#[doc = " methods."]
#[doc = ""]
#[doc = " This method behaves idempotently, such that deleting a `DELETE_REQUESTED`"]
#[doc = " project will not cause an error, but also won't do anything."]
#[doc = ""]
#[doc = " The caller must have `resourcemanager.projects.delete` permissions for this"]
#[doc = " project."]
pub async fn delete_project(
&mut self,
request: impl tonic::IntoRequest<super::DeleteProjectRequest>,
) -> 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.resourcemanager.v3.Projects/DeleteProject",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Restores the project identified by the specified"]
#[doc = " `name` (for example, `projects/415104041262`)."]
#[doc = " You can only use this method for a project that has a lifecycle state of"]
#[doc = " [DELETE_REQUESTED]"]
#[doc = " [Projects.State.DELETE_REQUESTED]."]
#[doc = " After deletion starts, the project cannot be restored."]
#[doc = ""]
#[doc = " The caller must have `resourcemanager.projects.undelete` permission for"]
#[doc = " this project."]
pub async fn undelete_project(
&mut self,
request: impl tonic::IntoRequest<super::UndeleteProjectRequest>,
) -> 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.resourcemanager.v3.Projects/UndeleteProject",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Returns the IAM access control policy for the specified project."]
#[doc = " Permission is denied if the policy or the resource do not exist."]
pub async fn get_iam_policy(
&mut self,
request: impl tonic::IntoRequest<super::super::super::super::iam::v1::GetIamPolicyRequest>,
) -> Result<tonic::Response<super::super::super::super::iam::v1::Policy>, 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.resourcemanager.v3.Projects/GetIamPolicy",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Sets the IAM access control policy for the specified project."]
#[doc = ""]
#[doc = " CAUTION: This method will replace the existing policy, and cannot be used"]
#[doc = " to append additional IAM settings."]
#[doc = ""]
#[doc = " Note: Removing service accounts from policies or changing their roles can"]
#[doc = " render services completely inoperable. It is important to understand how"]
#[doc = " the service account is being used before removing or updating its roles."]
#[doc = ""]
#[doc = " The following constraints apply when using `setIamPolicy()`:"]
#[doc = ""]
#[doc = " + Project does not support `allUsers` and `allAuthenticatedUsers` as"]
#[doc = " `members` in a `Binding` of a `Policy`."]
#[doc = ""]
#[doc = " + The owner role can be granted to a `user`, `serviceAccount`, or a group"]
#[doc = " that is part of an organization. For example,"]
#[doc = " group@myownpersonaldomain.com could be added as an owner to a project in"]
#[doc = " the myownpersonaldomain.com organization, but not the examplepetstore.com"]
#[doc = " organization."]
#[doc = ""]
#[doc = " + Service accounts can be made owners of a project directly"]
#[doc = " without any restrictions. However, to be added as an owner, a user must be"]
#[doc = " invited using the Cloud Platform console and must accept the invitation."]
#[doc = ""]
#[doc = " + A user cannot be granted the owner role using `setIamPolicy()`. The user"]
#[doc = " must be granted the owner role using the Cloud Platform Console and must"]
#[doc = " explicitly accept the invitation."]
#[doc = ""]
#[doc = " + Invitations to grant the owner role cannot be sent using"]
#[doc = " `setIamPolicy()`;"]
#[doc = " they must be sent only using the Cloud Platform Console."]
#[doc = ""]
#[doc = " + Membership changes that leave the project without any owners that have"]
#[doc = " accepted the Terms of Service (ToS) will be rejected."]
#[doc = ""]
#[doc = " + If the project is not part of an organization, there must be at least"]
#[doc = " one owner who has accepted the Terms of Service (ToS) agreement in the"]
#[doc = " policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner"]
#[doc = " from the policy will fail. This restriction also applies to legacy"]
#[doc = " projects that no longer have owners who have accepted the ToS. Edits to"]
#[doc = " IAM policies will be rejected until the lack of a ToS-accepting owner is"]
#[doc = " rectified."]
#[doc = ""]
#[doc = " + Calling this method requires enabling the App Engine Admin API."]
pub async fn set_iam_policy(
&mut self,
request: impl tonic::IntoRequest<super::super::super::super::iam::v1::SetIamPolicyRequest>,
) -> Result<tonic::Response<super::super::super::super::iam::v1::Policy>, 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.resourcemanager.v3.Projects/SetIamPolicy",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Returns permissions that a caller has on the specified project."]
pub async fn test_iam_permissions(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::super::iam::v1::TestIamPermissionsRequest,
>,
) -> Result<
tonic::Response<super::super::super::super::iam::v1::TestIamPermissionsResponse>,
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.resourcemanager.v3.Projects/TestIamPermissions",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TagBinding {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub tag_value: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateTagBindingMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateTagBindingRequest {
#[prost(message, optional, tag = "1")]
pub tag_binding: ::core::option::Option<TagBinding>,
#[prost(bool, tag = "2")]
pub validate_only: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteTagBindingMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteTagBindingRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTagBindingsRequest {
#[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,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTagBindingsResponse {
#[prost(message, repeated, tag = "1")]
pub tag_bindings: ::prost::alloc::vec::Vec<TagBinding>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[doc = r" Generated client implementations."]
pub mod tag_bindings_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " Allow users to create and manage TagBindings between TagValues and"]
#[doc = " different cloud resources throughout the GCP resource hierarchy."]
#[derive(Debug, Clone)]
pub struct TagBindingsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> TagBindingsClient<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,
) -> TagBindingsClient<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,
{
TagBindingsClient::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 = " Lists the TagBindings for the given cloud resource, as specified with"]
#[doc = " `parent`."]
#[doc = ""]
#[doc = " NOTE: The `parent` field is expected to be a full resource name:"]
#[doc = " https://cloud.google.com/apis/design/resource_names#full_resource_name"]
pub async fn list_tag_bindings(
&mut self,
request: impl tonic::IntoRequest<super::ListTagBindingsRequest>,
) -> Result<tonic::Response<super::ListTagBindingsResponse>, 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.resourcemanager.v3.TagBindings/ListTagBindings",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates a TagBinding between a TagValue and a cloud resource"]
#[doc = " (currently project, folder, or organization)."]
pub async fn create_tag_binding(
&mut self,
request: impl tonic::IntoRequest<super::CreateTagBindingRequest>,
) -> 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.resourcemanager.v3.TagBindings/CreateTagBinding",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes a TagBinding."]
pub async fn delete_tag_binding(
&mut self,
request: impl tonic::IntoRequest<super::DeleteTagBindingRequest>,
) -> 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.resourcemanager.v3.TagBindings/DeleteTagBinding",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TagKey {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub short_name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub namespaced_name: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub description: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "7")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "8")]
pub etag: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTagKeysRequest {
#[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,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTagKeysResponse {
#[prost(message, repeated, tag = "1")]
pub tag_keys: ::prost::alloc::vec::Vec<TagKey>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTagKeyRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateTagKeyRequest {
#[prost(message, optional, tag = "1")]
pub tag_key: ::core::option::Option<TagKey>,
#[prost(bool, tag = "2")]
pub validate_only: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateTagKeyMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateTagKeyRequest {
#[prost(message, optional, tag = "1")]
pub tag_key: ::core::option::Option<TagKey>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
#[prost(bool, tag = "3")]
pub validate_only: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateTagKeyMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteTagKeyRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(bool, tag = "2")]
pub validate_only: bool,
#[prost(string, tag = "3")]
pub etag: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteTagKeyMetadata {}
#[doc = r" Generated client implementations."]
pub mod tag_keys_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " Allow users to create and manage tag keys."]
#[derive(Debug, Clone)]
pub struct TagKeysClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> TagKeysClient<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,
) -> TagKeysClient<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,
{
TagKeysClient::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 = " Lists all TagKeys for a parent resource."]
pub async fn list_tag_keys(
&mut self,
request: impl tonic::IntoRequest<super::ListTagKeysRequest>,
) -> Result<tonic::Response<super::ListTagKeysResponse>, 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.resourcemanager.v3.TagKeys/ListTagKeys",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Retrieves a TagKey. This method will return `PERMISSION_DENIED` if the"]
#[doc = " key does not exist or the user does not have permission to view it."]
pub async fn get_tag_key(
&mut self,
request: impl tonic::IntoRequest<super::GetTagKeyRequest>,
) -> Result<tonic::Response<super::TagKey>, 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.resourcemanager.v3.TagKeys/GetTagKey",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates a new TagKey. If another request with the same parameters is"]
#[doc = " sent while the original request is in process, the second request"]
#[doc = " will receive an error. A maximum of 300 TagKeys can exist under a parent at"]
#[doc = " any given time."]
pub async fn create_tag_key(
&mut self,
request: impl tonic::IntoRequest<super::CreateTagKeyRequest>,
) -> 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.resourcemanager.v3.TagKeys/CreateTagKey",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates the attributes of the TagKey resource."]
pub async fn update_tag_key(
&mut self,
request: impl tonic::IntoRequest<super::UpdateTagKeyRequest>,
) -> 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.resourcemanager.v3.TagKeys/UpdateTagKey",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes a TagKey. The TagKey cannot be deleted if it has any child"]
#[doc = " TagValues."]
pub async fn delete_tag_key(
&mut self,
request: impl tonic::IntoRequest<super::DeleteTagKeyRequest>,
) -> 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.resourcemanager.v3.TagKeys/DeleteTagKey",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets the access control policy for a TagKey. The returned policy may be"]
#[doc = " empty if no such policy or resource exists. The `resource` field should"]
#[doc = " be the TagKey's resource name. For example, \"tagKeys/1234\"."]
#[doc = " The caller must have"]
#[doc = " `cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy` permission on"]
#[doc = " the specified TagKey."]
pub async fn get_iam_policy(
&mut self,
request: impl tonic::IntoRequest<super::super::super::super::iam::v1::GetIamPolicyRequest>,
) -> Result<tonic::Response<super::super::super::super::iam::v1::Policy>, 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.resourcemanager.v3.TagKeys/GetIamPolicy",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Sets the access control policy on a TagKey, replacing any existing"]
#[doc = " policy. The `resource` field should be the TagKey's resource name."]
#[doc = " For example, \"tagKeys/1234\"."]
#[doc = " The caller must have `resourcemanager.tagKeys.setIamPolicy` permission"]
#[doc = " on the identified tagValue."]
pub async fn set_iam_policy(
&mut self,
request: impl tonic::IntoRequest<super::super::super::super::iam::v1::SetIamPolicyRequest>,
) -> Result<tonic::Response<super::super::super::super::iam::v1::Policy>, 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.resourcemanager.v3.TagKeys/SetIamPolicy",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Returns permissions that a caller has on the specified TagKey."]
#[doc = " The `resource` field should be the TagKey's resource name."]
#[doc = " For example, \"tagKeys/1234\"."]
#[doc = ""]
#[doc = " There are no permissions required for making this API call."]
pub async fn test_iam_permissions(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::super::iam::v1::TestIamPermissionsRequest,
>,
) -> Result<
tonic::Response<super::super::super::super::iam::v1::TestIamPermissionsResponse>,
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.resourcemanager.v3.TagKeys/TestIamPermissions",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TagValue {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub short_name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub namespaced_name: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub description: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "7")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "8")]
pub etag: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTagValuesRequest {
#[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,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTagValuesResponse {
#[prost(message, repeated, tag = "1")]
pub tag_values: ::prost::alloc::vec::Vec<TagValue>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTagValueRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateTagValueRequest {
#[prost(message, optional, tag = "1")]
pub tag_value: ::core::option::Option<TagValue>,
#[prost(bool, tag = "2")]
pub validate_only: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateTagValueMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateTagValueRequest {
#[prost(message, optional, tag = "1")]
pub tag_value: ::core::option::Option<TagValue>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
#[prost(bool, tag = "3")]
pub validate_only: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateTagValueMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteTagValueRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(bool, tag = "2")]
pub validate_only: bool,
#[prost(string, tag = "3")]
pub etag: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteTagValueMetadata {}
#[doc = r" Generated client implementations."]
pub mod tag_values_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " Allow users to create and manage tag values."]
#[derive(Debug, Clone)]
pub struct TagValuesClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> TagValuesClient<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,
) -> TagValuesClient<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,
{
TagValuesClient::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 = " Lists all TagValues for a specific TagKey."]
pub async fn list_tag_values(
&mut self,
request: impl tonic::IntoRequest<super::ListTagValuesRequest>,
) -> Result<tonic::Response<super::ListTagValuesResponse>, 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.resourcemanager.v3.TagValues/ListTagValues",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Retrieves TagValue. If the TagValue or namespaced name does not exist, or"]
#[doc = " if the user does not have permission to view it, this method will return"]
#[doc = " `PERMISSION_DENIED`."]
pub async fn get_tag_value(
&mut self,
request: impl tonic::IntoRequest<super::GetTagValueRequest>,
) -> Result<tonic::Response<super::TagValue>, 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.resourcemanager.v3.TagValues/GetTagValue",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates a TagValue as a child of the specified TagKey. If a another"]
#[doc = " request with the same parameters is sent while the original request is in"]
#[doc = " process the second request will receive an error. A maximum of 300"]
#[doc = " TagValues can exist under a TagKey at any given time."]
pub async fn create_tag_value(
&mut self,
request: impl tonic::IntoRequest<super::CreateTagValueRequest>,
) -> 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.resourcemanager.v3.TagValues/CreateTagValue",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates the attributes of the TagValue resource."]
pub async fn update_tag_value(
&mut self,
request: impl tonic::IntoRequest<super::UpdateTagValueRequest>,
) -> 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.resourcemanager.v3.TagValues/UpdateTagValue",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes a TagValue. The TagValue cannot have any bindings when it is"]
#[doc = " deleted."]
pub async fn delete_tag_value(
&mut self,
request: impl tonic::IntoRequest<super::DeleteTagValueRequest>,
) -> 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.resourcemanager.v3.TagValues/DeleteTagValue",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets the access control policy for a TagValue. The returned policy may be"]
#[doc = " empty if no such policy or resource exists. The `resource` field should"]
#[doc = " be the TagValue's resource name. For example: `tagValues/1234`."]
#[doc = " The caller must have the"]
#[doc = " `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on"]
#[doc = " the identified TagValue to get the access control policy."]
pub async fn get_iam_policy(
&mut self,
request: impl tonic::IntoRequest<super::super::super::super::iam::v1::GetIamPolicyRequest>,
) -> Result<tonic::Response<super::super::super::super::iam::v1::Policy>, 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.resourcemanager.v3.TagValues/GetIamPolicy",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Sets the access control policy on a TagValue, replacing any existing"]
#[doc = " policy. The `resource` field should be the TagValue's resource name."]
#[doc = " For example: `tagValues/1234`."]
#[doc = " The caller must have `resourcemanager.tagValues.setIamPolicy` permission"]
#[doc = " on the identified tagValue."]
pub async fn set_iam_policy(
&mut self,
request: impl tonic::IntoRequest<super::super::super::super::iam::v1::SetIamPolicyRequest>,
) -> Result<tonic::Response<super::super::super::super::iam::v1::Policy>, 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.resourcemanager.v3.TagValues/SetIamPolicy",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Returns permissions that a caller has on the specified TagValue."]
#[doc = " The `resource` field should be the TagValue's resource name. For example:"]
#[doc = " `tagValues/1234`."]
#[doc = ""]
#[doc = " There are no permissions required for making this API call."]
pub async fn test_iam_permissions(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::super::iam::v1::TestIamPermissionsRequest,
>,
) -> Result<
tonic::Response<super::super::super::super::iam::v1::TestIamPermissionsResponse>,
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.resourcemanager.v3.TagValues/TestIamPermissions",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}