aws_sdk_securityir/operation/get_membership/
_get_membership_output.rs#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct GetMembershipOutput {
pub membership_id: ::std::string::String,
pub account_id: ::std::option::Option<::std::string::String>,
pub region: ::std::option::Option<crate::types::AwsRegion>,
pub membership_name: ::std::option::Option<::std::string::String>,
pub membership_arn: ::std::option::Option<::std::string::String>,
pub membership_status: ::std::option::Option<crate::types::MembershipStatus>,
pub membership_activation_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
pub membership_deactivation_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
pub customer_type: ::std::option::Option<crate::types::CustomerType>,
pub number_of_accounts_covered: ::std::option::Option<i64>,
pub incident_response_team: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>,
pub opt_in_features: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>,
_request_id: Option<String>,
}
impl GetMembershipOutput {
pub fn membership_id(&self) -> &str {
use std::ops::Deref;
self.membership_id.deref()
}
pub fn account_id(&self) -> ::std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn region(&self) -> ::std::option::Option<&crate::types::AwsRegion> {
self.region.as_ref()
}
pub fn membership_name(&self) -> ::std::option::Option<&str> {
self.membership_name.as_deref()
}
pub fn membership_arn(&self) -> ::std::option::Option<&str> {
self.membership_arn.as_deref()
}
pub fn membership_status(&self) -> ::std::option::Option<&crate::types::MembershipStatus> {
self.membership_status.as_ref()
}
pub fn membership_activation_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.membership_activation_timestamp.as_ref()
}
pub fn membership_deactivation_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.membership_deactivation_timestamp.as_ref()
}
pub fn customer_type(&self) -> ::std::option::Option<&crate::types::CustomerType> {
self.customer_type.as_ref()
}
pub fn number_of_accounts_covered(&self) -> ::std::option::Option<i64> {
self.number_of_accounts_covered
}
pub fn incident_response_team(&self) -> &[crate::types::IncidentResponder] {
self.incident_response_team.as_deref().unwrap_or_default()
}
pub fn opt_in_features(&self) -> &[crate::types::OptInFeature] {
self.opt_in_features.as_deref().unwrap_or_default()
}
}
impl ::std::fmt::Debug for GetMembershipOutput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("GetMembershipOutput");
formatter.field("membership_id", &self.membership_id);
formatter.field("account_id", &self.account_id);
formatter.field("region", &self.region);
formatter.field("membership_name", &"*** Sensitive Data Redacted ***");
formatter.field("membership_arn", &self.membership_arn);
formatter.field("membership_status", &self.membership_status);
formatter.field("membership_activation_timestamp", &self.membership_activation_timestamp);
formatter.field("membership_deactivation_timestamp", &self.membership_deactivation_timestamp);
formatter.field("customer_type", &self.customer_type);
formatter.field("number_of_accounts_covered", &self.number_of_accounts_covered);
formatter.field("incident_response_team", &self.incident_response_team);
formatter.field("opt_in_features", &self.opt_in_features);
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}
impl ::aws_types::request_id::RequestId for GetMembershipOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetMembershipOutput {
pub fn builder() -> crate::operation::get_membership::builders::GetMembershipOutputBuilder {
crate::operation::get_membership::builders::GetMembershipOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct GetMembershipOutputBuilder {
pub(crate) membership_id: ::std::option::Option<::std::string::String>,
pub(crate) account_id: ::std::option::Option<::std::string::String>,
pub(crate) region: ::std::option::Option<crate::types::AwsRegion>,
pub(crate) membership_name: ::std::option::Option<::std::string::String>,
pub(crate) membership_arn: ::std::option::Option<::std::string::String>,
pub(crate) membership_status: ::std::option::Option<crate::types::MembershipStatus>,
pub(crate) membership_activation_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) membership_deactivation_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) customer_type: ::std::option::Option<crate::types::CustomerType>,
pub(crate) number_of_accounts_covered: ::std::option::Option<i64>,
pub(crate) incident_response_team: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>,
pub(crate) opt_in_features: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>,
_request_id: Option<String>,
}
impl GetMembershipOutputBuilder {
pub fn membership_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.membership_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_membership_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.membership_id = input;
self
}
pub fn get_membership_id(&self) -> &::std::option::Option<::std::string::String> {
&self.membership_id
}
pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.account_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
&self.account_id
}
pub fn region(mut self, input: crate::types::AwsRegion) -> Self {
self.region = ::std::option::Option::Some(input);
self
}
pub fn set_region(mut self, input: ::std::option::Option<crate::types::AwsRegion>) -> Self {
self.region = input;
self
}
pub fn get_region(&self) -> &::std::option::Option<crate::types::AwsRegion> {
&self.region
}
pub fn membership_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.membership_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_membership_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.membership_name = input;
self
}
pub fn get_membership_name(&self) -> &::std::option::Option<::std::string::String> {
&self.membership_name
}
pub fn membership_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.membership_arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_membership_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.membership_arn = input;
self
}
pub fn get_membership_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.membership_arn
}
pub fn membership_status(mut self, input: crate::types::MembershipStatus) -> Self {
self.membership_status = ::std::option::Option::Some(input);
self
}
pub fn set_membership_status(mut self, input: ::std::option::Option<crate::types::MembershipStatus>) -> Self {
self.membership_status = input;
self
}
pub fn get_membership_status(&self) -> &::std::option::Option<crate::types::MembershipStatus> {
&self.membership_status
}
pub fn membership_activation_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.membership_activation_timestamp = ::std::option::Option::Some(input);
self
}
pub fn set_membership_activation_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.membership_activation_timestamp = input;
self
}
pub fn get_membership_activation_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.membership_activation_timestamp
}
pub fn membership_deactivation_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.membership_deactivation_timestamp = ::std::option::Option::Some(input);
self
}
pub fn set_membership_deactivation_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.membership_deactivation_timestamp = input;
self
}
pub fn get_membership_deactivation_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.membership_deactivation_timestamp
}
pub fn customer_type(mut self, input: crate::types::CustomerType) -> Self {
self.customer_type = ::std::option::Option::Some(input);
self
}
pub fn set_customer_type(mut self, input: ::std::option::Option<crate::types::CustomerType>) -> Self {
self.customer_type = input;
self
}
pub fn get_customer_type(&self) -> &::std::option::Option<crate::types::CustomerType> {
&self.customer_type
}
pub fn number_of_accounts_covered(mut self, input: i64) -> Self {
self.number_of_accounts_covered = ::std::option::Option::Some(input);
self
}
pub fn set_number_of_accounts_covered(mut self, input: ::std::option::Option<i64>) -> Self {
self.number_of_accounts_covered = input;
self
}
pub fn get_number_of_accounts_covered(&self) -> &::std::option::Option<i64> {
&self.number_of_accounts_covered
}
pub fn incident_response_team(mut self, input: crate::types::IncidentResponder) -> Self {
let mut v = self.incident_response_team.unwrap_or_default();
v.push(input);
self.incident_response_team = ::std::option::Option::Some(v);
self
}
pub fn set_incident_response_team(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>) -> Self {
self.incident_response_team = input;
self
}
pub fn get_incident_response_team(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>> {
&self.incident_response_team
}
pub fn opt_in_features(mut self, input: crate::types::OptInFeature) -> Self {
let mut v = self.opt_in_features.unwrap_or_default();
v.push(input);
self.opt_in_features = ::std::option::Option::Some(v);
self
}
pub fn set_opt_in_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>) -> Self {
self.opt_in_features = input;
self
}
pub fn get_opt_in_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>> {
&self.opt_in_features
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::get_membership::GetMembershipOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_membership::GetMembershipOutput {
membership_id: self.membership_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"membership_id",
"membership_id was not specified but it is required when building GetMembershipOutput",
)
})?,
account_id: self.account_id,
region: self.region,
membership_name: self.membership_name,
membership_arn: self.membership_arn,
membership_status: self.membership_status,
membership_activation_timestamp: self.membership_activation_timestamp,
membership_deactivation_timestamp: self.membership_deactivation_timestamp,
customer_type: self.customer_type,
number_of_accounts_covered: self.number_of_accounts_covered,
incident_response_team: self.incident_response_team,
opt_in_features: self.opt_in_features,
_request_id: self._request_id,
})
}
}
impl ::std::fmt::Debug for GetMembershipOutputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("GetMembershipOutputBuilder");
formatter.field("membership_id", &self.membership_id);
formatter.field("account_id", &self.account_id);
formatter.field("region", &self.region);
formatter.field("membership_name", &"*** Sensitive Data Redacted ***");
formatter.field("membership_arn", &self.membership_arn);
formatter.field("membership_status", &self.membership_status);
formatter.field("membership_activation_timestamp", &self.membership_activation_timestamp);
formatter.field("membership_deactivation_timestamp", &self.membership_deactivation_timestamp);
formatter.field("customer_type", &self.customer_type);
formatter.field("number_of_accounts_covered", &self.number_of_accounts_covered);
formatter.field("incident_response_team", &self.incident_response_team);
formatter.field("opt_in_features", &self.opt_in_features);
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}