aws_sdk_iam/operation/list_user_tags/_list_user_tags_output.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct ListUserTagsOutput {
6 /// <p>The list of tags that are currently attached to the user. Each tag consists of a key name and an associated value. If no tags are attached to the specified resource, the response contains an empty list.</p>
7 pub tags: ::std::vec::Vec<crate::types::Tag>,
8 /// <p>A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the <code>Marker</code> request parameter to retrieve more items. Note that IAM might return fewer than the <code>MaxItems</code> number of results even when there are more results available. We recommend that you check <code>IsTruncated</code> after every call to ensure that you receive all your results.</p>
9 pub is_truncated: bool,
10 /// <p>When <code>IsTruncated</code> is <code>true</code>, this element is present and contains the value to use for the <code>Marker</code> parameter in a subsequent pagination request.</p>
11 pub marker: ::std::option::Option<::std::string::String>,
12 _request_id: Option<String>,
13}
14impl ListUserTagsOutput {
15 /// <p>The list of tags that are currently attached to the user. Each tag consists of a key name and an associated value. If no tags are attached to the specified resource, the response contains an empty list.</p>
16 pub fn tags(&self) -> &[crate::types::Tag] {
17 use std::ops::Deref;
18 self.tags.deref()
19 }
20 /// <p>A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the <code>Marker</code> request parameter to retrieve more items. Note that IAM might return fewer than the <code>MaxItems</code> number of results even when there are more results available. We recommend that you check <code>IsTruncated</code> after every call to ensure that you receive all your results.</p>
21 pub fn is_truncated(&self) -> bool {
22 self.is_truncated
23 }
24 /// <p>When <code>IsTruncated</code> is <code>true</code>, this element is present and contains the value to use for the <code>Marker</code> parameter in a subsequent pagination request.</p>
25 pub fn marker(&self) -> ::std::option::Option<&str> {
26 self.marker.as_deref()
27 }
28}
29impl ::aws_types::request_id::RequestId for ListUserTagsOutput {
30 fn request_id(&self) -> Option<&str> {
31 self._request_id.as_deref()
32 }
33}
34impl ListUserTagsOutput {
35 /// Creates a new builder-style object to manufacture [`ListUserTagsOutput`](crate::operation::list_user_tags::ListUserTagsOutput).
36 pub fn builder() -> crate::operation::list_user_tags::builders::ListUserTagsOutputBuilder {
37 crate::operation::list_user_tags::builders::ListUserTagsOutputBuilder::default()
38 }
39}
40
41/// A builder for [`ListUserTagsOutput`](crate::operation::list_user_tags::ListUserTagsOutput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct ListUserTagsOutputBuilder {
45 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
46 pub(crate) is_truncated: ::std::option::Option<bool>,
47 pub(crate) marker: ::std::option::Option<::std::string::String>,
48 _request_id: Option<String>,
49}
50impl ListUserTagsOutputBuilder {
51 /// Appends an item to `tags`.
52 ///
53 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
54 ///
55 /// <p>The list of tags that are currently attached to the user. Each tag consists of a key name and an associated value. If no tags are attached to the specified resource, the response contains an empty list.</p>
56 pub fn tags(mut self, input: crate::types::Tag) -> Self {
57 let mut v = self.tags.unwrap_or_default();
58 v.push(input);
59 self.tags = ::std::option::Option::Some(v);
60 self
61 }
62 /// <p>The list of tags that are currently attached to the user. Each tag consists of a key name and an associated value. If no tags are attached to the specified resource, the response contains an empty list.</p>
63 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
64 self.tags = input;
65 self
66 }
67 /// <p>The list of tags that are currently attached to the user. Each tag consists of a key name and an associated value. If no tags are attached to the specified resource, the response contains an empty list.</p>
68 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
69 &self.tags
70 }
71 /// <p>A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the <code>Marker</code> request parameter to retrieve more items. Note that IAM might return fewer than the <code>MaxItems</code> number of results even when there are more results available. We recommend that you check <code>IsTruncated</code> after every call to ensure that you receive all your results.</p>
72 pub fn is_truncated(mut self, input: bool) -> Self {
73 self.is_truncated = ::std::option::Option::Some(input);
74 self
75 }
76 /// <p>A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the <code>Marker</code> request parameter to retrieve more items. Note that IAM might return fewer than the <code>MaxItems</code> number of results even when there are more results available. We recommend that you check <code>IsTruncated</code> after every call to ensure that you receive all your results.</p>
77 pub fn set_is_truncated(mut self, input: ::std::option::Option<bool>) -> Self {
78 self.is_truncated = input;
79 self
80 }
81 /// <p>A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the <code>Marker</code> request parameter to retrieve more items. Note that IAM might return fewer than the <code>MaxItems</code> number of results even when there are more results available. We recommend that you check <code>IsTruncated</code> after every call to ensure that you receive all your results.</p>
82 pub fn get_is_truncated(&self) -> &::std::option::Option<bool> {
83 &self.is_truncated
84 }
85 /// <p>When <code>IsTruncated</code> is <code>true</code>, this element is present and contains the value to use for the <code>Marker</code> parameter in a subsequent pagination request.</p>
86 pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87 self.marker = ::std::option::Option::Some(input.into());
88 self
89 }
90 /// <p>When <code>IsTruncated</code> is <code>true</code>, this element is present and contains the value to use for the <code>Marker</code> parameter in a subsequent pagination request.</p>
91 pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92 self.marker = input;
93 self
94 }
95 /// <p>When <code>IsTruncated</code> is <code>true</code>, this element is present and contains the value to use for the <code>Marker</code> parameter in a subsequent pagination request.</p>
96 pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
97 &self.marker
98 }
99 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
100 self._request_id = Some(request_id.into());
101 self
102 }
103
104 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
105 self._request_id = request_id;
106 self
107 }
108 /// Consumes the builder and constructs a [`ListUserTagsOutput`](crate::operation::list_user_tags::ListUserTagsOutput).
109 /// This method will fail if any of the following fields are not set:
110 /// - [`tags`](crate::operation::list_user_tags::builders::ListUserTagsOutputBuilder::tags)
111 pub fn build(
112 self,
113 ) -> ::std::result::Result<crate::operation::list_user_tags::ListUserTagsOutput, ::aws_smithy_types::error::operation::BuildError> {
114 ::std::result::Result::Ok(crate::operation::list_user_tags::ListUserTagsOutput {
115 tags: self.tags.ok_or_else(|| {
116 ::aws_smithy_types::error::operation::BuildError::missing_field(
117 "tags",
118 "tags was not specified but it is required when building ListUserTagsOutput",
119 )
120 })?,
121 is_truncated: self.is_truncated.unwrap_or_default(),
122 marker: self.marker,
123 _request_id: self._request_id,
124 })
125 }
126}