google-maps-solar-v1 1.0.0

Google Cloud Client Libraries for Rust - Solar API
Documentation
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

/// Request and client builders for [Solar][crate::client::Solar].
pub mod solar {
    use crate::Result;

    /// A builder for [Solar][crate::client::Solar].
    ///
    /// ```
    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
    /// # use google_maps_solar_v1::*;
    /// # use builder::solar::ClientBuilder;
    /// # use client::Solar;
    /// let builder : ClientBuilder = Solar::builder();
    /// let client = builder
    ///     .with_endpoint("https://solar.googleapis.com")
    ///     .build().await?;
    /// # Ok(()) }
    /// ```
    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
            }
        }
    }

    /// Common implementation for [crate::client::Solar] request builders.
    #[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(),
            }
        }
    }

    /// The request builder for [Solar::find_closest_building_insights][crate::client::Solar::find_closest_building_insights] calls.
    ///
    /// # Example
    /// ```
    /// # use google_maps_solar_v1::builder::solar::FindClosestBuildingInsights;
    /// # async fn sample() -> google_maps_solar_v1::Result<()> {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # Ok(()) }
    ///
    /// fn prepare_request_builder() -> FindClosestBuildingInsights {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[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))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::FindClosestBuildingInsightsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        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)
        }

        /// Sets the value of [location][crate::model::FindClosestBuildingInsightsRequest::location].
        ///
        /// This is a **required** field for requests.
        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
        }

        /// Sets or clears the value of [location][crate::model::FindClosestBuildingInsightsRequest::location].
        ///
        /// This is a **required** field for requests.
        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
        }

        /// Sets the value of [required_quality][crate::model::FindClosestBuildingInsightsRequest::required_quality].
        pub fn set_required_quality<T: Into<crate::model::ImageryQuality>>(mut self, v: T) -> Self {
            self.0.request.required_quality = v.into();
            self
        }

        /// Sets the value of [exact_quality_required][crate::model::FindClosestBuildingInsightsRequest::exact_quality_required].
        pub fn set_exact_quality_required<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.exact_quality_required = v.into();
            self
        }

        /// Sets the value of [experiments][crate::model::FindClosestBuildingInsightsRequest::experiments].
        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
        }
    }

    /// The request builder for [Solar::get_data_layers][crate::client::Solar::get_data_layers] calls.
    ///
    /// # Example
    /// ```
    /// # use google_maps_solar_v1::builder::solar::GetDataLayers;
    /// # async fn sample() -> google_maps_solar_v1::Result<()> {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # Ok(()) }
    ///
    /// fn prepare_request_builder() -> GetDataLayers {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[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))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetDataLayersRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        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)
        }

        /// Sets the value of [location][crate::model::GetDataLayersRequest::location].
        ///
        /// This is a **required** field for requests.
        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
        }

        /// Sets or clears the value of [location][crate::model::GetDataLayersRequest::location].
        ///
        /// This is a **required** field for requests.
        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
        }

        /// Sets the value of [radius_meters][crate::model::GetDataLayersRequest::radius_meters].
        ///
        /// This is a **required** field for requests.
        pub fn set_radius_meters<T: Into<f32>>(mut self, v: T) -> Self {
            self.0.request.radius_meters = v.into();
            self
        }

        /// Sets the value of [view][crate::model::GetDataLayersRequest::view].
        pub fn set_view<T: Into<crate::model::DataLayerView>>(mut self, v: T) -> Self {
            self.0.request.view = v.into();
            self
        }

        /// Sets the value of [required_quality][crate::model::GetDataLayersRequest::required_quality].
        pub fn set_required_quality<T: Into<crate::model::ImageryQuality>>(mut self, v: T) -> Self {
            self.0.request.required_quality = v.into();
            self
        }

        /// Sets the value of [pixel_size_meters][crate::model::GetDataLayersRequest::pixel_size_meters].
        pub fn set_pixel_size_meters<T: Into<f32>>(mut self, v: T) -> Self {
            self.0.request.pixel_size_meters = v.into();
            self
        }

        /// Sets the value of [exact_quality_required][crate::model::GetDataLayersRequest::exact_quality_required].
        pub fn set_exact_quality_required<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.exact_quality_required = v.into();
            self
        }

        /// Sets the value of [experiments][crate::model::GetDataLayersRequest::experiments].
        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
        }
    }

    /// The request builder for [Solar::get_geo_tiff][crate::client::Solar::get_geo_tiff] calls.
    ///
    /// # Example
    /// ```
    /// # use google_maps_solar_v1::builder::solar::GetGeoTiff;
    /// # async fn sample() -> google_maps_solar_v1::Result<()> {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # Ok(()) }
    ///
    /// fn prepare_request_builder() -> GetGeoTiff {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[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))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetGeoTiffRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        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)
        }

        /// Sets the value of [id][crate::model::GetGeoTiffRequest::id].
        ///
        /// This is a **required** field for requests.
        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
        }
    }
}