gapirs-drive-v3 0.0.1

Rust library for Google API drive v0.0.1
Documentation
// This file was generated by code-gen. DO NOT EDIT MANUALLY! 

extern crate derive_more;
extern crate std;
use ::serde::{Deserialize, Serialize};
use crate::gapirs_common::errors::*;
use crate::gapirs_common::utils::converters::ConvertToQueryParams;
use crate::gapirs_common::Hub;
///This usage is to have a reference to the return type of the call
use crate::discovery::schemas::*;
use ::derive_builder::Builder;
use ::core::str::FromStr;
use ::std::write;
use ::std::error;
use ::core::option::Option::Some;
use ::core::option::Option::None;
use ::core::result::Result::Ok;
use ::core::result::Result::Err;
use ::core::default::Default;
use ::core::convert::AsRef;
use ::core::convert::From;
use std::string::ToString;
///Lists a user's installed apps. For more information, see \[Return user info\](https://developers.google.com/workspace/drive/api/guides/user-info).
#[derive(Deserialize, Serialize, Builder)]
#[builder(name = DriveAppsListCallBuilder)]
#[builder(derive(::derive_more::Debug))]
#[derive(::derive_more::Debug)]
#[builder(setter(strip_option))]
#[builder(pattern = "owned")]
pub struct DriveAppsListCall<'a, H: Hub> {
    #[serde(skip)]
    #[debug(skip)]
    #[builder(setter(custom))]
    #[builder(default)]
    _hub: ::core::option::Option<&'a H>,
    #[serde(rename = "appFilterExtensions")]
    #[builder(setter(into))]
    #[serde(default = "_serde_default_setter_0")]
    #[builder(default = "\"\".to_string()")]
    ///A comma-separated list of file extensions to limit returned results. All results within the given app query scope which can open any of the given file extensions are included in the response. If `appFilterMimeTypes` are provided as well, the result is a union of the two resulting app lists.
    pub app_filter_extensions: ::alloc::string::String,
    #[serde(rename = "appFilterMimeTypes")]
    #[builder(setter(into))]
    #[serde(default = "_serde_default_setter_1")]
    #[builder(default = "\"\".to_string()")]
    ///A comma-separated list of file extensions to limit returned results. All results within the given app query scope which can open any of the given MIME types will be included in the response. If `appFilterExtensions` are provided as well, the result is a union of the two resulting app lists.
    pub app_filter_mime_types: ::alloc::string::String,
    #[serde(rename = "fields")]
    #[builder(setter(into))]
    #[serde(default)]
    #[builder(default)]
    ///Field mask used for response filtering
    pub fields: ::core::option::Option<::alloc::string::String>,
    #[serde(rename = "languageCode")]
    #[builder(setter(into))]
    #[serde(default)]
    #[builder(default)]
    ///A language or locale code, as defined by BCP 47, with some extensions from Unicode's LDML format (http://www.unicode.org/reports/tr35/).
    pub language_code: ::core::option::Option<::alloc::string::String>,
}
fn _serde_default_setter_0() -> ::alloc::string::String {
    "".to_string()
}
fn _serde_default_setter_1() -> ::alloc::string::String {
    "".to_string()
}
impl<
    'a,
    H: crate::gapirs_common::Hub,
> crate::gapirs_common::ApiCallBase<
    'a,
    H,
    ::alloc::boxed::Box<crate::discovery::schemas::app_list::AppListPartial>,
> for DriveAppsListCall<'a, H> {
    fn get_method_path(&self) -> &::core::primitive::str {
        "apps"
    }
    fn get_media_upload_path_simple(
        &self,
    ) -> ::core::option::Option<&::core::primitive::str> {
        ::core::option::Option::None
    }
    fn get_media_upload_path_resumable(
        &self,
    ) -> ::core::option::Option<&::core::primitive::str> {
        ::core::option::Option::None
    }
    fn get_query_params(
        &self,
    ) -> ::alloc::vec::Vec<(&::core::primitive::str, ::alloc::string::String)> {
        let mut params: ::alloc::vec::Vec<
            (&::core::primitive::str, ::alloc::string::String),
        > = ::alloc::vec![];
        let v = self.app_filter_extensions.to_google_param_str();
        if v.is_empty() {
            params.push(("appFilterExtensions", v));
        }
        let v = self.app_filter_mime_types.to_google_param_str();
        if v.is_empty() {
            params.push(("appFilterMimeTypes", v));
        }
        if let ::core::option::Option::Some(v) = &self.fields {
            params.push(("fields", v.to_google_param_str()));
        }
        if let ::core::option::Option::Some(v) = &self.language_code {
            params.push(("languageCode", v.to_google_param_str()));
        }
        params.push(("prettyPrint", "false".to_string()));
        params
    }
    fn get_query_param_order(&self) -> ::alloc::vec::Vec<&::core::primitive::str> {
        ::alloc::vec![]
    }
    fn get_scopes() -> ::alloc::vec::Vec<impl crate::Scope> {
        let scopes: ::alloc::vec::Vec<crate::Scopes> = ::alloc::vec![
            crate
            ::Scopes::from_str("https://www.googleapis.com/auth/drive.apps.readonly")
            .expect("Invalid scope in generated code")
        ];
        scopes
    }
    fn get_hub(
        &self,
    ) -> ::core::result::Result<&impl crate::gapirs_common::Hub, ApiCallError> {
        let hub: &H = self._hub.as_ref().ok_or(ApiCallError::NoHub)?;
        ::core::result::Result::Ok(hub)
    }
    fn set_hub<'b>(&mut self, hub: &'b H)
    where
        'b: 'a,
    {
        self._hub = ::core::option::Option::Some(hub);
    }
    fn has_body(&self) -> ::core::primitive::bool {
        false
    }
    fn take_body(&mut self) -> ::core::option::Option<::alloc::string::String> {
        ::core::option::Option::None
    }
    fn has_media_upload(&self) -> ::core::primitive::bool {
        false
    }
    fn take_media_upload(
        &mut self,
    ) -> ::core::option::Option<
        ::gapirs_common::api::MediaUpload<
            dyn crate::gapirs_common::api::MediaUploadStream,
        >,
    > {
        ::core::option::Option::None
    }
    fn has_resumable_media_upload(&self) -> bool {
        false
    }
    fn take_resumable_media_upload(
        &mut self,
    ) -> ::core::option::Option<::gapirs_common::api::ResumableBody> {
        ::core::option::Option::None
    }
    fn take_media_download(
        &mut self,
    ) -> ::core::option::Option<
        ::gapirs_common::api::MediaDownload<
            dyn crate::gapirs_common::api::MediaDownloadStream,
        >,
    > {
        ::core::option::Option::None
    }
    fn get_media_download(
        &mut self,
    ) -> ::core::option::Option<
        &::gapirs_common::api::MediaDownload<
            dyn crate::gapirs_common::api::MediaDownloadStream,
        >,
    > {
        ::core::option::Option::None
    }
    fn is_media_download(&self) -> ::core::primitive::bool {
        false
    }
    fn get_request_method() -> crate::gapirs_common::deps::hyper::Method {
        ::gapirs_common::deps::hyper::Method::GET
    }
}
impl<'a, H: crate::gapirs_common::Hub> crate::gapirs_common::ApiCallBuilder<'a, H>
for DriveAppsListCallBuilder<'a, H> {
    fn new(hub: &'a H) -> Self {
        Self {
            _hub: ::core::option::Option::Some(::core::option::Option::Some(hub)),
            ..::core::default::Default::default()
        }
    }
}
impl<'a, H: crate::gapirs_common::Hub> DriveAppsListCallBuilder<'a, H> {
    pub fn with_hub(&mut self, hub: &'a H) -> &mut Self {
        self._hub = ::core::option::Option::Some(::core::option::Option::Some(hub));
        self
    }
}