#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetEntitlementOutput {
pub application_arn: ::std::string::String,
pub entitlement_id: ::std::string::String,
pub entitlement: ::std::option::Option<crate::types::EntitlementDetails>,
pub created_at: ::aws_smithy_types::DateTime,
_request_id: Option<String>,
}
impl GetEntitlementOutput {
pub fn application_arn(&self) -> &str {
use std::ops::Deref;
self.application_arn.deref()
}
pub fn entitlement_id(&self) -> &str {
use std::ops::Deref;
self.entitlement_id.deref()
}
pub fn entitlement(&self) -> ::std::option::Option<&crate::types::EntitlementDetails> {
self.entitlement.as_ref()
}
pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
&self.created_at
}
}
impl ::aws_types::request_id::RequestId for GetEntitlementOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetEntitlementOutput {
pub fn builder() -> crate::operation::get_entitlement::builders::GetEntitlementOutputBuilder {
crate::operation::get_entitlement::builders::GetEntitlementOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetEntitlementOutputBuilder {
pub(crate) application_arn: ::std::option::Option<::std::string::String>,
pub(crate) entitlement_id: ::std::option::Option<::std::string::String>,
pub(crate) entitlement: ::std::option::Option<crate::types::EntitlementDetails>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
_request_id: Option<String>,
}
impl GetEntitlementOutputBuilder {
pub fn application_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.application_arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_application_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.application_arn = input;
self
}
pub fn get_application_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.application_arn
}
pub fn entitlement_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.entitlement_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_entitlement_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.entitlement_id = input;
self
}
pub fn get_entitlement_id(&self) -> &::std::option::Option<::std::string::String> {
&self.entitlement_id
}
pub fn entitlement(mut self, input: crate::types::EntitlementDetails) -> Self {
self.entitlement = ::std::option::Option::Some(input);
self
}
pub fn set_entitlement(mut self, input: ::std::option::Option<crate::types::EntitlementDetails>) -> Self {
self.entitlement = input;
self
}
pub fn get_entitlement(&self) -> &::std::option::Option<crate::types::EntitlementDetails> {
&self.entitlement
}
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(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_entitlement::GetEntitlementOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_entitlement::GetEntitlementOutput {
application_arn: self.application_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"application_arn",
"application_arn was not specified but it is required when building GetEntitlementOutput",
)
})?,
entitlement_id: self.entitlement_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"entitlement_id",
"entitlement_id was not specified but it is required when building GetEntitlementOutput",
)
})?,
entitlement: self.entitlement,
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 GetEntitlementOutput",
)
})?,
_request_id: self._request_id,
})
}
}