#[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 ResourceType {
Application,
Configuration,
ConfigurationProfile,
Deployment,
Environment,
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for ResourceType {
fn from(s: &str) -> Self {
match s {
"Application" => ResourceType::Application,
"Configuration" => ResourceType::Configuration,
"ConfigurationProfile" => ResourceType::ConfigurationProfile,
"Deployment" => ResourceType::Deployment,
"Environment" => ResourceType::Environment,
other => ResourceType::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for ResourceType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ResourceType::from(s))
}
}
impl ResourceType {
pub fn as_str(&self) -> &str {
match self {
ResourceType::Application => "Application",
ResourceType::Configuration => "Configuration",
ResourceType::ConfigurationProfile => "ConfigurationProfile",
ResourceType::Deployment => "Deployment",
ResourceType::Environment => "Environment",
ResourceType::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&[
"Application",
"Configuration",
"ConfigurationProfile",
"Deployment",
"Environment",
]
}
}
impl AsRef<str> for ResourceType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub enum BadRequestDetails {
InvalidParameters(
std::collections::HashMap<std::string::String, crate::model::InvalidParameterDetail>,
),
#[non_exhaustive]
Unknown,
}
impl BadRequestDetails {
#[allow(irrefutable_let_patterns)]
pub fn as_invalid_parameters(
&self,
) -> std::result::Result<
&std::collections::HashMap<std::string::String, crate::model::InvalidParameterDetail>,
&Self,
> {
if let BadRequestDetails::InvalidParameters(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_invalid_parameters(&self) -> bool {
self.as_invalid_parameters().is_ok()
}
pub fn is_unknown(&self) -> bool {
matches!(self, Self::Unknown)
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct InvalidParameterDetail {
#[doc(hidden)]
pub problem: std::option::Option<crate::model::InvalidParameterProblem>,
}
impl InvalidParameterDetail {
pub fn problem(&self) -> std::option::Option<&crate::model::InvalidParameterProblem> {
self.problem.as_ref()
}
}
pub mod invalid_parameter_detail {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) problem: std::option::Option<crate::model::InvalidParameterProblem>,
}
impl Builder {
pub fn problem(mut self, input: crate::model::InvalidParameterProblem) -> Self {
self.problem = Some(input);
self
}
pub fn set_problem(
mut self,
input: std::option::Option<crate::model::InvalidParameterProblem>,
) -> Self {
self.problem = input;
self
}
pub fn build(self) -> crate::model::InvalidParameterDetail {
crate::model::InvalidParameterDetail {
problem: self.problem,
}
}
}
}
impl InvalidParameterDetail {
pub fn builder() -> crate::model::invalid_parameter_detail::Builder {
crate::model::invalid_parameter_detail::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 InvalidParameterProblem {
Corrupted,
Expired,
PollIntervalNotSatisfied,
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for InvalidParameterProblem {
fn from(s: &str) -> Self {
match s {
"Corrupted" => InvalidParameterProblem::Corrupted,
"Expired" => InvalidParameterProblem::Expired,
"PollIntervalNotSatisfied" => InvalidParameterProblem::PollIntervalNotSatisfied,
other => InvalidParameterProblem::Unknown(crate::types::UnknownVariantValue(
other.to_owned(),
)),
}
}
}
impl std::str::FromStr for InvalidParameterProblem {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(InvalidParameterProblem::from(s))
}
}
impl InvalidParameterProblem {
pub fn as_str(&self) -> &str {
match self {
InvalidParameterProblem::Corrupted => "Corrupted",
InvalidParameterProblem::Expired => "Expired",
InvalidParameterProblem::PollIntervalNotSatisfied => "PollIntervalNotSatisfied",
InvalidParameterProblem::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&["Corrupted", "Expired", "PollIntervalNotSatisfied"]
}
}
impl AsRef<str> for InvalidParameterProblem {
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 BadRequestReason {
InvalidParameters,
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for BadRequestReason {
fn from(s: &str) -> Self {
match s {
"InvalidParameters" => BadRequestReason::InvalidParameters,
other => BadRequestReason::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for BadRequestReason {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(BadRequestReason::from(s))
}
}
impl BadRequestReason {
pub fn as_str(&self) -> &str {
match self {
BadRequestReason::InvalidParameters => "InvalidParameters",
BadRequestReason::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&["InvalidParameters"]
}
}
impl AsRef<str> for BadRequestReason {
fn as_ref(&self) -> &str {
self.as_str()
}
}