#[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 AlternateContactType {
#[allow(missing_docs)] Billing,
#[allow(missing_docs)] Operations,
#[allow(missing_docs)] Security,
Unknown(String),
}
impl std::convert::From<&str> for AlternateContactType {
fn from(s: &str) -> Self {
match s {
"BILLING" => AlternateContactType::Billing,
"OPERATIONS" => AlternateContactType::Operations,
"SECURITY" => AlternateContactType::Security,
other => AlternateContactType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for AlternateContactType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(AlternateContactType::from(s))
}
}
impl AlternateContactType {
pub fn as_str(&self) -> &str {
match self {
AlternateContactType::Billing => "BILLING",
AlternateContactType::Operations => "OPERATIONS",
AlternateContactType::Security => "SECURITY",
AlternateContactType::Unknown(s) => s.as_ref(),
}
}
pub fn values() -> &'static [&'static str] {
&["BILLING", "OPERATIONS", "SECURITY"]
}
}
impl AsRef<str> for AlternateContactType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct AlternateContact {
pub name: std::option::Option<std::string::String>,
pub title: std::option::Option<std::string::String>,
pub email_address: std::option::Option<std::string::String>,
pub phone_number: std::option::Option<std::string::String>,
pub alternate_contact_type: std::option::Option<crate::model::AlternateContactType>,
}
impl AlternateContact {
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn title(&self) -> std::option::Option<&str> {
self.title.as_deref()
}
pub fn email_address(&self) -> std::option::Option<&str> {
self.email_address.as_deref()
}
pub fn phone_number(&self) -> std::option::Option<&str> {
self.phone_number.as_deref()
}
pub fn alternate_contact_type(
&self,
) -> std::option::Option<&crate::model::AlternateContactType> {
self.alternate_contact_type.as_ref()
}
}
impl std::fmt::Debug for AlternateContact {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("AlternateContact");
formatter.field("name", &"*** Sensitive Data Redacted ***");
formatter.field("title", &"*** Sensitive Data Redacted ***");
formatter.field("email_address", &"*** Sensitive Data Redacted ***");
formatter.field("phone_number", &"*** Sensitive Data Redacted ***");
formatter.field("alternate_contact_type", &self.alternate_contact_type);
formatter.finish()
}
}
pub mod alternate_contact {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) title: std::option::Option<std::string::String>,
pub(crate) email_address: std::option::Option<std::string::String>,
pub(crate) phone_number: std::option::Option<std::string::String>,
pub(crate) alternate_contact_type: std::option::Option<crate::model::AlternateContactType>,
}
impl Builder {
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn title(mut self, input: impl Into<std::string::String>) -> Self {
self.title = Some(input.into());
self
}
pub fn set_title(mut self, input: std::option::Option<std::string::String>) -> Self {
self.title = input;
self
}
pub fn email_address(mut self, input: impl Into<std::string::String>) -> Self {
self.email_address = Some(input.into());
self
}
pub fn set_email_address(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.email_address = input;
self
}
pub fn phone_number(mut self, input: impl Into<std::string::String>) -> Self {
self.phone_number = Some(input.into());
self
}
pub fn set_phone_number(mut self, input: std::option::Option<std::string::String>) -> Self {
self.phone_number = input;
self
}
pub fn alternate_contact_type(mut self, input: crate::model::AlternateContactType) -> Self {
self.alternate_contact_type = Some(input);
self
}
pub fn set_alternate_contact_type(
mut self,
input: std::option::Option<crate::model::AlternateContactType>,
) -> Self {
self.alternate_contact_type = input;
self
}
pub fn build(self) -> crate::model::AlternateContact {
crate::model::AlternateContact {
name: self.name,
title: self.title,
email_address: self.email_address,
phone_number: self.phone_number,
alternate_contact_type: self.alternate_contact_type,
}
}
}
}
impl AlternateContact {
pub fn builder() -> crate::model::alternate_contact::Builder {
crate::model::alternate_contact::Builder::default()
}
}