Struct google_api_proto::google::api::serviceusage::v1::service_usage_client::ServiceUsageClient
source · pub struct ServiceUsageClient<T> { /* private fields */ }
Expand description
Enables services that service consumers want to use on Google Cloud Platform, lists the available or enabled services, or disables services that service consumers no longer use.
Implementations§
source§impl<T> ServiceUsageClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> ServiceUsageClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ServiceUsageClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
sourcepub async fn enable_service(
&mut self,
request: impl IntoRequest<EnableServiceRequest>,
) -> Result<Response<Operation>, Status>
pub async fn enable_service( &mut self, request: impl IntoRequest<EnableServiceRequest>, ) -> Result<Response<Operation>, Status>
Enable a service so that it can be used with a project.
sourcepub async fn disable_service(
&mut self,
request: impl IntoRequest<DisableServiceRequest>,
) -> Result<Response<Operation>, Status>
pub async fn disable_service( &mut self, request: impl IntoRequest<DisableServiceRequest>, ) -> Result<Response<Operation>, Status>
Disable a service so that it can no longer be used with a project. This prevents unintended usage that may cause unexpected billing charges or security leaks.
It is not valid to call the disable method on a service that is not
currently enabled. Callers will receive a FAILED_PRECONDITION
status if
the target service is not currently enabled.
sourcepub async fn get_service(
&mut self,
request: impl IntoRequest<GetServiceRequest>,
) -> Result<Response<Service>, Status>
pub async fn get_service( &mut self, request: impl IntoRequest<GetServiceRequest>, ) -> Result<Response<Service>, Status>
Returns the service configuration and enabled state for a given service.
sourcepub async fn list_services(
&mut self,
request: impl IntoRequest<ListServicesRequest>,
) -> Result<Response<ListServicesResponse>, Status>
pub async fn list_services( &mut self, request: impl IntoRequest<ListServicesRequest>, ) -> Result<Response<ListServicesResponse>, Status>
List all services available to the specified project, and the current
state of those services with respect to the project. The list includes
all public services, all services for which the calling user has the
servicemanagement.services.bind
permission, and all services that have
already been enabled on the project. The list can be filtered to
only include services in a specific state, for example to only include
services enabled on the project.
WARNING: If you need to query enabled services frequently or across an organization, you should use Cloud Asset Inventory API, which provides higher throughput and richer filtering capability.
sourcepub async fn batch_enable_services(
&mut self,
request: impl IntoRequest<BatchEnableServicesRequest>,
) -> Result<Response<Operation>, Status>
pub async fn batch_enable_services( &mut self, request: impl IntoRequest<BatchEnableServicesRequest>, ) -> Result<Response<Operation>, Status>
Enable multiple services on a project. The operation is atomic: if enabling
any service fails, then the entire batch fails, and no state changes occur.
To enable a single service, use the EnableService
method instead.
sourcepub async fn batch_get_services(
&mut self,
request: impl IntoRequest<BatchGetServicesRequest>,
) -> Result<Response<BatchGetServicesResponse>, Status>
pub async fn batch_get_services( &mut self, request: impl IntoRequest<BatchGetServicesRequest>, ) -> Result<Response<BatchGetServicesResponse>, Status>
Returns the service configurations and enabled states for a given list of services.
Trait Implementations§
source§impl<T: Clone> Clone for ServiceUsageClient<T>
impl<T: Clone> Clone for ServiceUsageClient<T>
source§fn clone(&self) -> ServiceUsageClient<T>
fn clone(&self) -> ServiceUsageClient<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> !Freeze for ServiceUsageClient<T>
impl<T> RefUnwindSafe for ServiceUsageClient<T>where
T: RefUnwindSafe,
impl<T> Send for ServiceUsageClient<T>where
T: Send,
impl<T> Sync for ServiceUsageClient<T>where
T: Sync,
impl<T> Unpin for ServiceUsageClient<T>where
T: Unpin,
impl<T> UnwindSafe for ServiceUsageClient<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request