#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_rpc;
extern crate google_cloud_rpc_context;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CheckRequest {
pub service_name: std::string::String,
pub service_config_id: std::string::String,
pub attributes: std::option::Option<google_cloud_rpc_context::model::AttributeContext>,
pub resources: std::vec::Vec<crate::model::ResourceInfo>,
pub flags: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CheckRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_name = v.into();
self
}
pub fn set_service_config_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_config_id = v.into();
self
}
pub fn set_attributes<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc_context::model::AttributeContext>,
{
self.attributes = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_attributes<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc_context::model::AttributeContext>,
{
self.attributes = v.map(|x| x.into());
self
}
pub fn set_resources<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ResourceInfo>,
{
use std::iter::Iterator;
self.resources = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_flags<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.flags = v.into();
self
}
}
impl wkt::message::Message for CheckRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.api.servicecontrol.v2.CheckRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourceInfo {
pub name: std::string::String,
pub r#type: std::string::String,
pub permission: std::string::String,
pub container: std::string::String,
pub location: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourceInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_permission<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.permission = v.into();
self
}
pub fn set_container<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.container = v.into();
self
}
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
}
impl wkt::message::Message for ResourceInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.api.servicecontrol.v2.ResourceInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CheckResponse {
pub status: std::option::Option<google_cloud_rpc::model::Status>,
pub headers: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CheckResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.status = v.map(|x| x.into());
self
}
pub fn set_headers<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.headers = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for CheckResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.api.servicecontrol.v2.CheckResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReportRequest {
pub service_name: std::string::String,
pub service_config_id: std::string::String,
pub operations: std::vec::Vec<google_cloud_rpc_context::model::AttributeContext>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReportRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_name = v.into();
self
}
pub fn set_service_config_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_config_id = v.into();
self
}
pub fn set_operations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<google_cloud_rpc_context::model::AttributeContext>,
{
use std::iter::Iterator;
self.operations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ReportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.api.servicecontrol.v2.ReportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReportResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReportResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for ReportResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.api.servicecontrol.v2.ReportResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourceInfoList {
pub resources: std::vec::Vec<crate::model::ResourceInfo>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourceInfoList {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_resources<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ResourceInfo>,
{
use std::iter::Iterator;
self.resources = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ResourceInfoList {
fn typename() -> &'static str {
"type.googleapis.com/google.api.servicecontrol.v2.ResourceInfoList"
}
}