1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + |
|
3 + | /// <p>The document can't be shared with more Amazon Web Services accounts. You can specify a maximum of 20 accounts per API operation to share a private document.</p>
|
4 + | /// <p>By default, you can share a private document with a maximum of 1,000 accounts and publicly share up to five documents.</p>
|
5 + | /// <p>If you need to increase the quota for privately or publicly shared Systems Manager documents, contact Amazon Web Services Support.</p>
|
6 + | #[non_exhaustive]
|
7 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
8 + | pub struct DocumentPermissionLimit {
|
9 + | #[allow(missing_docs)] // documentation missing in model
|
10 + | pub message: ::std::option::Option<::std::string::String>,
|
11 + | pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
|
12 + | }
|
13 + | static DOCUMENTPERMISSIONLIMIT_MEMBER_MESSAGE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
14 + | ::aws_smithy_schema::ShapeId::from_parts(
|
15 + | "com.amazonaws.ssm#DocumentPermissionLimit$Message",
|
16 + | "com.amazonaws.ssm",
|
17 + | "DocumentPermissionLimit",
|
18 + | ),
|
19 + | ::aws_smithy_schema::ShapeType::String,
|
20 + | "Message",
|
21 + | 0,
|
22 + | );
|
23 + | static DOCUMENTPERMISSIONLIMIT_TRAITS: std::sync::LazyLock<::aws_smithy_schema::TraitMap> = std::sync::LazyLock::new(|| {
|
24 + | let mut map = ::aws_smithy_schema::TraitMap::new();
|
25 + | map.insert(Box::new(::aws_smithy_schema::DocumentTrait::new(
|
26 + | ::aws_smithy_schema::ShapeId::from_parts("aws.protocols#awsQueryError", "aws.protocols", "awsQueryError"),
|
27 + | {
|
28 + | let mut obj = ::aws_smithy_types::document::DocumentObject::new();
|
29 + | obj.insert(
|
30 + | "code".to_string(),
|
31 + | ::aws_smithy_types::Document::String("DocumentPermissionLimit".to_string()),
|
32 + | );
|
33 + | obj.insert(
|
34 + | "httpResponseCode".to_string(),
|
35 + | ::aws_smithy_types::Document::Number(::aws_smithy_types::Number::PosInt(400u64)),
|
36 + | );
|
37 + | ::aws_smithy_types::Document::Object(obj)
|
38 + | },
|
39 + | )));
|
40 + | map
|
41 + | });
|
42 + | static DOCUMENTPERMISSIONLIMIT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
|
43 + | ::aws_smithy_schema::ShapeId::from_parts(
|
44 + | "com.amazonaws.ssm#DocumentPermissionLimit",
|
45 + | "com.amazonaws.ssm",
|
46 + | "DocumentPermissionLimit",
|
47 + | ),
|
48 + | ::aws_smithy_schema::ShapeType::Structure,
|
49 + | &[&DOCUMENTPERMISSIONLIMIT_MEMBER_MESSAGE],
|
50 + | )
|
51 + | .with_traits(&DOCUMENTPERMISSIONLIMIT_TRAITS);
|
52 + | impl DocumentPermissionLimit {
|
53 + | /// The schema for this shape.
|
54 + | pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DOCUMENTPERMISSIONLIMIT_SCHEMA;
|
55 + | }
|
56 + | impl ::aws_smithy_schema::serde::SerializableStruct for DocumentPermissionLimit {
|
57 + | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
58 + | fn serialize_members(
|
59 + | &self,
|
60 + | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
61 + | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
62 + | if let Some(ref val) = self.message {
|
63 + | ser.write_string(&DOCUMENTPERMISSIONLIMIT_MEMBER_MESSAGE, val)?;
|
64 + | }
|
65 + | Ok(())
|
66 + | }
|
67 + | }
|
68 + | impl DocumentPermissionLimit {
|
69 + | /// Deserializes this structure from a [`ShapeDeserializer`].
|
70 + | pub fn deserialize(
|
71 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
72 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
73 + | #[allow(unused_variables, unused_mut)]
|
74 + | let mut builder = Self::builder();
|
75 + | #[allow(
|
76 + | unused_variables,
|
77 + | unreachable_code,
|
78 + | clippy::single_match,
|
79 + | clippy::match_single_binding,
|
80 + | clippy::diverging_sub_expression
|
81 + | )]
|
82 + | deserializer.read_struct(&DOCUMENTPERMISSIONLIMIT_SCHEMA, &mut |member, deser| {
|
83 + | match member.member_index() {
|
84 + | Some(0) => {
|
85 + | if deser.is_null() {
|
86 + | deser.read_null()?;
|
87 + | } else {
|
88 + | builder.message = Some(deser.read_string(member)?);
|
89 + | }
|
90 + | }
|
91 + | _ => {}
|
92 + | }
|
93 + | Ok(())
|
94 + | })?;
|
95 + | Ok(builder.build())
|
96 + | }
|
97 + | }
|
98 + | impl DocumentPermissionLimit {
|
99 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
100 + | pub fn deserialize_with_response(
|
101 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
102 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
103 + | _status: u16,
|
104 + | body: &[u8],
|
105 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
106 + | if body.is_empty() {
|
107 + | return Ok(Self::builder().build());
|
108 + | }
|
109 + | Self::deserialize(deserializer)
|
110 + | }
|
111 + | }
|
112 + | impl DocumentPermissionLimit {
|
113 + | /// Returns the error message.
|
114 + | pub fn message(&self) -> ::std::option::Option<&str> {
|
115 + | self.message.as_deref()
|
116 + | }
|
117 + | }
|
118 + | impl ::std::fmt::Display for DocumentPermissionLimit {
|
119 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
120 + | ::std::write!(f, "DocumentPermissionLimit")?;
|
121 + | if let ::std::option::Option::Some(inner_1) = &self.message {
|
122 + | {
|
123 + | ::std::write!(f, ": {inner_1}")?;
|
124 + | }
|
125 + | }
|
126 + | Ok(())
|
127 + | }
|
128 + | }
|
129 + | impl ::std::error::Error for DocumentPermissionLimit {}
|
130 + | impl ::aws_types::request_id::RequestId for crate::types::error::DocumentPermissionLimit {
|
131 + | fn request_id(&self) -> Option<&str> {
|
132 + | use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
|
133 + | self.meta().request_id()
|
134 + | }
|
135 + | }
|
136 + | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DocumentPermissionLimit {
|
137 + | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
138 + | &self.meta
|
139 + | }
|
140 + | }
|
141 + | impl DocumentPermissionLimit {
|
142 + | /// Creates a new builder-style object to manufacture [`DocumentPermissionLimit`](crate::types::error::DocumentPermissionLimit).
|
143 + | pub fn builder() -> crate::types::error::builders::DocumentPermissionLimitBuilder {
|
144 + | crate::types::error::builders::DocumentPermissionLimitBuilder::default()
|
145 + | }
|
146 + | }
|
147 + |
|
148 + | /// A builder for [`DocumentPermissionLimit`](crate::types::error::DocumentPermissionLimit).
|
149 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
150 + | #[non_exhaustive]
|
151 + | pub struct DocumentPermissionLimitBuilder {
|
152 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
153 + | meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
154 + | }
|
155 + | impl DocumentPermissionLimitBuilder {
|
156 + | #[allow(missing_docs)] // documentation missing in model
|
157 + | pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
158 + | self.message = ::std::option::Option::Some(input.into());
|
159 + | self
|
160 + | }
|
161 + | #[allow(missing_docs)] // documentation missing in model
|
162 + | pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
163 + | self.message = input;
|
164 + | self
|
165 + | }
|
166 + | #[allow(missing_docs)] // documentation missing in model
|
167 + | pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
|
168 + | &self.message
|
169 + | }
|
170 + | /// Sets error metadata
|
171 + | pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
172 + | self.meta = Some(meta);
|
173 + | self
|
174 + | }
|
175 + |
|
176 + | /// Sets error metadata
|
177 + | pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
|
178 + | self.meta = meta;
|
179 + | self
|
180 + | }
|
181 + | /// Consumes the builder and constructs a [`DocumentPermissionLimit`](crate::types::error::DocumentPermissionLimit).
|
182 + | pub fn build(self) -> crate::types::error::DocumentPermissionLimit {
|
183 + | crate::types::error::DocumentPermissionLimit {
|
184 + | message: self.message,
|
185 + | meta: self.meta.unwrap_or_default(),
|
186 + | }
|
187 + | }
|
188 + | }
|