pub mod connectors {
use crate::Result;
use std::sync::Arc;
pub type ClientBuilder =
gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
pub(crate) mod client {
use super::super::super::client::Connectors;
pub struct Factory;
impl gax::client_builder::internal::ClientFactory for Factory {
type Client = Connectors;
type Credentials = gaxi::options::Credentials;
async fn build(self, config: gaxi::options::ClientConfig) -> gax::Result<Self::Client> {
Self::Client::new(config).await
}
}
}
#[derive(Clone, Debug)]
pub(crate) struct RequestBuilder<R: std::default::Default> {
stub: Arc<dyn super::super::stub::dynamic::Connectors>,
request: R,
options: gax::options::RequestOptions,
}
impl<R> RequestBuilder<R>
where
R: std::default::Default,
{
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self {
stub,
request: R::default(),
options: gax::options::RequestOptions::default(),
}
}
}
#[derive(Clone, Debug)]
pub struct ListConnections(RequestBuilder<crate::model::ListConnectionsRequest>);
impl ListConnections {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListConnectionsRequest>>(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::ListConnectionsResponse> {
(*self.0.stub)
.list_connections(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub async fn paginator(
self,
) -> impl gax::paginator::Paginator<crate::model::ListConnectionsResponse, gax::error::Error>
{
use std::clone::Clone;
let token = self.0.request.page_token.clone();
let execute = move |token: String| {
let mut builder = self.clone();
builder.0.request = builder.0.request.set_page_token(token);
builder.send()
};
gax::paginator::internal::new_paginator(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_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_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::ConnectionView>>(mut self, v: T) -> Self {
self.0.request.view = v.into();
self
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for ListConnections {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetConnection(RequestBuilder<crate::model::GetConnectionRequest>);
impl GetConnection {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetConnectionRequest>>(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::Connection> {
(*self.0.stub)
.get_connection(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
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::ConnectionView>>(mut self, v: T) -> Self {
self.0.request.view = v.into();
self
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for GetConnection {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct CreateConnection(RequestBuilder<crate::model::CreateConnectionRequest>);
impl CreateConnection {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::CreateConnectionRequest>>(
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<longrunning::model::Operation> {
(*self.0.stub)
.create_connection(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub fn poller(
self,
) -> impl lro::Poller<crate::model::Connection, crate::model::OperationMetadata> {
type Operation =
lro::Operation<crate::model::Connection, crate::model::OperationMetadata>;
let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
let stub = self.0.stub.clone();
let mut options = self.0.options.clone();
options.set_retry_policy(gax::retry_policy::NeverRetry);
let query = move |name| {
let stub = stub.clone();
let options = options.clone();
async {
let op = GetOperation::new(stub)
.set_name(name)
.with_options(options)
.send()
.await?;
Ok(Operation::new(op))
}
};
let start = move || async {
let op = self.send().await?;
Ok(Operation::new(op))
};
lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
}
pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.parent = v.into();
self
}
pub fn set_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.connection_id = v.into();
self
}
pub fn set_connection<T: Into<std::option::Option<crate::model::Connection>>>(
mut self,
v: T,
) -> Self {
self.0.request.connection = v.into();
self
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for CreateConnection {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct UpdateConnection(RequestBuilder<crate::model::UpdateConnectionRequest>);
impl UpdateConnection {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::UpdateConnectionRequest>>(
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<longrunning::model::Operation> {
(*self.0.stub)
.update_connection(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub fn poller(
self,
) -> impl lro::Poller<crate::model::Connection, crate::model::OperationMetadata> {
type Operation =
lro::Operation<crate::model::Connection, crate::model::OperationMetadata>;
let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
let stub = self.0.stub.clone();
let mut options = self.0.options.clone();
options.set_retry_policy(gax::retry_policy::NeverRetry);
let query = move |name| {
let stub = stub.clone();
let options = options.clone();
async {
let op = GetOperation::new(stub)
.set_name(name)
.with_options(options)
.send()
.await?;
Ok(Operation::new(op))
}
};
let start = move || async {
let op = self.send().await?;
Ok(Operation::new(op))
};
lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
}
pub fn set_connection<T: Into<std::option::Option<crate::model::Connection>>>(
mut self,
v: T,
) -> Self {
self.0.request.connection = 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
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for UpdateConnection {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct DeleteConnection(RequestBuilder<crate::model::DeleteConnectionRequest>);
impl DeleteConnection {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::DeleteConnectionRequest>>(
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<longrunning::model::Operation> {
(*self.0.stub)
.delete_connection(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
let stub = self.0.stub.clone();
let mut options = self.0.options.clone();
options.set_retry_policy(gax::retry_policy::NeverRetry);
let query = move |name| {
let stub = stub.clone();
let options = options.clone();
async {
let op = GetOperation::new(stub)
.set_name(name)
.with_options(options)
.send()
.await?;
Ok(Operation::new(op))
}
};
let start = move || async {
let op = self.send().await?;
Ok(Operation::new(op))
};
lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for DeleteConnection {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct ListProviders(RequestBuilder<crate::model::ListProvidersRequest>);
impl ListProviders {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListProvidersRequest>>(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::ListProvidersResponse> {
(*self.0.stub)
.list_providers(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub async fn paginator(
self,
) -> impl gax::paginator::Paginator<crate::model::ListProvidersResponse, gax::error::Error>
{
use std::clone::Clone;
let token = self.0.request.page_token.clone();
let execute = move |token: String| {
let mut builder = self.clone();
builder.0.request = builder.0.request.set_page_token(token);
builder.send()
};
gax::paginator::internal::new_paginator(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_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
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for ListProviders {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetProvider(RequestBuilder<crate::model::GetProviderRequest>);
impl GetProvider {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetProviderRequest>>(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::Provider> {
(*self.0.stub)
.get_provider(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for GetProvider {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct ListConnectors(RequestBuilder<crate::model::ListConnectorsRequest>);
impl ListConnectors {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListConnectorsRequest>>(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::ListConnectorsResponse> {
(*self.0.stub)
.list_connectors(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub async fn paginator(
self,
) -> impl gax::paginator::Paginator<crate::model::ListConnectorsResponse, gax::error::Error>
{
use std::clone::Clone;
let token = self.0.request.page_token.clone();
let execute = move |token: String| {
let mut builder = self.clone();
builder.0.request = builder.0.request.set_page_token(token);
builder.send()
};
gax::paginator::internal::new_paginator(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_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
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for ListConnectors {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetConnector(RequestBuilder<crate::model::GetConnectorRequest>);
impl GetConnector {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetConnectorRequest>>(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::Connector> {
(*self.0.stub)
.get_connector(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for GetConnector {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct ListConnectorVersions(RequestBuilder<crate::model::ListConnectorVersionsRequest>);
impl ListConnectorVersions {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListConnectorVersionsRequest>>(
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::ListConnectorVersionsResponse> {
(*self.0.stub)
.list_connector_versions(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub async fn paginator(
self,
) -> impl gax::paginator::Paginator<crate::model::ListConnectorVersionsResponse, gax::error::Error>
{
use std::clone::Clone;
let token = self.0.request.page_token.clone();
let execute = move |token: String| {
let mut builder = self.clone();
builder.0.request = builder.0.request.set_page_token(token);
builder.send()
};
gax::paginator::internal::new_paginator(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_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::ConnectorVersionView>>(mut self, v: T) -> Self {
self.0.request.view = v.into();
self
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for ListConnectorVersions {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetConnectorVersion(RequestBuilder<crate::model::GetConnectorVersionRequest>);
impl GetConnectorVersion {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetConnectorVersionRequest>>(
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::ConnectorVersion> {
(*self.0.stub)
.get_connector_version(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
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::ConnectorVersionView>>(mut self, v: T) -> Self {
self.0.request.view = v.into();
self
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for GetConnectorVersion {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetConnectionSchemaMetadata(
RequestBuilder<crate::model::GetConnectionSchemaMetadataRequest>,
);
impl GetConnectionSchemaMetadata {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetConnectionSchemaMetadataRequest>>(
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::ConnectionSchemaMetadata> {
(*self.0.stub)
.get_connection_schema_metadata(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for GetConnectionSchemaMetadata {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct RefreshConnectionSchemaMetadata(
RequestBuilder<crate::model::RefreshConnectionSchemaMetadataRequest>,
);
impl RefreshConnectionSchemaMetadata {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::RefreshConnectionSchemaMetadataRequest>>(
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<longrunning::model::Operation> {
(*self.0.stub)
.refresh_connection_schema_metadata(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub fn poller(
self,
) -> impl lro::Poller<crate::model::ConnectionSchemaMetadata, crate::model::OperationMetadata>
{
type Operation = lro::Operation<
crate::model::ConnectionSchemaMetadata,
crate::model::OperationMetadata,
>;
let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
let stub = self.0.stub.clone();
let mut options = self.0.options.clone();
options.set_retry_policy(gax::retry_policy::NeverRetry);
let query = move |name| {
let stub = stub.clone();
let options = options.clone();
async {
let op = GetOperation::new(stub)
.set_name(name)
.with_options(options)
.send()
.await?;
Ok(Operation::new(op))
}
};
let start = move || async {
let op = self.send().await?;
Ok(Operation::new(op))
};
lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for RefreshConnectionSchemaMetadata {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct ListRuntimeEntitySchemas(
RequestBuilder<crate::model::ListRuntimeEntitySchemasRequest>,
);
impl ListRuntimeEntitySchemas {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListRuntimeEntitySchemasRequest>>(
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::ListRuntimeEntitySchemasResponse> {
(*self.0.stub)
.list_runtime_entity_schemas(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub async fn paginator(
self,
) -> impl gax::paginator::Paginator<
crate::model::ListRuntimeEntitySchemasResponse,
gax::error::Error,
> {
use std::clone::Clone;
let token = self.0.request.page_token.clone();
let execute = move |token: String| {
let mut builder = self.clone();
builder.0.request = builder.0.request.set_page_token(token);
builder.send()
};
gax::paginator::internal::new_paginator(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_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
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for ListRuntimeEntitySchemas {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct ListRuntimeActionSchemas(
RequestBuilder<crate::model::ListRuntimeActionSchemasRequest>,
);
impl ListRuntimeActionSchemas {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::ListRuntimeActionSchemasRequest>>(
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::ListRuntimeActionSchemasResponse> {
(*self.0.stub)
.list_runtime_action_schemas(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub async fn paginator(
self,
) -> impl gax::paginator::Paginator<
crate::model::ListRuntimeActionSchemasResponse,
gax::error::Error,
> {
use std::clone::Clone;
let token = self.0.request.page_token.clone();
let execute = move |token: String| {
let mut builder = self.clone();
builder.0.request = builder.0.request.set_page_token(token);
builder.send()
};
gax::paginator::internal::new_paginator(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_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
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for ListRuntimeActionSchemas {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetRuntimeConfig(RequestBuilder<crate::model::GetRuntimeConfigRequest>);
impl GetRuntimeConfig {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetRuntimeConfigRequest>>(
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::RuntimeConfig> {
(*self.0.stub)
.get_runtime_config(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for GetRuntimeConfig {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetGlobalSettings(RequestBuilder<crate::model::GetGlobalSettingsRequest>);
impl GetGlobalSettings {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetGlobalSettingsRequest>>(
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::Settings> {
(*self.0.stub)
.get_global_settings(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for GetGlobalSettings {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
impl ListLocations {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
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<location::model::ListLocationsResponse> {
(*self.0.stub)
.list_locations(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub async fn paginator(
self,
) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
{
use std::clone::Clone;
let token = self.0.request.page_token.clone();
let execute = move |token: String| {
let mut builder = self.clone();
builder.0.request = builder.0.request.set_page_token(token);
builder.send()
};
gax::paginator::internal::new_paginator(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
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for ListLocations {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
impl GetLocation {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<location::model::GetLocationRequest>>(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<location::model::Location> {
(*self.0.stub)
.get_location(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for GetLocation {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
impl SetIamPolicy {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(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<iam_v1::model::Policy> {
(*self.0.stub)
.set_iam_policy(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.resource = v.into();
self
}
pub fn set_policy<T: Into<std::option::Option<iam_v1::model::Policy>>>(
mut self,
v: T,
) -> Self {
self.0.request.policy = 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
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for SetIamPolicy {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
impl GetIamPolicy {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(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<iam_v1::model::Policy> {
(*self.0.stub)
.get_iam_policy(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.resource = v.into();
self
}
pub fn set_options<T: Into<std::option::Option<iam_v1::model::GetPolicyOptions>>>(
mut self,
v: T,
) -> Self {
self.0.request.options = v.into();
self
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for GetIamPolicy {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
impl TestIamPermissions {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
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<iam_v1::model::TestIamPermissionsResponse> {
(*self.0.stub)
.test_iam_permissions(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.resource = v.into();
self
}
pub fn set_permissions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
self
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for TestIamPermissions {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
impl ListOperations {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
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<longrunning::model::ListOperationsResponse> {
(*self.0.stub)
.list_operations(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub async fn paginator(
self,
) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
{
use std::clone::Clone;
let token = self.0.request.page_token.clone();
let execute = move |token: String| {
let mut builder = self.clone();
builder.0.request = builder.0.request.set_page_token(token);
builder.send()
};
gax::paginator::internal::new_paginator(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
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for ListOperations {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
impl GetOperation {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
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<longrunning::model::Operation> {
(*self.0.stub)
.get_operation(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for GetOperation {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
impl DeleteOperation {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
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<()> {
(*self.0.stub)
.delete_operation(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for DeleteOperation {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
impl CancelOperation {
pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Connectors>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
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<()> {
(*self.0.stub)
.cancel_operation(self.0.request, self.0.options)
.await
.map(gax::response::Response::into_body)
}
pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.name = v.into();
self
}
}
#[doc(hidden)]
impl gax::options::internal::RequestBuilder for CancelOperation {
fn request_options(&mut self) -> &mut gax::options::RequestOptions {
&mut self.0.options
}
}
}