aws_sdk_datazone/operation/cancel_subscription/
_cancel_subscription_output.rs#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CancelSubscriptionOutput {
pub id: ::std::string::String,
pub created_by: ::std::string::String,
pub updated_by: ::std::option::Option<::std::string::String>,
pub domain_id: ::std::string::String,
pub status: crate::types::SubscriptionStatus,
pub created_at: ::aws_smithy_types::DateTime,
pub updated_at: ::aws_smithy_types::DateTime,
pub subscribed_principal: ::std::option::Option<crate::types::SubscribedPrincipal>,
pub subscribed_listing: ::std::option::Option<crate::types::SubscribedListing>,
pub subscription_request_id: ::std::option::Option<::std::string::String>,
pub retain_permissions: ::std::option::Option<bool>,
_request_id: Option<String>,
}
impl CancelSubscriptionOutput {
pub fn id(&self) -> &str {
use std::ops::Deref;
self.id.deref()
}
pub fn created_by(&self) -> &str {
use std::ops::Deref;
self.created_by.deref()
}
pub fn updated_by(&self) -> ::std::option::Option<&str> {
self.updated_by.as_deref()
}
pub fn domain_id(&self) -> &str {
use std::ops::Deref;
self.domain_id.deref()
}
pub fn status(&self) -> &crate::types::SubscriptionStatus {
&self.status
}
pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
&self.created_at
}
pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
&self.updated_at
}
pub fn subscribed_principal(&self) -> ::std::option::Option<&crate::types::SubscribedPrincipal> {
self.subscribed_principal.as_ref()
}
pub fn subscribed_listing(&self) -> ::std::option::Option<&crate::types::SubscribedListing> {
self.subscribed_listing.as_ref()
}
pub fn subscription_request_id(&self) -> ::std::option::Option<&str> {
self.subscription_request_id.as_deref()
}
pub fn retain_permissions(&self) -> ::std::option::Option<bool> {
self.retain_permissions
}
}
impl ::aws_types::request_id::RequestId for CancelSubscriptionOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl CancelSubscriptionOutput {
pub fn builder() -> crate::operation::cancel_subscription::builders::CancelSubscriptionOutputBuilder {
crate::operation::cancel_subscription::builders::CancelSubscriptionOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CancelSubscriptionOutputBuilder {
pub(crate) id: ::std::option::Option<::std::string::String>,
pub(crate) created_by: ::std::option::Option<::std::string::String>,
pub(crate) updated_by: ::std::option::Option<::std::string::String>,
pub(crate) domain_id: ::std::option::Option<::std::string::String>,
pub(crate) status: ::std::option::Option<crate::types::SubscriptionStatus>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) subscribed_principal: ::std::option::Option<crate::types::SubscribedPrincipal>,
pub(crate) subscribed_listing: ::std::option::Option<crate::types::SubscribedListing>,
pub(crate) subscription_request_id: ::std::option::Option<::std::string::String>,
pub(crate) retain_permissions: ::std::option::Option<bool>,
_request_id: Option<String>,
}
impl CancelSubscriptionOutputBuilder {
pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.id = ::std::option::Option::Some(input.into());
self
}
pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.id = input;
self
}
pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
&self.id
}
pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.created_by = ::std::option::Option::Some(input.into());
self
}
pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.created_by = input;
self
}
pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
&self.created_by
}
pub fn updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.updated_by = ::std::option::Option::Some(input.into());
self
}
pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.updated_by = input;
self
}
pub fn get_updated_by(&self) -> &::std::option::Option<::std::string::String> {
&self.updated_by
}
pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.domain_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.domain_id = input;
self
}
pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
&self.domain_id
}
pub fn status(mut self, input: crate::types::SubscriptionStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
pub fn set_status(mut self, input: ::std::option::Option<crate::types::SubscriptionStatus>) -> Self {
self.status = input;
self
}
pub fn get_status(&self) -> &::std::option::Option<crate::types::SubscriptionStatus> {
&self.status
}
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.updated_at = ::std::option::Option::Some(input);
self
}
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.updated_at
}
pub fn subscribed_principal(mut self, input: crate::types::SubscribedPrincipal) -> Self {
self.subscribed_principal = ::std::option::Option::Some(input);
self
}
pub fn set_subscribed_principal(mut self, input: ::std::option::Option<crate::types::SubscribedPrincipal>) -> Self {
self.subscribed_principal = input;
self
}
pub fn get_subscribed_principal(&self) -> &::std::option::Option<crate::types::SubscribedPrincipal> {
&self.subscribed_principal
}
pub fn subscribed_listing(mut self, input: crate::types::SubscribedListing) -> Self {
self.subscribed_listing = ::std::option::Option::Some(input);
self
}
pub fn set_subscribed_listing(mut self, input: ::std::option::Option<crate::types::SubscribedListing>) -> Self {
self.subscribed_listing = input;
self
}
pub fn get_subscribed_listing(&self) -> &::std::option::Option<crate::types::SubscribedListing> {
&self.subscribed_listing
}
pub fn subscription_request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.subscription_request_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_subscription_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.subscription_request_id = input;
self
}
pub fn get_subscription_request_id(&self) -> &::std::option::Option<::std::string::String> {
&self.subscription_request_id
}
pub fn retain_permissions(mut self, input: bool) -> Self {
self.retain_permissions = ::std::option::Option::Some(input);
self
}
pub fn set_retain_permissions(mut self, input: ::std::option::Option<bool>) -> Self {
self.retain_permissions = input;
self
}
pub fn get_retain_permissions(&self) -> &::std::option::Option<bool> {
&self.retain_permissions
}
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::cancel_subscription::CancelSubscriptionOutput, ::aws_smithy_types::error::operation::BuildError>
{
::std::result::Result::Ok(crate::operation::cancel_subscription::CancelSubscriptionOutput {
id: self.id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"id",
"id was not specified but it is required when building CancelSubscriptionOutput",
)
})?,
created_by: self.created_by.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"created_by",
"created_by was not specified but it is required when building CancelSubscriptionOutput",
)
})?,
updated_by: self.updated_by,
domain_id: self.domain_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"domain_id",
"domain_id was not specified but it is required when building CancelSubscriptionOutput",
)
})?,
status: self.status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"status",
"status was not specified but it is required when building CancelSubscriptionOutput",
)
})?,
created_at: self.created_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"created_at",
"created_at was not specified but it is required when building CancelSubscriptionOutput",
)
})?,
updated_at: self.updated_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"updated_at",
"updated_at was not specified but it is required when building CancelSubscriptionOutput",
)
})?,
subscribed_principal: self.subscribed_principal,
subscribed_listing: self.subscribed_listing,
subscription_request_id: self.subscription_request_id,
retain_permissions: self.retain_permissions,
_request_id: self._request_id,
})
}
}