pub mod alert_policy_service {
use crate::Result;
use std::sync::Arc;
#[derive(Clone, Debug)]
pub struct RequestBuilder<R: std::default::Default> {
stub: Arc<dyn crate::stubs::dynamic::AlertPolicyService>,
request: R,
options: gax::options::RequestOptions,
}
impl<R> RequestBuilder<R>
where
R: std::default::Default,
{
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::AlertPolicyService>) -> Self {
Self {
stub,
request: R::default(),
options: gax::options::RequestOptions::default(),
}
}
}
#[derive(Clone, Debug)]
pub struct ListAlertPolicies(RequestBuilder<crate::model::ListAlertPoliciesRequest>);
impl ListAlertPolicies {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::AlertPolicyService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListAlertPoliciesRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::ListAlertPoliciesResponse> {
(*self.0.stub)
.list_alert_policies(self.0.request, self.0.options)
.await
}
#[cfg(feature = "unstable-stream")]
pub async fn stream(
self,
) -> gax::paginator::Paginator<crate::model::ListAlertPoliciesResponse, gax::error::Error>
{
let token = gax::paginator::extract_token(&self.0.request.page_token);
let execute = move |token: String| {
let builder = self.clone();
builder.0.request.clone().set_page_token(token);
builder.send()
};
gax::paginator::Paginator::new(token, execute)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.filter = v.into();
self
}
pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.order_by = v.into();
self
}
pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
self.0.request.page_size = v.into();
self
}
pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.page_token = v.into();
self
}
}
impl gax::options::RequestBuilder for ListAlertPolicies {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetAlertPolicy(RequestBuilder<crate::model::GetAlertPolicyRequest>);
impl GetAlertPolicy {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::AlertPolicyService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetAlertPolicyRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::AlertPolicy> {
(*self.0.stub)
.get_alert_policy(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
impl gax::options::RequestBuilder for GetAlertPolicy {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct CreateAlertPolicy(RequestBuilder<crate::model::CreateAlertPolicyRequest>);
impl CreateAlertPolicy {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::AlertPolicyService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::CreateAlertPolicyRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::AlertPolicy> {
(*self.0.stub)
.create_alert_policy(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_alert_policy<T: Into<std::option::Option<crate::model::AlertPolicy>>>(
mut self,
v: T,
) -> Self {
self.0.request.alert_policy = v.into();
self
}
}
impl gax::options::RequestBuilder for CreateAlertPolicy {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct DeleteAlertPolicy(RequestBuilder<crate::model::DeleteAlertPolicyRequest>);
impl DeleteAlertPolicy {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::AlertPolicyService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::DeleteAlertPolicyRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<wkt::Empty> {
(*self.0.stub)
.delete_alert_policy(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
impl gax::options::RequestBuilder for DeleteAlertPolicy {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct UpdateAlertPolicy(RequestBuilder<crate::model::UpdateAlertPolicyRequest>);
impl UpdateAlertPolicy {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::AlertPolicyService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::UpdateAlertPolicyRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::AlertPolicy> {
(*self.0.stub)
.update_alert_policy(self.0.request, self.0.options)
.await
}
pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
mut self,
v: T,
) -> Self {
self.0.request.update_mask = v.into();
self
}
pub fn set_alert_policy<T: Into<std::option::Option<crate::model::AlertPolicy>>>(
mut self,
v: T,
) -> Self {
self.0.request.alert_policy = v.into();
self
}
}
impl gax::options::RequestBuilder for UpdateAlertPolicy {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
}
pub mod group_service {
use crate::Result;
use std::sync::Arc;
#[derive(Clone, Debug)]
pub struct RequestBuilder<R: std::default::Default> {
stub: Arc<dyn crate::stubs::dynamic::GroupService>,
request: R,
options: gax::options::RequestOptions,
}
impl<R> RequestBuilder<R>
where
R: std::default::Default,
{
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::GroupService>) -> Self {
Self {
stub,
request: R::default(),
options: gax::options::RequestOptions::default(),
}
}
}
#[derive(Clone, Debug)]
pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
impl ListGroups {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::GroupService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
(*self.0.stub)
.list_groups(self.0.request, self.0.options)
.await
}
#[cfg(feature = "unstable-stream")]
pub async fn stream(
self,
) -> gax::paginator::Paginator<crate::model::ListGroupsResponse, gax::error::Error>
{
let token = gax::paginator::extract_token(&self.0.request.page_token);
let execute = move |token: String| {
let builder = self.clone();
builder.0.request.clone().set_page_token(token);
builder.send()
};
gax::paginator::Paginator::new(token, execute)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
self.0.request.page_size = v.into();
self
}
pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.page_token = v.into();
self
}
pub fn set_filter<T: Into<Option<crate::model::list_groups_request::Filter>>>(
mut self,
v: T,
) -> Self {
self.0.request.filter = v.into();
self
}
}
impl gax::options::RequestBuilder for ListGroups {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
impl GetGroup {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::GroupService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::Group> {
(*self.0.stub)
.get_group(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
impl gax::options::RequestBuilder for GetGroup {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct CreateGroup(RequestBuilder<crate::model::CreateGroupRequest>);
impl CreateGroup {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::GroupService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::CreateGroupRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::Group> {
(*self.0.stub)
.create_group(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_group<T: Into<std::option::Option<crate::model::Group>>>(
mut self,
v: T,
) -> Self {
self.0.request.group = v.into();
self
}
pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
self.0.request.validate_only = v.into();
self
}
}
impl gax::options::RequestBuilder for CreateGroup {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
impl UpdateGroup {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::GroupService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::UpdateGroupRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::Group> {
(*self.0.stub)
.update_group(self.0.request, self.0.options)
.await
}
pub fn set_group<T: Into<std::option::Option<crate::model::Group>>>(
mut self,
v: T,
) -> Self {
self.0.request.group = v.into();
self
}
pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
self.0.request.validate_only = v.into();
self
}
}
impl gax::options::RequestBuilder for UpdateGroup {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct DeleteGroup(RequestBuilder<crate::model::DeleteGroupRequest>);
impl DeleteGroup {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::GroupService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::DeleteGroupRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<wkt::Empty> {
(*self.0.stub)
.delete_group(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_recursive<T: Into<bool>>(mut self, v: T) -> Self {
self.0.request.recursive = v.into();
self
}
}
impl gax::options::RequestBuilder for DeleteGroup {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct ListGroupMembers(RequestBuilder<crate::model::ListGroupMembersRequest>);
impl ListGroupMembers {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::GroupService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListGroupMembersRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::ListGroupMembersResponse> {
(*self.0.stub)
.list_group_members(self.0.request, self.0.options)
.await
}
#[cfg(feature = "unstable-stream")]
pub async fn stream(
self,
) -> gax::paginator::Paginator<crate::model::ListGroupMembersResponse, gax::error::Error>
{
let token = gax::paginator::extract_token(&self.0.request.page_token);
let execute = move |token: String| {
let builder = self.clone();
builder.0.request.clone().set_page_token(token);
builder.send()
};
gax::paginator::Paginator::new(token, execute)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
self.0.request.page_size = v.into();
self
}
pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.page_token = v.into();
self
}
pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.filter = v.into();
self
}
pub fn set_interval<T: Into<std::option::Option<crate::model::TimeInterval>>>(
mut self,
v: T,
) -> Self {
self.0.request.interval = v.into();
self
}
}
impl gax::options::RequestBuilder for ListGroupMembers {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
}
pub mod metric_service {
use crate::Result;
use std::sync::Arc;
#[derive(Clone, Debug)]
pub struct RequestBuilder<R: std::default::Default> {
stub: Arc<dyn crate::stubs::dynamic::MetricService>,
request: R,
options: gax::options::RequestOptions,
}
impl<R> RequestBuilder<R>
where
R: std::default::Default,
{
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::MetricService>) -> Self {
Self {
stub,
request: R::default(),
options: gax::options::RequestOptions::default(),
}
}
}
#[derive(Clone, Debug)]
pub struct ListMonitoredResourceDescriptors(
RequestBuilder<crate::model::ListMonitoredResourceDescriptorsRequest>,
);
impl ListMonitoredResourceDescriptors {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::MetricService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListMonitoredResourceDescriptorsRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::ListMonitoredResourceDescriptorsResponse> {
(*self.0.stub)
.list_monitored_resource_descriptors(self.0.request, self.0.options)
.await
}
#[cfg(feature = "unstable-stream")]
pub async fn stream(
self,
) -> gax::paginator::Paginator<
crate::model::ListMonitoredResourceDescriptorsResponse,
gax::error::Error,
> {
let token = gax::paginator::extract_token(&self.0.request.page_token);
let execute = move |token: String| {
let builder = self.clone();
builder.0.request.clone().set_page_token(token);
builder.send()
};
gax::paginator::Paginator::new(token, execute)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.filter = v.into();
self
}
pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
self.0.request.page_size = v.into();
self
}
pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.page_token = v.into();
self
}
}
impl gax::options::RequestBuilder for ListMonitoredResourceDescriptors {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetMonitoredResourceDescriptor(
RequestBuilder<crate::model::GetMonitoredResourceDescriptorRequest>,
);
impl GetMonitoredResourceDescriptor {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::MetricService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetMonitoredResourceDescriptorRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<api::model::MonitoredResourceDescriptor> {
(*self.0.stub)
.get_monitored_resource_descriptor(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
impl gax::options::RequestBuilder for GetMonitoredResourceDescriptor {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct ListMetricDescriptors(RequestBuilder<crate::model::ListMetricDescriptorsRequest>);
impl ListMetricDescriptors {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::MetricService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListMetricDescriptorsRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::ListMetricDescriptorsResponse> {
(*self.0.stub)
.list_metric_descriptors(self.0.request, self.0.options)
.await
}
#[cfg(feature = "unstable-stream")]
pub async fn stream(
self,
) -> gax::paginator::Paginator<crate::model::ListMetricDescriptorsResponse, gax::error::Error>
{
let token = gax::paginator::extract_token(&self.0.request.page_token);
let execute = move |token: String| {
let builder = self.clone();
builder.0.request.clone().set_page_token(token);
builder.send()
};
gax::paginator::Paginator::new(token, execute)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.filter = v.into();
self
}
pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
self.0.request.page_size = v.into();
self
}
pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.page_token = v.into();
self
}
pub fn set_active_only<T: Into<bool>>(mut self, v: T) -> Self {
self.0.request.active_only = v.into();
self
}
}
impl gax::options::RequestBuilder for ListMetricDescriptors {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetMetricDescriptor(RequestBuilder<crate::model::GetMetricDescriptorRequest>);
impl GetMetricDescriptor {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::MetricService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetMetricDescriptorRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<api::model::MetricDescriptor> {
(*self.0.stub)
.get_metric_descriptor(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
impl gax::options::RequestBuilder for GetMetricDescriptor {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct CreateMetricDescriptor(RequestBuilder<crate::model::CreateMetricDescriptorRequest>);
impl CreateMetricDescriptor {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::MetricService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::CreateMetricDescriptorRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<api::model::MetricDescriptor> {
(*self.0.stub)
.create_metric_descriptor(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_metric_descriptor<T: Into<std::option::Option<api::model::MetricDescriptor>>>(
mut self,
v: T,
) -> Self {
self.0.request.metric_descriptor = v.into();
self
}
}
impl gax::options::RequestBuilder for CreateMetricDescriptor {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct DeleteMetricDescriptor(RequestBuilder<crate::model::DeleteMetricDescriptorRequest>);
impl DeleteMetricDescriptor {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::MetricService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::DeleteMetricDescriptorRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<wkt::Empty> {
(*self.0.stub)
.delete_metric_descriptor(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
impl gax::options::RequestBuilder for DeleteMetricDescriptor {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct ListTimeSeries(RequestBuilder<crate::model::ListTimeSeriesRequest>);
impl ListTimeSeries {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::MetricService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListTimeSeriesRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::ListTimeSeriesResponse> {
(*self.0.stub)
.list_time_series(self.0.request, self.0.options)
.await
}
#[cfg(feature = "unstable-stream")]
pub async fn stream(
self,
) -> gax::paginator::Paginator<crate::model::ListTimeSeriesResponse, gax::error::Error>
{
let token = gax::paginator::extract_token(&self.0.request.page_token);
let execute = move |token: String| {
let builder = self.clone();
builder.0.request.clone().set_page_token(token);
builder.send()
};
gax::paginator::Paginator::new(token, execute)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.filter = v.into();
self
}
pub fn set_interval<T: Into<std::option::Option<crate::model::TimeInterval>>>(
mut self,
v: T,
) -> Self {
self.0.request.interval = v.into();
self
}
pub fn set_aggregation<T: Into<std::option::Option<crate::model::Aggregation>>>(
mut self,
v: T,
) -> Self {
self.0.request.aggregation = v.into();
self
}
pub fn set_secondary_aggregation<
T: Into<std::option::Option<crate::model::Aggregation>>,
>(
mut self,
v: T,
) -> Self {
self.0.request.secondary_aggregation = v.into();
self
}
pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.order_by = v.into();
self
}
pub fn set_view<T: Into<crate::model::list_time_series_request::TimeSeriesView>>(
mut self,
v: T,
) -> Self {
self.0.request.view = v.into();
self
}
pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
self.0.request.page_size = v.into();
self
}
pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.page_token = v.into();
self
}
}
impl gax::options::RequestBuilder for ListTimeSeries {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct CreateTimeSeries(RequestBuilder<crate::model::CreateTimeSeriesRequest>);
impl CreateTimeSeries {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::MetricService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::CreateTimeSeriesRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<wkt::Empty> {
(*self.0.stub)
.create_time_series(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_time_series<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TimeSeries>,
{
use std::iter::Iterator;
self.0.request.time_series = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl gax::options::RequestBuilder for CreateTimeSeries {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct CreateServiceTimeSeries(RequestBuilder<crate::model::CreateTimeSeriesRequest>);
impl CreateServiceTimeSeries {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::MetricService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::CreateTimeSeriesRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<wkt::Empty> {
(*self.0.stub)
.create_service_time_series(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_time_series<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TimeSeries>,
{
use std::iter::Iterator;
self.0.request.time_series = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl gax::options::RequestBuilder for CreateServiceTimeSeries {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
}
pub mod notification_channel_service {
use crate::Result;
use std::sync::Arc;
#[derive(Clone, Debug)]
pub struct RequestBuilder<R: std::default::Default> {
stub: Arc<dyn crate::stubs::dynamic::NotificationChannelService>,
request: R,
options: gax::options::RequestOptions,
}
impl<R> RequestBuilder<R>
where
R: std::default::Default,
{
pub(crate) fn new(
stub: Arc<dyn crate::stubs::dynamic::NotificationChannelService>,
) -> Self {
Self {
stub,
request: R::default(),
options: gax::options::RequestOptions::default(),
}
}
}
#[derive(Clone, Debug)]
pub struct ListNotificationChannelDescriptors(
RequestBuilder<crate::model::ListNotificationChannelDescriptorsRequest>,
);
impl ListNotificationChannelDescriptors {
pub(crate) fn new(
stub: Arc<dyn crate::stubs::dynamic::NotificationChannelService>,
) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListNotificationChannelDescriptorsRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(
self,
) -> Result<crate::model::ListNotificationChannelDescriptorsResponse> {
(*self.0.stub)
.list_notification_channel_descriptors(self.0.request, self.0.options)
.await
}
#[cfg(feature = "unstable-stream")]
pub async fn stream(
self,
) -> gax::paginator::Paginator<
crate::model::ListNotificationChannelDescriptorsResponse,
gax::error::Error,
> {
let token = gax::paginator::extract_token(&self.0.request.page_token);
let execute = move |token: String| {
let builder = self.clone();
builder.0.request.clone().set_page_token(token);
builder.send()
};
gax::paginator::Paginator::new(token, execute)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
self.0.request.page_size = v.into();
self
}
pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.page_token = v.into();
self
}
}
impl gax::options::RequestBuilder for ListNotificationChannelDescriptors {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetNotificationChannelDescriptor(
RequestBuilder<crate::model::GetNotificationChannelDescriptorRequest>,
);
impl GetNotificationChannelDescriptor {
pub(crate) fn new(
stub: Arc<dyn crate::stubs::dynamic::NotificationChannelService>,
) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetNotificationChannelDescriptorRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::NotificationChannelDescriptor> {
(*self.0.stub)
.get_notification_channel_descriptor(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
impl gax::options::RequestBuilder for GetNotificationChannelDescriptor {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct ListNotificationChannels(
RequestBuilder<crate::model::ListNotificationChannelsRequest>,
);
impl ListNotificationChannels {
pub(crate) fn new(
stub: Arc<dyn crate::stubs::dynamic::NotificationChannelService>,
) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListNotificationChannelsRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::ListNotificationChannelsResponse> {
(*self.0.stub)
.list_notification_channels(self.0.request, self.0.options)
.await
}
#[cfg(feature = "unstable-stream")]
pub async fn stream(
self,
) -> gax::paginator::Paginator<
crate::model::ListNotificationChannelsResponse,
gax::error::Error,
> {
let token = gax::paginator::extract_token(&self.0.request.page_token);
let execute = move |token: String| {
let builder = self.clone();
builder.0.request.clone().set_page_token(token);
builder.send()
};
gax::paginator::Paginator::new(token, execute)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.filter = v.into();
self
}
pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.order_by = v.into();
self
}
pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
self.0.request.page_size = v.into();
self
}
pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.page_token = v.into();
self
}
}
impl gax::options::RequestBuilder for ListNotificationChannels {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetNotificationChannel(RequestBuilder<crate::model::GetNotificationChannelRequest>);
impl GetNotificationChannel {
pub(crate) fn new(
stub: Arc<dyn crate::stubs::dynamic::NotificationChannelService>,
) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetNotificationChannelRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::NotificationChannel> {
(*self.0.stub)
.get_notification_channel(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
impl gax::options::RequestBuilder for GetNotificationChannel {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct CreateNotificationChannel(
RequestBuilder<crate::model::CreateNotificationChannelRequest>,
);
impl CreateNotificationChannel {
pub(crate) fn new(
stub: Arc<dyn crate::stubs::dynamic::NotificationChannelService>,
) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::CreateNotificationChannelRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::NotificationChannel> {
(*self.0.stub)
.create_notification_channel(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_notification_channel<
T: Into<std::option::Option<crate::model::NotificationChannel>>,
>(
mut self,
v: T,
) -> Self {
self.0.request.notification_channel = v.into();
self
}
}
impl gax::options::RequestBuilder for CreateNotificationChannel {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct UpdateNotificationChannel(
RequestBuilder<crate::model::UpdateNotificationChannelRequest>,
);
impl UpdateNotificationChannel {
pub(crate) fn new(
stub: Arc<dyn crate::stubs::dynamic::NotificationChannelService>,
) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::UpdateNotificationChannelRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::NotificationChannel> {
(*self.0.stub)
.update_notification_channel(self.0.request, self.0.options)
.await
}
pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
mut self,
v: T,
) -> Self {
self.0.request.update_mask = v.into();
self
}
pub fn set_notification_channel<
T: Into<std::option::Option<crate::model::NotificationChannel>>,
>(
mut self,
v: T,
) -> Self {
self.0.request.notification_channel = v.into();
self
}
}
impl gax::options::RequestBuilder for UpdateNotificationChannel {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct DeleteNotificationChannel(
RequestBuilder<crate::model::DeleteNotificationChannelRequest>,
);
impl DeleteNotificationChannel {
pub(crate) fn new(
stub: Arc<dyn crate::stubs::dynamic::NotificationChannelService>,
) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::DeleteNotificationChannelRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<wkt::Empty> {
(*self.0.stub)
.delete_notification_channel(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
self.0.request.force = v.into();
self
}
}
impl gax::options::RequestBuilder for DeleteNotificationChannel {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct SendNotificationChannelVerificationCode(
RequestBuilder<crate::model::SendNotificationChannelVerificationCodeRequest>,
);
impl SendNotificationChannelVerificationCode {
pub(crate) fn new(
stub: Arc<dyn crate::stubs::dynamic::NotificationChannelService>,
) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<
V: Into<crate::model::SendNotificationChannelVerificationCodeRequest>,
>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<wkt::Empty> {
(*self.0.stub)
.send_notification_channel_verification_code(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
impl gax::options::RequestBuilder for SendNotificationChannelVerificationCode {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetNotificationChannelVerificationCode(
RequestBuilder<crate::model::GetNotificationChannelVerificationCodeRequest>,
);
impl GetNotificationChannelVerificationCode {
pub(crate) fn new(
stub: Arc<dyn crate::stubs::dynamic::NotificationChannelService>,
) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<
V: Into<crate::model::GetNotificationChannelVerificationCodeRequest>,
>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(
self,
) -> Result<crate::model::GetNotificationChannelVerificationCodeResponse> {
(*self.0.stub)
.get_notification_channel_verification_code(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_expire_time<T: Into<std::option::Option<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.0.request.expire_time = v.into();
self
}
}
impl gax::options::RequestBuilder for GetNotificationChannelVerificationCode {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct VerifyNotificationChannel(
RequestBuilder<crate::model::VerifyNotificationChannelRequest>,
);
impl VerifyNotificationChannel {
pub(crate) fn new(
stub: Arc<dyn crate::stubs::dynamic::NotificationChannelService>,
) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::VerifyNotificationChannelRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::NotificationChannel> {
(*self.0.stub)
.verify_notification_channel(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.code = v.into();
self
}
}
impl gax::options::RequestBuilder for VerifyNotificationChannel {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
}
pub mod query_service {
use crate::Result;
use std::sync::Arc;
#[derive(Clone, Debug)]
pub struct RequestBuilder<R: std::default::Default> {
stub: Arc<dyn crate::stubs::dynamic::QueryService>,
request: R,
options: gax::options::RequestOptions,
}
impl<R> RequestBuilder<R>
where
R: std::default::Default,
{
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::QueryService>) -> Self {
Self {
stub,
request: R::default(),
options: gax::options::RequestOptions::default(),
}
}
}
#[derive(Clone, Debug)]
pub struct QueryTimeSeries(RequestBuilder<crate::model::QueryTimeSeriesRequest>);
impl QueryTimeSeries {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::QueryService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::QueryTimeSeriesRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::QueryTimeSeriesResponse> {
(*self.0.stub)
.query_time_series(self.0.request, self.0.options)
.await
}
#[cfg(feature = "unstable-stream")]
pub async fn stream(
self,
) -> gax::paginator::Paginator<crate::model::QueryTimeSeriesResponse, gax::error::Error>
{
let token = gax::paginator::extract_token(&self.0.request.page_token);
let execute = move |token: String| {
let builder = self.clone();
builder.0.request.clone().set_page_token(token);
builder.send()
};
gax::paginator::Paginator::new(token, execute)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.query = v.into();
self
}
pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
self.0.request.page_size = v.into();
self
}
pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.page_token = v.into();
self
}
}
impl gax::options::RequestBuilder for QueryTimeSeries {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
}
pub mod service_monitoring_service {
use crate::Result;
use std::sync::Arc;
#[derive(Clone, Debug)]
pub struct RequestBuilder<R: std::default::Default> {
stub: Arc<dyn crate::stubs::dynamic::ServiceMonitoringService>,
request: R,
options: gax::options::RequestOptions,
}
impl<R> RequestBuilder<R>
where
R: std::default::Default,
{
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::ServiceMonitoringService>) -> Self {
Self {
stub,
request: R::default(),
options: gax::options::RequestOptions::default(),
}
}
}
#[derive(Clone, Debug)]
pub struct CreateService(RequestBuilder<crate::model::CreateServiceRequest>);
impl CreateService {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::ServiceMonitoringService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::CreateServiceRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::Service> {
(*self.0.stub)
.create_service(self.0.request, self.0.options)
.await
}
pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.parent = v.into();
self
}
pub fn set_service_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.service_id = v.into();
self
}
pub fn set_service<T: Into<std::option::Option<crate::model::Service>>>(
mut self,
v: T,
) -> Self {
self.0.request.service = v.into();
self
}
}
impl gax::options::RequestBuilder for CreateService {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetService(RequestBuilder<crate::model::GetServiceRequest>);
impl GetService {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::ServiceMonitoringService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetServiceRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::Service> {
(*self.0.stub)
.get_service(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
impl gax::options::RequestBuilder for GetService {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct ListServices(RequestBuilder<crate::model::ListServicesRequest>);
impl ListServices {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::ServiceMonitoringService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListServicesRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::ListServicesResponse> {
(*self.0.stub)
.list_services(self.0.request, self.0.options)
.await
}
#[cfg(feature = "unstable-stream")]
pub async fn stream(
self,
) -> gax::paginator::Paginator<crate::model::ListServicesResponse, gax::error::Error>
{
let token = gax::paginator::extract_token(&self.0.request.page_token);
let execute = move |token: String| {
let builder = self.clone();
builder.0.request.clone().set_page_token(token);
builder.send()
};
gax::paginator::Paginator::new(token, execute)
}
pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.parent = v.into();
self
}
pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.filter = v.into();
self
}
pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
self.0.request.page_size = v.into();
self
}
pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.page_token = v.into();
self
}
}
impl gax::options::RequestBuilder for ListServices {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct UpdateService(RequestBuilder<crate::model::UpdateServiceRequest>);
impl UpdateService {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::ServiceMonitoringService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::UpdateServiceRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::Service> {
(*self.0.stub)
.update_service(self.0.request, self.0.options)
.await
}
pub fn set_service<T: Into<std::option::Option<crate::model::Service>>>(
mut self,
v: T,
) -> Self {
self.0.request.service = v.into();
self
}
pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
mut self,
v: T,
) -> Self {
self.0.request.update_mask = v.into();
self
}
}
impl gax::options::RequestBuilder for UpdateService {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct DeleteService(RequestBuilder<crate::model::DeleteServiceRequest>);
impl DeleteService {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::ServiceMonitoringService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::DeleteServiceRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<wkt::Empty> {
(*self.0.stub)
.delete_service(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
impl gax::options::RequestBuilder for DeleteService {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct CreateServiceLevelObjective(
RequestBuilder<crate::model::CreateServiceLevelObjectiveRequest>,
);
impl CreateServiceLevelObjective {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::ServiceMonitoringService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::CreateServiceLevelObjectiveRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::ServiceLevelObjective> {
(*self.0.stub)
.create_service_level_objective(self.0.request, self.0.options)
.await
}
pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.parent = v.into();
self
}
pub fn set_service_level_objective_id<T: Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.0.request.service_level_objective_id = v.into();
self
}
pub fn set_service_level_objective<
T: Into<std::option::Option<crate::model::ServiceLevelObjective>>,
>(
mut self,
v: T,
) -> Self {
self.0.request.service_level_objective = v.into();
self
}
}
impl gax::options::RequestBuilder for CreateServiceLevelObjective {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetServiceLevelObjective(
RequestBuilder<crate::model::GetServiceLevelObjectiveRequest>,
);
impl GetServiceLevelObjective {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::ServiceMonitoringService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetServiceLevelObjectiveRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::ServiceLevelObjective> {
(*self.0.stub)
.get_service_level_objective(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
pub fn set_view<T: Into<crate::model::service_level_objective::View>>(
mut self,
v: T,
) -> Self {
self.0.request.view = v.into();
self
}
}
impl gax::options::RequestBuilder for GetServiceLevelObjective {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct ListServiceLevelObjectives(
RequestBuilder<crate::model::ListServiceLevelObjectivesRequest>,
);
impl ListServiceLevelObjectives {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::ServiceMonitoringService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListServiceLevelObjectivesRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::ListServiceLevelObjectivesResponse> {
(*self.0.stub)
.list_service_level_objectives(self.0.request, self.0.options)
.await
}
#[cfg(feature = "unstable-stream")]
pub async fn stream(
self,
) -> gax::paginator::Paginator<
crate::model::ListServiceLevelObjectivesResponse,
gax::error::Error,
> {
let token = gax::paginator::extract_token(&self.0.request.page_token);
let execute = move |token: String| {
let builder = self.clone();
builder.0.request.clone().set_page_token(token);
builder.send()
};
gax::paginator::Paginator::new(token, execute)
}
pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.parent = v.into();
self
}
pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.filter = v.into();
self
}
pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
self.0.request.page_size = v.into();
self
}
pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.page_token = v.into();
self
}
pub fn set_view<T: Into<crate::model::service_level_objective::View>>(
mut self,
v: T,
) -> Self {
self.0.request.view = v.into();
self
}
}
impl gax::options::RequestBuilder for ListServiceLevelObjectives {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct UpdateServiceLevelObjective(
RequestBuilder<crate::model::UpdateServiceLevelObjectiveRequest>,
);
impl UpdateServiceLevelObjective {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::ServiceMonitoringService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::UpdateServiceLevelObjectiveRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::ServiceLevelObjective> {
(*self.0.stub)
.update_service_level_objective(self.0.request, self.0.options)
.await
}
pub fn set_service_level_objective<
T: Into<std::option::Option<crate::model::ServiceLevelObjective>>,
>(
mut self,
v: T,
) -> Self {
self.0.request.service_level_objective = v.into();
self
}
pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
mut self,
v: T,
) -> Self {
self.0.request.update_mask = v.into();
self
}
}
impl gax::options::RequestBuilder for UpdateServiceLevelObjective {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct DeleteServiceLevelObjective(
RequestBuilder<crate::model::DeleteServiceLevelObjectiveRequest>,
);
impl DeleteServiceLevelObjective {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::ServiceMonitoringService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::DeleteServiceLevelObjectiveRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<wkt::Empty> {
(*self.0.stub)
.delete_service_level_objective(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
impl gax::options::RequestBuilder for DeleteServiceLevelObjective {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
}
pub mod snooze_service {
use crate::Result;
use std::sync::Arc;
#[derive(Clone, Debug)]
pub struct RequestBuilder<R: std::default::Default> {
stub: Arc<dyn crate::stubs::dynamic::SnoozeService>,
request: R,
options: gax::options::RequestOptions,
}
impl<R> RequestBuilder<R>
where
R: std::default::Default,
{
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SnoozeService>) -> Self {
Self {
stub,
request: R::default(),
options: gax::options::RequestOptions::default(),
}
}
}
#[derive(Clone, Debug)]
pub struct CreateSnooze(RequestBuilder<crate::model::CreateSnoozeRequest>);
impl CreateSnooze {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SnoozeService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::CreateSnoozeRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::Snooze> {
(*self.0.stub)
.create_snooze(self.0.request, self.0.options)
.await
}
pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.parent = v.into();
self
}
pub fn set_snooze<T: Into<std::option::Option<crate::model::Snooze>>>(
mut self,
v: T,
) -> Self {
self.0.request.snooze = v.into();
self
}
}
impl gax::options::RequestBuilder for CreateSnooze {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct ListSnoozes(RequestBuilder<crate::model::ListSnoozesRequest>);
impl ListSnoozes {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SnoozeService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListSnoozesRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::ListSnoozesResponse> {
(*self.0.stub)
.list_snoozes(self.0.request, self.0.options)
.await
}
#[cfg(feature = "unstable-stream")]
pub async fn stream(
self,
) -> gax::paginator::Paginator<crate::model::ListSnoozesResponse, gax::error::Error>
{
let token = gax::paginator::extract_token(&self.0.request.page_token);
let execute = move |token: String| {
let builder = self.clone();
builder.0.request.clone().set_page_token(token);
builder.send()
};
gax::paginator::Paginator::new(token, execute)
}
pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.parent = v.into();
self
}
pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.filter = v.into();
self
}
pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
self.0.request.page_size = v.into();
self
}
pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.page_token = v.into();
self
}
}
impl gax::options::RequestBuilder for ListSnoozes {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetSnooze(RequestBuilder<crate::model::GetSnoozeRequest>);
impl GetSnooze {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SnoozeService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetSnoozeRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::Snooze> {
(*self.0.stub)
.get_snooze(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
impl gax::options::RequestBuilder for GetSnooze {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct UpdateSnooze(RequestBuilder<crate::model::UpdateSnoozeRequest>);
impl UpdateSnooze {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::SnoozeService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::UpdateSnoozeRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::Snooze> {
(*self.0.stub)
.update_snooze(self.0.request, self.0.options)
.await
}
pub fn set_snooze<T: Into<std::option::Option<crate::model::Snooze>>>(
mut self,
v: T,
) -> Self {
self.0.request.snooze = v.into();
self
}
pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
mut self,
v: T,
) -> Self {
self.0.request.update_mask = v.into();
self
}
}
impl gax::options::RequestBuilder for UpdateSnooze {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
}
pub mod uptime_check_service {
use crate::Result;
use std::sync::Arc;
#[derive(Clone, Debug)]
pub struct RequestBuilder<R: std::default::Default> {
stub: Arc<dyn crate::stubs::dynamic::UptimeCheckService>,
request: R,
options: gax::options::RequestOptions,
}
impl<R> RequestBuilder<R>
where
R: std::default::Default,
{
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::UptimeCheckService>) -> Self {
Self {
stub,
request: R::default(),
options: gax::options::RequestOptions::default(),
}
}
}
#[derive(Clone, Debug)]
pub struct ListUptimeCheckConfigs(RequestBuilder<crate::model::ListUptimeCheckConfigsRequest>);
impl ListUptimeCheckConfigs {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::UptimeCheckService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListUptimeCheckConfigsRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::ListUptimeCheckConfigsResponse> {
(*self.0.stub)
.list_uptime_check_configs(self.0.request, self.0.options)
.await
}
#[cfg(feature = "unstable-stream")]
pub async fn stream(
self,
) -> gax::paginator::Paginator<
crate::model::ListUptimeCheckConfigsResponse,
gax::error::Error,
> {
let token = gax::paginator::extract_token(&self.0.request.page_token);
let execute = move |token: String| {
let builder = self.clone();
builder.0.request.clone().set_page_token(token);
builder.send()
};
gax::paginator::Paginator::new(token, execute)
}
pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.parent = v.into();
self
}
pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.filter = v.into();
self
}
pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
self.0.request.page_size = v.into();
self
}
pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.page_token = v.into();
self
}
}
impl gax::options::RequestBuilder for ListUptimeCheckConfigs {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetUptimeCheckConfig(RequestBuilder<crate::model::GetUptimeCheckConfigRequest>);
impl GetUptimeCheckConfig {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::UptimeCheckService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetUptimeCheckConfigRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::UptimeCheckConfig> {
(*self.0.stub)
.get_uptime_check_config(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
impl gax::options::RequestBuilder for GetUptimeCheckConfig {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct CreateUptimeCheckConfig(
RequestBuilder<crate::model::CreateUptimeCheckConfigRequest>,
);
impl CreateUptimeCheckConfig {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::UptimeCheckService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::CreateUptimeCheckConfigRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::UptimeCheckConfig> {
(*self.0.stub)
.create_uptime_check_config(self.0.request, self.0.options)
.await
}
pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.parent = v.into();
self
}
pub fn set_uptime_check_config<
T: Into<std::option::Option<crate::model::UptimeCheckConfig>>,
>(
mut self,
v: T,
) -> Self {
self.0.request.uptime_check_config = v.into();
self
}
}
impl gax::options::RequestBuilder for CreateUptimeCheckConfig {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct UpdateUptimeCheckConfig(
RequestBuilder<crate::model::UpdateUptimeCheckConfigRequest>,
);
impl UpdateUptimeCheckConfig {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::UptimeCheckService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::UpdateUptimeCheckConfigRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::UptimeCheckConfig> {
(*self.0.stub)
.update_uptime_check_config(self.0.request, self.0.options)
.await
}
pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
mut self,
v: T,
) -> Self {
self.0.request.update_mask = v.into();
self
}
pub fn set_uptime_check_config<
T: Into<std::option::Option<crate::model::UptimeCheckConfig>>,
>(
mut self,
v: T,
) -> Self {
self.0.request.uptime_check_config = v.into();
self
}
}
impl gax::options::RequestBuilder for UpdateUptimeCheckConfig {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct DeleteUptimeCheckConfig(
RequestBuilder<crate::model::DeleteUptimeCheckConfigRequest>,
);
impl DeleteUptimeCheckConfig {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::UptimeCheckService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::DeleteUptimeCheckConfigRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<wkt::Empty> {
(*self.0.stub)
.delete_uptime_check_config(self.0.request, self.0.options)
.await
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
impl gax::options::RequestBuilder for DeleteUptimeCheckConfig {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct ListUptimeCheckIps(RequestBuilder<crate::model::ListUptimeCheckIpsRequest>);
impl ListUptimeCheckIps {
pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::UptimeCheckService>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListUptimeCheckIpsRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::ListUptimeCheckIpsResponse> {
(*self.0.stub)
.list_uptime_check_ips(self.0.request, self.0.options)
.await
}
#[cfg(feature = "unstable-stream")]
pub async fn stream(
self,
) -> gax::paginator::Paginator<crate::model::ListUptimeCheckIpsResponse, gax::error::Error>
{
let token = gax::paginator::extract_token(&self.0.request.page_token);
let execute = move |token: String| {
let builder = self.clone();
builder.0.request.clone().set_page_token(token);
builder.send()
};
gax::paginator::Paginator::new(token, execute)
}
pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
self.0.request.page_size = v.into();
self
}
pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.page_token = v.into();
self
}
}
impl gax::options::RequestBuilder for ListUptimeCheckIps {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
}