aws_sdk_connectparticipant/operation/get_attachment/
_get_attachment_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetAttachmentOutput {
6 pub url: ::std::option::Option<::std::string::String>,
8 pub url_expiry: ::std::option::Option<::std::string::String>,
10 pub attachment_size_in_bytes: i64,
12 _request_id: Option<String>,
13}
14impl GetAttachmentOutput {
15 pub fn url(&self) -> ::std::option::Option<&str> {
17 self.url.as_deref()
18 }
19 pub fn url_expiry(&self) -> ::std::option::Option<&str> {
21 self.url_expiry.as_deref()
22 }
23 pub fn attachment_size_in_bytes(&self) -> i64 {
25 self.attachment_size_in_bytes
26 }
27}
28impl ::aws_types::request_id::RequestId for GetAttachmentOutput {
29 fn request_id(&self) -> Option<&str> {
30 self._request_id.as_deref()
31 }
32}
33impl GetAttachmentOutput {
34 pub fn builder() -> crate::operation::get_attachment::builders::GetAttachmentOutputBuilder {
36 crate::operation::get_attachment::builders::GetAttachmentOutputBuilder::default()
37 }
38}
39
40#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct GetAttachmentOutputBuilder {
44 pub(crate) url: ::std::option::Option<::std::string::String>,
45 pub(crate) url_expiry: ::std::option::Option<::std::string::String>,
46 pub(crate) attachment_size_in_bytes: ::std::option::Option<i64>,
47 _request_id: Option<String>,
48}
49impl GetAttachmentOutputBuilder {
50 pub fn url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
52 self.url = ::std::option::Option::Some(input.into());
53 self
54 }
55 pub fn set_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57 self.url = input;
58 self
59 }
60 pub fn get_url(&self) -> &::std::option::Option<::std::string::String> {
62 &self.url
63 }
64 pub fn url_expiry(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66 self.url_expiry = ::std::option::Option::Some(input.into());
67 self
68 }
69 pub fn set_url_expiry(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71 self.url_expiry = input;
72 self
73 }
74 pub fn get_url_expiry(&self) -> &::std::option::Option<::std::string::String> {
76 &self.url_expiry
77 }
78 pub fn attachment_size_in_bytes(mut self, input: i64) -> Self {
81 self.attachment_size_in_bytes = ::std::option::Option::Some(input);
82 self
83 }
84 pub fn set_attachment_size_in_bytes(mut self, input: ::std::option::Option<i64>) -> Self {
86 self.attachment_size_in_bytes = input;
87 self
88 }
89 pub fn get_attachment_size_in_bytes(&self) -> &::std::option::Option<i64> {
91 &self.attachment_size_in_bytes
92 }
93 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
94 self._request_id = Some(request_id.into());
95 self
96 }
97
98 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
99 self._request_id = request_id;
100 self
101 }
102 pub fn build(
106 self,
107 ) -> ::std::result::Result<crate::operation::get_attachment::GetAttachmentOutput, ::aws_smithy_types::error::operation::BuildError> {
108 ::std::result::Result::Ok(crate::operation::get_attachment::GetAttachmentOutput {
109 url: self.url,
110 url_expiry: self.url_expiry,
111 attachment_size_in_bytes: self.attachment_size_in_bytes.ok_or_else(|| {
112 ::aws_smithy_types::error::operation::BuildError::missing_field(
113 "attachment_size_in_bytes",
114 "attachment_size_in_bytes was not specified but it is required when building GetAttachmentOutput",
115 )
116 })?,
117 _request_id: self._request_id,
118 })
119 }
120}