#[non_exhaustive]pub struct Usage {
pub requirements: Vec<String>,
pub rules: Vec<UsageRule>,
pub producer_notification_channel: String,
/* private fields */
}
Expand description
Configuration controlling usage of a service.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.requirements: Vec<String>
Requirements that must be satisfied before a consumer project can use the service. Each requirement is of the form <service.name>/<requirement-id>; for example ‘serviceusage.googleapis.com/billing-enabled’.
For Google APIs, a Terms of Service requirement must be included here. Google Cloud APIs must include “serviceusage.googleapis.com/tos/cloud”. Other Google APIs should include “serviceusage.googleapis.com/tos/universal”. Additional ToS can be included based on the business needs.
rules: Vec<UsageRule>
A list of usage rules that apply to individual API methods.
NOTE: All service configuration rules follow “last one wins” order.
producer_notification_channel: String
The full resource name of a channel used for sending notifications to the service producer.
Google Service Management currently only supports Google Cloud Pub/Sub as a notification channel. To use Google Cloud Pub/Sub as the channel, this must be the name of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format documented in https://cloud.google.com/pubsub/docs/overview.
Implementations§
Source§impl Usage
impl Usage
pub fn new() -> Self
Sourcepub fn set_requirements<T, V>(self, v: T) -> Self
pub fn set_requirements<T, V>(self, v: T) -> Self
Sets the value of requirements.
Sourcepub fn set_producer_notification_channel<T: Into<String>>(self, v: T) -> Self
pub fn set_producer_notification_channel<T: Into<String>>(self, v: T) -> Self
Sets the value of producer_notification_channel.