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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A two-part error structure that can occur in <code>ListGroupResources</code> or <code>SearchResources</code> operations on CloudFront stack-based queries. The error occurs if the CloudFront stack on which the query is based either does not exist, or has a status that renders the stack inactive. A <code>QueryError</code> occurrence does not necessarily mean that Resource Groups could not complete the operation, but the resulting group might have no member resources.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct QueryError {
/// <p>Specifies the error code that was raised.</p>
pub error_code: ::std::option::Option<crate::types::QueryErrorCode>,
/// <p>A message that explains the <code>ErrorCode</code> value. Messages might state that the specified CloudFront stack does not exist (or no longer exists). For <code>CLOUDFORMATION_STACK_INACTIVE</code>, the message typically states that the CloudFront stack has a status that is not (or no longer) active, such as <code>CREATE_FAILED</code>.</p>
pub message: ::std::option::Option<::std::string::String>,
}
impl QueryError {
/// <p>Specifies the error code that was raised.</p>
pub fn error_code(&self) -> ::std::option::Option<&crate::types::QueryErrorCode> {
self.error_code.as_ref()
}
/// <p>A message that explains the <code>ErrorCode</code> value. Messages might state that the specified CloudFront stack does not exist (or no longer exists). For <code>CLOUDFORMATION_STACK_INACTIVE</code>, the message typically states that the CloudFront stack has a status that is not (or no longer) active, such as <code>CREATE_FAILED</code>.</p>
pub fn message(&self) -> ::std::option::Option<&str> {
self.message.as_deref()
}
}
impl QueryError {
/// Creates a new builder-style object to manufacture [`QueryError`](crate::types::QueryError).
pub fn builder() -> crate::types::builders::QueryErrorBuilder {
crate::types::builders::QueryErrorBuilder::default()
}
}
/// A builder for [`QueryError`](crate::types::QueryError).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct QueryErrorBuilder {
pub(crate) error_code: ::std::option::Option<crate::types::QueryErrorCode>,
pub(crate) message: ::std::option::Option<::std::string::String>,
}
impl QueryErrorBuilder {
/// <p>Specifies the error code that was raised.</p>
pub fn error_code(mut self, input: crate::types::QueryErrorCode) -> Self {
self.error_code = ::std::option::Option::Some(input);
self
}
/// <p>Specifies the error code that was raised.</p>
pub fn set_error_code(mut self, input: ::std::option::Option<crate::types::QueryErrorCode>) -> Self {
self.error_code = input;
self
}
/// <p>Specifies the error code that was raised.</p>
pub fn get_error_code(&self) -> &::std::option::Option<crate::types::QueryErrorCode> {
&self.error_code
}
/// <p>A message that explains the <code>ErrorCode</code> value. Messages might state that the specified CloudFront stack does not exist (or no longer exists). For <code>CLOUDFORMATION_STACK_INACTIVE</code>, the message typically states that the CloudFront stack has a status that is not (or no longer) active, such as <code>CREATE_FAILED</code>.</p>
pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.message = ::std::option::Option::Some(input.into());
self
}
/// <p>A message that explains the <code>ErrorCode</code> value. Messages might state that the specified CloudFront stack does not exist (or no longer exists). For <code>CLOUDFORMATION_STACK_INACTIVE</code>, the message typically states that the CloudFront stack has a status that is not (or no longer) active, such as <code>CREATE_FAILED</code>.</p>
pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.message = input;
self
}
/// <p>A message that explains the <code>ErrorCode</code> value. Messages might state that the specified CloudFront stack does not exist (or no longer exists). For <code>CLOUDFORMATION_STACK_INACTIVE</code>, the message typically states that the CloudFront stack has a status that is not (or no longer) active, such as <code>CREATE_FAILED</code>.</p>
pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
&self.message
}
/// Consumes the builder and constructs a [`QueryError`](crate::types::QueryError).
pub fn build(self) -> crate::types::QueryError {
crate::types::QueryError {
error_code: self.error_code,
message: self.message,
}
}
}