#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Tag {
#[doc(hidden)]
pub key: std::option::Option<std::string::String>,
#[doc(hidden)]
pub value: std::option::Option<std::string::String>,
}
impl Tag {
pub fn key(&self) -> std::option::Option<&str> {
self.key.as_deref()
}
pub fn value(&self) -> std::option::Option<&str> {
self.value.as_deref()
}
}
pub mod tag {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) key: std::option::Option<std::string::String>,
pub(crate) value: std::option::Option<std::string::String>,
}
impl Builder {
pub fn key(mut self, input: impl Into<std::string::String>) -> Self {
self.key = Some(input.into());
self
}
pub fn set_key(mut self, input: std::option::Option<std::string::String>) -> Self {
self.key = input;
self
}
pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
self.value = Some(input.into());
self
}
pub fn set_value(mut self, input: std::option::Option<std::string::String>) -> Self {
self.value = input;
self
}
pub fn build(self) -> crate::model::Tag {
crate::model::Tag {
key: self.key,
value: self.value,
}
}
}
}
impl Tag {
pub fn builder() -> crate::model::tag::Builder {
crate::model::tag::Builder::default()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum ClientVersion {
#[allow(missing_docs)] FiveOne,
#[allow(missing_docs)] FiveThree,
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for ClientVersion {
fn from(s: &str) -> Self {
match s {
"5.1" => ClientVersion::FiveOne,
"5.3" => ClientVersion::FiveThree,
other => ClientVersion::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for ClientVersion {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ClientVersion::from(s))
}
}
impl ClientVersion {
pub fn as_str(&self) -> &str {
match self {
ClientVersion::FiveOne => "5.1",
ClientVersion::FiveThree => "5.3",
ClientVersion::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&["5.1", "5.3"]
}
}
impl AsRef<str> for ClientVersion {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum SubscriptionType {
#[allow(missing_docs)] Production,
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for SubscriptionType {
fn from(s: &str) -> Self {
match s {
"PRODUCTION" => SubscriptionType::Production,
other => SubscriptionType::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for SubscriptionType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(SubscriptionType::from(s))
}
}
impl SubscriptionType {
pub fn as_str(&self) -> &str {
match self {
SubscriptionType::Production => "PRODUCTION",
SubscriptionType::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&["PRODUCTION"]
}
}
impl AsRef<str> for SubscriptionType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum HsmStatus {
#[allow(missing_docs)] Degraded,
#[allow(missing_docs)] Pending,
#[allow(missing_docs)] Running,
#[allow(missing_docs)] Suspended,
#[allow(missing_docs)] Terminated,
#[allow(missing_docs)] Terminating,
#[allow(missing_docs)] Updating,
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for HsmStatus {
fn from(s: &str) -> Self {
match s {
"DEGRADED" => HsmStatus::Degraded,
"PENDING" => HsmStatus::Pending,
"RUNNING" => HsmStatus::Running,
"SUSPENDED" => HsmStatus::Suspended,
"TERMINATED" => HsmStatus::Terminated,
"TERMINATING" => HsmStatus::Terminating,
"UPDATING" => HsmStatus::Updating,
other => HsmStatus::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for HsmStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(HsmStatus::from(s))
}
}
impl HsmStatus {
pub fn as_str(&self) -> &str {
match self {
HsmStatus::Degraded => "DEGRADED",
HsmStatus::Pending => "PENDING",
HsmStatus::Running => "RUNNING",
HsmStatus::Suspended => "SUSPENDED",
HsmStatus::Terminated => "TERMINATED",
HsmStatus::Terminating => "TERMINATING",
HsmStatus::Updating => "UPDATING",
HsmStatus::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&[
"DEGRADED",
"PENDING",
"RUNNING",
"SUSPENDED",
"TERMINATED",
"TERMINATING",
"UPDATING",
]
}
}
impl AsRef<str> for HsmStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum CloudHsmObjectState {
#[allow(missing_docs)] Degraded,
#[allow(missing_docs)] Ready,
#[allow(missing_docs)] Updating,
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for CloudHsmObjectState {
fn from(s: &str) -> Self {
match s {
"DEGRADED" => CloudHsmObjectState::Degraded,
"READY" => CloudHsmObjectState::Ready,
"UPDATING" => CloudHsmObjectState::Updating,
other => {
CloudHsmObjectState::Unknown(crate::types::UnknownVariantValue(other.to_owned()))
}
}
}
}
impl std::str::FromStr for CloudHsmObjectState {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(CloudHsmObjectState::from(s))
}
}
impl CloudHsmObjectState {
pub fn as_str(&self) -> &str {
match self {
CloudHsmObjectState::Degraded => "DEGRADED",
CloudHsmObjectState::Ready => "READY",
CloudHsmObjectState::Updating => "UPDATING",
CloudHsmObjectState::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&["DEGRADED", "READY", "UPDATING"]
}
}
impl AsRef<str> for CloudHsmObjectState {
fn as_ref(&self) -> &str {
self.as_str()
}
}