#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gax;
extern crate gaxi;
extern crate lazy_static;
extern crate reqwest;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ListLocationsRequest {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub filter: std::string::String,
#[serde(skip_serializing_if = "wkt::internal::is_default")]
pub page_size: i32,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub page_token: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListLocationsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListLocationsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.location.ListLocationsRequest"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct ListLocationsResponse {
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
pub locations: std::vec::Vec<crate::model::Location>,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub next_page_token: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListLocationsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Location>,
{
use std::iter::Iterator;
self.locations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListLocationsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.location.ListLocationsResponse"
}
}
#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListLocationsResponse {
type PageItem = crate::model::Location;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.locations
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct GetLocationRequest {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetLocationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetLocationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.location.GetLocationRequest"
}
}
#[serde_with::serde_as]
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(default, rename_all = "camelCase")]
#[non_exhaustive]
pub struct Location {
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub name: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub location_id: std::string::String,
#[serde(skip_serializing_if = "std::string::String::is_empty")]
pub display_name: std::string::String,
#[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub metadata: std::option::Option<wkt::Any>,
#[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
_unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Location {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_location_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location_id = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_metadata<T: std::convert::Into<std::option::Option<wkt::Any>>>(
mut self,
v: T,
) -> Self {
self.metadata = v.into();
self
}
}
impl wkt::message::Message for Location {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.location.Location"
}
}