#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate bytes;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PosixAccount {
pub primary: bool,
pub username: std::string::String,
pub uid: i64,
pub gid: i64,
pub home_directory: std::string::String,
pub shell: std::string::String,
pub gecos: std::string::String,
pub system_id: std::string::String,
pub account_id: std::string::String,
pub operating_system_type: crate::model::OperatingSystemType,
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PosixAccount {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_primary<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.primary = v.into();
self
}
pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.username = v.into();
self
}
pub fn set_uid<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
pub fn set_gid<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.gid = v.into();
self
}
pub fn set_home_directory<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.home_directory = v.into();
self
}
pub fn set_shell<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.shell = v.into();
self
}
pub fn set_gecos<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.gecos = v.into();
self
}
pub fn set_system_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.system_id = v.into();
self
}
pub fn set_account_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.account_id = v.into();
self
}
pub fn set_operating_system_type<T: std::convert::Into<crate::model::OperatingSystemType>>(
mut self,
v: T,
) -> Self {
self.operating_system_type = v.into();
self
}
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 PosixAccount {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.oslogin.common.PosixAccount"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SshPublicKey {
pub key: std::string::String,
pub expiration_time_usec: i64,
pub fingerprint: std::string::String,
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SshPublicKey {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key = v.into();
self
}
pub fn set_expiration_time_usec<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.expiration_time_usec = v.into();
self
}
pub fn set_fingerprint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.fingerprint = v.into();
self
}
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 SshPublicKey {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.oslogin.common.SshPublicKey"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum OperatingSystemType {
Unspecified,
Linux,
Windows,
UnknownValue(operating_system_type::UnknownValue),
}
#[doc(hidden)]
pub mod operating_system_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl OperatingSystemType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Linux => std::option::Option::Some(1),
Self::Windows => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("OPERATING_SYSTEM_TYPE_UNSPECIFIED"),
Self::Linux => std::option::Option::Some("LINUX"),
Self::Windows => std::option::Option::Some("WINDOWS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for OperatingSystemType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for OperatingSystemType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for OperatingSystemType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Linux,
2 => Self::Windows,
_ => Self::UnknownValue(operating_system_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for OperatingSystemType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"OPERATING_SYSTEM_TYPE_UNSPECIFIED" => Self::Unspecified,
"LINUX" => Self::Linux,
"WINDOWS" => Self::Windows,
_ => Self::UnknownValue(operating_system_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for OperatingSystemType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Linux => serializer.serialize_i32(1),
Self::Windows => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for OperatingSystemType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperatingSystemType>::new(
".google.cloud.oslogin.common.OperatingSystemType",
))
}
}