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! 

///Request message for resolving an AccessProposal on a file.
#[derive(Debug, Clone, ::serde::Deserialize, ::serde::Serialize)]
pub struct ResolveAccessProposalRequest {
    #[serde(rename = "action")]
    ///Required. The action to take on the AccessProposal.
    pub action: resolve_access_proposal_request_action_additional::Action,
    #[serde(rename = "role")]
    ///Optional. The roles the approver has allowed, if any. Note: This field is required for the `ACCEPT` action.
    pub role: ::alloc::vec::Vec<::alloc::string::String>,
    #[serde(rename = "sendNotification")]
    ///Optional. Whether to send an email to the requester when the AccessProposal is denied or accepted.
    pub send_notification: ::core::primitive::bool,
    #[serde(rename = "view")]
    ///Optional. Indicates the view for this access proposal. This should only be set when the proposal belongs to a view. `published` is the only supported value.
    pub view: ::alloc::string::String,
}
///Request message for resolving an AccessProposal on a file.
#[derive(Debug, Clone, ::serde::Deserialize, ::serde::Serialize, Default)]
pub struct ResolveAccessProposalRequestPartial {
    #[serde(rename = "action")]
    #[serde(skip_serializing_if = "::core::option::Option::is_none")]
    ///Required. The action to take on the AccessProposal.
    pub action: ::core::option::Option<
        resolve_access_proposal_request_action_additional::ActionPartial,
    >,
    #[serde(rename = "role")]
    #[serde(skip_serializing_if = "::core::option::Option::is_none")]
    ///Optional. The roles the approver has allowed, if any. Note: This field is required for the `ACCEPT` action.
    pub role: ::core::option::Option<::alloc::vec::Vec<::alloc::string::String>>,
    #[serde(rename = "sendNotification")]
    #[serde(skip_serializing_if = "::core::option::Option::is_none")]
    ///Optional. Whether to send an email to the requester when the AccessProposal is denied or accepted.
    pub send_notification: ::core::option::Option<::core::primitive::bool>,
    #[serde(rename = "view")]
    #[serde(skip_serializing_if = "::core::option::Option::is_none")]
    ///Optional. Indicates the view for this access proposal. This should only be set when the proposal belongs to a view. `published` is the only supported value.
    pub view: ::core::option::Option<::alloc::string::String>,
}
pub mod resolve_access_proposal_request_action_additional {
    use super::*;
    #[derive(
        ::core::fmt::Debug,
        ::serde::Deserialize,
        ::serde::Serialize,
        Copy,
        Clone,
        PartialEq
    )]
    pub enum Action {
        ///The user accepts the proposal. Note: If this action is used, the `role` field must have at least one value.
        #[serde(rename = "ACCEPT")]
        Accept,
        ///Unspecified action
        #[serde(rename = "ACTION_UNSPECIFIED")]
        ActionUnspecified,
        ///The user denies the proposal
        #[serde(rename = "DENY")]
        Deny,
    }
    pub type ActionPartial = Action;
    impl ::core::str::FromStr for Action {
        type Err = &'static ::core::primitive::str;
        fn from_str(
            s: &::core::primitive::str,
        ) -> ::core::result::Result<Self, Self::Err> {
            match s {
                "ACCEPT" => crate::StdResult::Ok(Action::Accept),
                "ACTION_UNSPECIFIED" => crate::StdResult::Ok(Action::ActionUnspecified),
                "DENY" => crate::StdResult::Ok(Action::Deny),
                _ => ::core::result::Result::Err("Invalid variant"),
            }
        }
    }
    impl ::core::convert::AsRef<::core::primitive::str> for Action {
        fn as_ref(&self) -> &::core::primitive::str {
            match self {
                Action::Accept => "ACCEPT",
                Action::ActionUnspecified => "ACTION_UNSPECIFIED",
                Action::Deny => "DENY",
            }
        }
    }
    impl crate::gapirs_common::utils::converters::ConvertToQueryParams for Action {
        fn to_google_param_str(&self) -> ::alloc::string::String {
            ::std::string::ToString::to_string(
                ::core::convert::AsRef::<::core::primitive::str>::as_ref(self),
            )
        }
    }
    impl crate::gapirs_common::utils::converters::ConvertToQueryParams for &Action {
        fn to_google_param_str(&self) -> ::alloc::string::String {
            ::std::string::ToString::to_string(
                ::core::convert::AsRef::<::core::primitive::str>::as_ref(self),
            )
        }
    }
}