1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[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 {
    /// Resource type value for the Application resource.
    Application,
    /// Resource type value for the Configuration resource.
    Configuration,
    /// Resource type value for the ConfigurationProfile resource.
    ConfigurationProfile,
    /// Resource type value for the Deployment resource.
    Deployment,
    /// Resource type value for the Environment resource.
    Environment,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
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(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 {
    /// Returns the `&str` value of the enum member.
    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(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &[
            "Application",
            "Configuration",
            "ConfigurationProfile",
            "Deployment",
            "Environment",
        ]
    }
}
impl AsRef<str> for ResourceType {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

/// <p>Details describing why the request was invalid</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub enum BadRequestDetails {
    /// <p>Present if the Reason for the bad request was 'InvalidParameters'</p>
    InvalidParameters(
        std::collections::HashMap<std::string::String, crate::model::InvalidParameterDetail>,
    ),
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
    /// An unknown enum variant
    ///
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
    #[non_exhaustive]
    Unknown,
}
impl BadRequestDetails {
    #[allow(irrefutable_let_patterns)]
    /// Tries to convert the enum instance into [`InvalidParameters`](crate::model::BadRequestDetails::InvalidParameters), extracting the inner [`HashMap`](std::collections::HashMap).
    /// Returns `Err(&Self)` if it can't be converted.
    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)
        }
    }
    /// Returns true if this is a [`InvalidParameters`](crate::model::BadRequestDetails::InvalidParameters).
    pub fn is_invalid_parameters(&self) -> bool {
        self.as_invalid_parameters().is_ok()
    }
    /// Returns true if the enum instance is the `Unknown` variant.
    pub fn is_unknown(&self) -> bool {
        matches!(self, Self::Unknown)
    }
}

/// <p>Contains details about an invalid parameter.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct InvalidParameterDetail {
    /// <p>Detail describing why an individual parameter did not satisfy the constraints specified by the service</p>
    pub problem: std::option::Option<crate::model::InvalidParameterProblem>,
}
impl InvalidParameterDetail {
    /// <p>Detail describing why an individual parameter did not satisfy the constraints specified by the service</p>
    pub fn problem(&self) -> std::option::Option<&crate::model::InvalidParameterProblem> {
        self.problem.as_ref()
    }
}
impl std::fmt::Debug for InvalidParameterDetail {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("InvalidParameterDetail");
        formatter.field("problem", &self.problem);
        formatter.finish()
    }
}
/// See [`InvalidParameterDetail`](crate::model::InvalidParameterDetail)
pub mod invalid_parameter_detail {
    /// A builder for [`InvalidParameterDetail`](crate::model::InvalidParameterDetail)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) problem: std::option::Option<crate::model::InvalidParameterProblem>,
    }
    impl Builder {
        /// <p>Detail describing why an individual parameter did not satisfy the constraints specified by the service</p>
        pub fn problem(mut self, input: crate::model::InvalidParameterProblem) -> Self {
            self.problem = Some(input);
            self
        }
        /// <p>Detail describing why an individual parameter did not satisfy the constraints specified by the service</p>
        pub fn set_problem(
            mut self,
            input: std::option::Option<crate::model::InvalidParameterProblem>,
        ) -> Self {
            self.problem = input;
            self
        }
        /// Consumes the builder and constructs a [`InvalidParameterDetail`](crate::model::InvalidParameterDetail)
        pub fn build(self) -> crate::model::InvalidParameterDetail {
            crate::model::InvalidParameterDetail {
                problem: self.problem,
            }
        }
    }
}
impl InvalidParameterDetail {
    /// Creates a new builder-style object to manufacture [`InvalidParameterDetail`](crate::model::InvalidParameterDetail)
    pub fn builder() -> crate::model::invalid_parameter_detail::Builder {
        crate::model::invalid_parameter_detail::Builder::default()
    }
}

#[allow(missing_docs)] // documentation missing in model
#[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 {
    /// The parameter was corrupted and could not be understood by the service.
    Corrupted,
    /// The parameter was expired and can no longer be used.
    Expired,
    /// The client called the service before the time specified in the poll interval.
    PollIntervalNotSatisfied,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
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(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 {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            InvalidParameterProblem::Corrupted => "Corrupted",
            InvalidParameterProblem::Expired => "Expired",
            InvalidParameterProblem::PollIntervalNotSatisfied => "PollIntervalNotSatisfied",
            InvalidParameterProblem::Unknown(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &["Corrupted", "Expired", "PollIntervalNotSatisfied"]
    }
}
impl AsRef<str> for InvalidParameterProblem {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

#[allow(missing_docs)] // documentation missing in model
#[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 {
    /// Indicates there was a problem with one or more of the parameters.
    /// See InvalidParameters in the BadRequestDetails for more information.
    InvalidParameters,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
impl std::convert::From<&str> for BadRequestReason {
    fn from(s: &str) -> Self {
        match s {
            "InvalidParameters" => BadRequestReason::InvalidParameters,
            other => BadRequestReason::Unknown(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 {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            BadRequestReason::InvalidParameters => "InvalidParameters",
            BadRequestReason::Unknown(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &["InvalidParameters"]
    }
}
impl AsRef<str> for BadRequestReason {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}