[][src]Struct google_servicecontrol1::ServiceMethods

pub struct ServiceMethods<'a, C, A> where
    C: 'a,
    A: 'a, 
{ /* fields omitted */ }

A builder providing access to all methods supported on service resources. It is not used directly, but through the ServiceControl hub.

Example

Instantiate a resource builder

extern crate hyper;
extern crate hyper_rustls;
extern crate yup_oauth2 as oauth2;
extern crate google_servicecontrol1 as servicecontrol1;
 
use std::default::Default;
use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
use servicecontrol1::ServiceControl;
 
let secret: ApplicationSecret = Default::default();
let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate,
                              hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())),
                              <MemoryStorage as Default>::default(), None);
let mut hub = ServiceControl::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `allocate_quota(...)`, `check(...)` and `report(...)`
// to build up your call.
let rb = hub.services();

Methods

impl<'a, C, A> ServiceMethods<'a, C, A>[src]

pub fn check(
    &self,
    request: CheckRequest,
    service_name: &str
) -> ServiceCheckCall<'a, C, A>
[src]

Create a builder to help you perform the following task:

Checks whether an operation on a service should be allowed to proceed based on the configuration of the service and related policies. It must be called before the operation is executed.

If feasible, the client should cache the check results and reuse them for 60 seconds. In case of any server errors, the client should rely on the cached results for much longer time to avoid outage. WARNING: There is general 60s delay for the configuration and policy propagation, therefore callers MUST NOT depend on the Check method having the latest policy information.

NOTE: the CheckRequest has the size limit of 64KB.

This method requires the servicemanagement.services.check permission on the specified service. For more information, see Cloud IAM.

Arguments

  • request - No description provided.
  • serviceName - The service name as specified in its service configuration. For example, "pubsub.googleapis.com". See google.api.Service for the definition of a service name.

pub fn report(
    &self,
    request: ReportRequest,
    service_name: &str
) -> ServiceReportCall<'a, C, A>
[src]

Create a builder to help you perform the following task:

Reports operation results to Google Service Control, such as logs and metrics. It should be called after an operation is completed.

If feasible, the client should aggregate reporting data for up to 5 seconds to reduce API traffic. Limiting aggregation to 5 seconds is to reduce data loss during client crashes. Clients should carefully choose the aggregation time window to avoid data loss risk more than 0.01% for business and compliance reasons.

NOTE: the ReportRequest has the size limit (wire-format byte size) of 1MB.

This method requires the servicemanagement.services.report permission on the specified service. For more information, see Google Cloud IAM.

Arguments

  • request - No description provided.
  • serviceName - The service name as specified in its service configuration. For example, "pubsub.googleapis.com". See google.api.Service for the definition of a service name.

pub fn allocate_quota(
    &self,
    request: AllocateQuotaRequest,
    service_name: &str
) -> ServiceAllocateQuotaCall<'a, C, A>
[src]

Create a builder to help you perform the following task:

Attempts to allocate quota for the specified consumer. It should be called before the operation is executed.

This method requires the servicemanagement.services.quota permission on the specified service. For more information, see Cloud IAM.

NOTE: The client must fail-open on server errors INTERNAL, UNKNOWN, DEADLINE_EXCEEDED, and UNAVAILABLE. To ensure system reliability, the server may inject these errors to prohibit any hard dependency on the quota functionality.

Arguments

  • request - No description provided.
  • serviceName - Name of the service as specified in the service configuration. For example, "pubsub.googleapis.com". See google.api.Service for the definition of a service name.

Trait Implementations

impl<'a, C, A> MethodsBuilder for ServiceMethods<'a, C, A>[src]

Auto Trait Implementations

impl<'a, C, A> !RefUnwindSafe for ServiceMethods<'a, C, A>

impl<'a, C, A> !Send for ServiceMethods<'a, C, A>

impl<'a, C, A> !Sync for ServiceMethods<'a, C, A>

impl<'a, C, A> Unpin for ServiceMethods<'a, C, A>

impl<'a, C, A> !UnwindSafe for ServiceMethods<'a, C, A>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any