pub mod solar {
use crate::Result;
pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
pub(crate) mod client {
use super::super::super::client::Solar;
pub struct Factory;
impl crate::ClientFactory for Factory {
type Client = Solar;
type Credentials = gaxi::options::Credentials;
async fn build(
self,
config: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<Self::Client> {
Self::Client::new(config).await
}
}
}
#[derive(Clone, Debug)]
pub(crate) struct RequestBuilder<R: std::default::Default> {
stub: std::sync::Arc<dyn super::super::stub::dynamic::Solar>,
request: R,
options: crate::RequestOptions,
}
impl<R> RequestBuilder<R>
where
R: std::default::Default,
{
pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Solar>) -> Self {
Self {
stub,
request: R::default(),
options: crate::RequestOptions::default(),
}
}
}
#[derive(Clone, Debug)]
pub struct FindClosestBuildingInsights(
RequestBuilder<crate::model::FindClosestBuildingInsightsRequest>,
);
impl FindClosestBuildingInsights {
pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Solar>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::FindClosestBuildingInsightsRequest>>(
mut self,
v: V,
) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::BuildingInsights> {
(*self.0.stub)
.find_closest_building_insights(self.0.request, self.0.options)
.await
.map(crate::Response::into_body)
}
pub fn set_location<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::LatLng>,
{
self.0.request.location = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_location<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::LatLng>,
{
self.0.request.location = v.map(|x| x.into());
self
}
pub fn set_required_quality<T: Into<crate::model::ImageryQuality>>(mut self, v: T) -> Self {
self.0.request.required_quality = v.into();
self
}
pub fn set_exact_quality_required<T: Into<bool>>(mut self, v: T) -> Self {
self.0.request.exact_quality_required = v.into();
self
}
pub fn set_experiments<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Experiment>,
{
use std::iter::Iterator;
self.0.request.experiments = v.into_iter().map(|i| i.into()).collect();
self
}
}
#[doc(hidden)]
impl crate::RequestBuilder for FindClosestBuildingInsights {
fn request_options(&mut self) -> &mut crate::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetDataLayers(RequestBuilder<crate::model::GetDataLayersRequest>);
impl GetDataLayers {
pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Solar>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetDataLayersRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<crate::model::DataLayers> {
(*self.0.stub)
.get_data_layers(self.0.request, self.0.options)
.await
.map(crate::Response::into_body)
}
pub fn set_location<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::LatLng>,
{
self.0.request.location = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_location<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::LatLng>,
{
self.0.request.location = v.map(|x| x.into());
self
}
pub fn set_radius_meters<T: Into<f32>>(mut self, v: T) -> Self {
self.0.request.radius_meters = v.into();
self
}
pub fn set_view<T: Into<crate::model::DataLayerView>>(mut self, v: T) -> Self {
self.0.request.view = v.into();
self
}
pub fn set_required_quality<T: Into<crate::model::ImageryQuality>>(mut self, v: T) -> Self {
self.0.request.required_quality = v.into();
self
}
pub fn set_pixel_size_meters<T: Into<f32>>(mut self, v: T) -> Self {
self.0.request.pixel_size_meters = v.into();
self
}
pub fn set_exact_quality_required<T: Into<bool>>(mut self, v: T) -> Self {
self.0.request.exact_quality_required = v.into();
self
}
pub fn set_experiments<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Experiment>,
{
use std::iter::Iterator;
self.0.request.experiments = v.into_iter().map(|i| i.into()).collect();
self
}
}
#[doc(hidden)]
impl crate::RequestBuilder for GetDataLayers {
fn request_options(&mut self) -> &mut crate::RequestOptions {
&mut self.0.options
}
}
#[derive(Clone, Debug)]
pub struct GetGeoTiff(RequestBuilder<crate::model::GetGeoTiffRequest>);
impl GetGeoTiff {
pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Solar>) -> Self {
Self(RequestBuilder::new(stub))
}
pub fn with_request<V: Into<crate::model::GetGeoTiffRequest>>(mut self, v: V) -> Self {
self.0.request = v.into();
self
}
pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
self.0.options = v.into();
self
}
pub async fn send(self) -> Result<google_cloud_api::model::HttpBody> {
(*self.0.stub)
.get_geo_tiff(self.0.request, self.0.options)
.await
.map(crate::Response::into_body)
}
pub fn set_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
self.0.request.id = v.into();
self
}
}
#[doc(hidden)]
impl crate::RequestBuilder for GetGeoTiff {
fn request_options(&mut self) -> &mut crate::RequestOptions {
&mut self.0.options
}
}
}