32 32 | /// <p>To learn the service namespace of a service, see <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/reference_policies_actions-resources-contextkeys.html">Actions, resources, and condition keys for Amazon Web Services services</a> in the <i>Service Authorization Reference</i>. Choose the name of the service to view details for that service. In the first paragraph, find the service prefix. For example, <code>(service prefix: a4b)</code>. For more information about service namespaces, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces">Amazon Web Services service namespaces</a> in the <i>Amazon Web Services General Reference</i>.</p>
|
33 33 | pub fn service_namespace(&self) -> &str {
|
34 34 | use std::ops::Deref;
|
35 35 | self.service_namespace.deref()
|
36 36 | }
|
37 37 | /// <p>The Region where the last service access attempt occurred.</p>
|
38 38 | /// <p>This field is null if no principals in the reported Organizations entity attempted to access the service within the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#service-last-accessed-reporting-period">tracking period</a>.</p>
|
39 39 | pub fn region(&self) -> ::std::option::Option<&str> {
|
40 40 | self.region.as_deref()
|
41 41 | }
|
42 42 | /// <p>The path of the Organizations entity (root, organizational unit, or account) from which an authenticated principal last attempted to access the service. Amazon Web Services does not report unauthenticated requests.</p>
|
43 43 | /// <p>This field is null if no principals (IAM users, IAM roles, or root user) in the reported Organizations entity attempted to access the service within the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#service-last-accessed-reporting-period">tracking period</a>.</p>
|
44 44 | pub fn entity_path(&self) -> ::std::option::Option<&str> {
|
45 45 | self.entity_path.as_deref()
|
46 46 | }
|
47 47 | /// <p>The date and time, in <a href="http://www.iso.org/iso/iso8601">ISO 8601 date-time format</a>, when an authenticated principal most recently attempted to access the service. Amazon Web Services does not report unauthenticated requests.</p>
|
48 48 | /// <p>This field is null if no principals in the reported Organizations entity attempted to access the service within the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#service-last-accessed-reporting-period">tracking period</a>.</p>
|
49 49 | pub fn last_authenticated_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
|
50 50 | self.last_authenticated_time.as_ref()
|
51 51 | }
|
52 52 | /// <p>The number of accounts with authenticated principals (root user, IAM users, and IAM roles) that attempted to access the service in the tracking period.</p>
|
53 53 | pub fn total_authenticated_entities(&self) -> ::std::option::Option<i32> {
|
54 54 | self.total_authenticated_entities
|
55 55 | }
|
56 56 | }
|
57 57 | static ACCESSDETAIL_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
|
58 58 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.iam#AccessDetail", "com.amazonaws.iam", "AccessDetail");
|
59 59 | static ACCESSDETAIL_MEMBER_SERVICE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
60 60 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.iam#AccessDetail$ServiceName", "com.amazonaws.iam", "AccessDetail"),
|
61 61 | ::aws_smithy_schema::ShapeType::String,
|
62 - | "service_name",
|
62 + | "ServiceName",
|
63 63 | 0,
|
64 64 | );
|
65 65 | static ACCESSDETAIL_MEMBER_SERVICE_NAMESPACE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
66 66 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.iam#AccessDetail$ServiceNamespace", "com.amazonaws.iam", "AccessDetail"),
|
67 67 | ::aws_smithy_schema::ShapeType::String,
|
68 - | "service_namespace",
|
68 + | "ServiceNamespace",
|
69 69 | 1,
|
70 70 | );
|
71 71 | static ACCESSDETAIL_MEMBER_REGION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
72 72 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.iam#AccessDetail$Region", "com.amazonaws.iam", "AccessDetail"),
|
73 73 | ::aws_smithy_schema::ShapeType::String,
|
74 - | "region",
|
74 + | "Region",
|
75 75 | 2,
|
76 76 | );
|
77 77 | static ACCESSDETAIL_MEMBER_ENTITY_PATH: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
78 78 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.iam#AccessDetail$EntityPath", "com.amazonaws.iam", "AccessDetail"),
|
79 79 | ::aws_smithy_schema::ShapeType::String,
|
80 - | "entity_path",
|
80 + | "EntityPath",
|
81 81 | 3,
|
82 82 | );
|
83 83 | static ACCESSDETAIL_MEMBER_LAST_AUTHENTICATED_TIME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
84 84 | ::aws_smithy_schema::ShapeId::from_static(
|
85 85 | "com.amazonaws.iam#AccessDetail$LastAuthenticatedTime",
|
86 86 | "com.amazonaws.iam",
|
87 87 | "AccessDetail",
|
88 88 | ),
|
89 89 | ::aws_smithy_schema::ShapeType::Timestamp,
|
90 - | "last_authenticated_time",
|
90 + | "LastAuthenticatedTime",
|
91 91 | 4,
|
92 92 | );
|
93 93 | static ACCESSDETAIL_MEMBER_TOTAL_AUTHENTICATED_ENTITIES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
94 94 | ::aws_smithy_schema::ShapeId::from_static(
|
95 95 | "com.amazonaws.iam#AccessDetail$TotalAuthenticatedEntities",
|
96 96 | "com.amazonaws.iam",
|
97 97 | "AccessDetail",
|
98 98 | ),
|
99 99 | ::aws_smithy_schema::ShapeType::Integer,
|
100 - | "total_authenticated_entities",
|
100 + | "TotalAuthenticatedEntities",
|
101 101 | 5,
|
102 102 | );
|
103 103 | static ACCESSDETAIL_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
104 104 | ACCESSDETAIL_SCHEMA_ID,
|
105 105 | ::aws_smithy_schema::ShapeType::Structure,
|
106 106 | &[
|
107 107 | &ACCESSDETAIL_MEMBER_SERVICE_NAME,
|
108 108 | &ACCESSDETAIL_MEMBER_SERVICE_NAMESPACE,
|
109 109 | &ACCESSDETAIL_MEMBER_REGION,
|
110 110 | &ACCESSDETAIL_MEMBER_ENTITY_PATH,
|
111 111 | &ACCESSDETAIL_MEMBER_LAST_AUTHENTICATED_TIME,
|
112 112 | &ACCESSDETAIL_MEMBER_TOTAL_AUTHENTICATED_ENTITIES,
|
113 113 | ],
|
114 114 | );
|
115 115 | impl AccessDetail {
|
116 116 | /// The schema for this shape.
|
117 117 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &ACCESSDETAIL_SCHEMA;
|
118 118 | }
|
119 119 | impl ::aws_smithy_schema::serde::SerializableStruct for AccessDetail {
|
120 120 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
121 121 | fn serialize_members(
|
122 122 | &self,
|
123 123 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
124 124 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
125 125 | {
|
126 126 | let val = &self.service_name;
|
127 127 | ser.write_string(&ACCESSDETAIL_MEMBER_SERVICE_NAME, val)?;
|
128 128 | }
|
129 129 | {
|
130 130 | let val = &self.service_namespace;
|
131 131 | ser.write_string(&ACCESSDETAIL_MEMBER_SERVICE_NAMESPACE, val)?;
|
132 132 | }
|
133 133 | if let Some(ref val) = self.region {
|
134 134 | ser.write_string(&ACCESSDETAIL_MEMBER_REGION, val)?;
|
135 135 | }
|
136 136 | if let Some(ref val) = self.entity_path {
|
137 137 | ser.write_string(&ACCESSDETAIL_MEMBER_ENTITY_PATH, val)?;
|
138 138 | }
|
139 139 | if let Some(ref val) = self.last_authenticated_time {
|
140 140 | ser.write_timestamp(&ACCESSDETAIL_MEMBER_LAST_AUTHENTICATED_TIME, val)?;
|
141 141 | }
|
142 142 | if let Some(ref val) = self.total_authenticated_entities {
|
143 143 | ser.write_integer(&ACCESSDETAIL_MEMBER_TOTAL_AUTHENTICATED_ENTITIES, *val)?;
|
144 144 | }
|
145 145 | Ok(())
|
146 146 | }
|
147 147 | }
|
148 148 | impl AccessDetail {
|
149 149 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
150 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
151 - | deserializer: &mut D,
|
150 + | pub fn deserialize(
|
151 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
152 152 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
153 153 | #[allow(unused_variables, unused_mut)]
|
154 154 | let mut builder = Self::builder();
|
155 155 | #[allow(
|
156 156 | unused_variables,
|
157 157 | unreachable_code,
|
158 158 | clippy::single_match,
|
159 159 | clippy::match_single_binding,
|
160 160 | clippy::diverging_sub_expression
|
161 161 | )]
|
162 - | deserializer.read_struct(&ACCESSDETAIL_SCHEMA, (), |_, member, deser| {
|
162 + | deserializer.read_struct(&ACCESSDETAIL_SCHEMA, &mut |member, deser| {
|
163 163 | match member.member_index() {
|
164 164 | Some(0) => {
|
165 165 | builder.service_name = Some(deser.read_string(member)?);
|
166 166 | }
|
167 167 | Some(1) => {
|
168 168 | builder.service_namespace = Some(deser.read_string(member)?);
|
169 169 | }
|
170 170 | Some(2) => {
|
171 171 | builder.region = Some(deser.read_string(member)?);
|
172 172 | }
|
173 173 | Some(3) => {
|
174 174 | builder.entity_path = Some(deser.read_string(member)?);
|
175 175 | }
|
176 176 | Some(4) => {
|
177 177 | builder.last_authenticated_time = Some(deser.read_timestamp(member)?);
|
178 178 | }
|
179 179 | Some(5) => {
|
180 180 | builder.total_authenticated_entities = Some(deser.read_integer(member)?);
|
181 181 | }
|
182 182 | _ => {}
|
183 183 | }
|
184 184 | Ok(())
|
185 185 | })?;
|
186 + | builder.service_name = builder.service_name.or(Some(String::new()));
|
187 + | builder.service_namespace = builder.service_namespace.or(Some(String::new()));
|
186 188 | builder
|
187 189 | .build()
|
188 190 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
189 191 | }
|
190 192 | }
|
193 + | impl AccessDetail {
|
194 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
195 + | pub fn deserialize_with_response(
|
196 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
197 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
198 + | _status: u16,
|
199 + | _body: &[u8],
|
200 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
201 + | Self::deserialize(deserializer)
|
202 + | }
|
203 + | }
|
191 204 | impl AccessDetail {
|
192 205 | /// Creates a new builder-style object to manufacture [`AccessDetail`](crate::types::AccessDetail).
|
193 206 | pub fn builder() -> crate::types::builders::AccessDetailBuilder {
|
194 207 | crate::types::builders::AccessDetailBuilder::default()
|
195 208 | }
|
196 209 | }
|
197 210 |
|
198 211 | /// A builder for [`AccessDetail`](crate::types::AccessDetail).
|
199 212 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
200 213 | #[non_exhaustive]
|