aws-sdk-securityir 1.49.0

AWS SDK for Security Incident Response
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p></p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Watcher {
    /// <p></p>
    pub email: ::std::string::String,
    /// <p></p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p></p>
    pub job_title: ::std::option::Option<::std::string::String>,
}
impl Watcher {
    /// <p></p>
    pub fn email(&self) -> &str {
        use std::ops::Deref;
        self.email.deref()
    }
    /// <p></p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p></p>
    pub fn job_title(&self) -> ::std::option::Option<&str> {
        self.job_title.as_deref()
    }
}
impl ::std::fmt::Debug for Watcher {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("Watcher");
        formatter.field("email", &"*** Sensitive Data Redacted ***");
        formatter.field("name", &"*** Sensitive Data Redacted ***");
        formatter.field("job_title", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl Watcher {
    /// Creates a new builder-style object to manufacture [`Watcher`](crate::types::Watcher).
    pub fn builder() -> crate::types::builders::WatcherBuilder {
        crate::types::builders::WatcherBuilder::default()
    }
}

/// A builder for [`Watcher`](crate::types::Watcher).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct WatcherBuilder {
    pub(crate) email: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) job_title: ::std::option::Option<::std::string::String>,
}
impl WatcherBuilder {
    /// <p></p>
    /// This field is required.
    pub fn email(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.email = ::std::option::Option::Some(input.into());
        self
    }
    /// <p></p>
    pub fn set_email(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.email = input;
        self
    }
    /// <p></p>
    pub fn get_email(&self) -> &::std::option::Option<::std::string::String> {
        &self.email
    }
    /// <p></p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p></p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p></p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p></p>
    pub fn job_title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.job_title = ::std::option::Option::Some(input.into());
        self
    }
    /// <p></p>
    pub fn set_job_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.job_title = input;
        self
    }
    /// <p></p>
    pub fn get_job_title(&self) -> &::std::option::Option<::std::string::String> {
        &self.job_title
    }
    /// Consumes the builder and constructs a [`Watcher`](crate::types::Watcher).
    /// This method will fail if any of the following fields are not set:
    /// - [`email`](crate::types::builders::WatcherBuilder::email)
    pub fn build(self) -> ::std::result::Result<crate::types::Watcher, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Watcher {
            email: self.email.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "email",
                    "email was not specified but it is required when building Watcher",
                )
            })?,
            name: self.name,
            job_title: self.job_title,
        })
    }
}
impl ::std::fmt::Debug for WatcherBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("WatcherBuilder");
        formatter.field("email", &"*** Sensitive Data Redacted ***");
        formatter.field("name", &"*** Sensitive Data Redacted ***");
        formatter.field("job_title", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}