aws_sdk_sso/operation/logout/
_logout_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct LogoutInput {
6 pub access_token: ::std::option::Option<::std::string::String>,
8}
9impl LogoutInput {
10 pub fn access_token(&self) -> ::std::option::Option<&str> {
12 self.access_token.as_deref()
13 }
14}
15impl ::std::fmt::Debug for LogoutInput {
16 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
17 let mut formatter = f.debug_struct("LogoutInput");
18 formatter.field("access_token", &"*** Sensitive Data Redacted ***");
19 formatter.finish()
20 }
21}
22static LOGOUTINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.sso.synthetic#LogoutInput", "com.amazonaws.sso.synthetic", "LogoutInput");
23static LOGOUTINPUT_MEMBER_ACCESS_TOKEN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
24 ::aws_smithy_schema::ShapeId::from_static(
25 "com.amazonaws.sso.synthetic#LogoutInput$accessToken",
26 "com.amazonaws.sso.synthetic",
27 "LogoutInput",
28 ),
29 ::aws_smithy_schema::ShapeType::String,
30 "accessToken",
31 0,
32 )
33 .with_http_header("x-amz-sso_bearer_token");
34static LOGOUTINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
35 LOGOUTINPUT_SCHEMA_ID,
36 ::aws_smithy_schema::ShapeType::Structure,
37 &[&LOGOUTINPUT_MEMBER_ACCESS_TOKEN],
38 )
39 .with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/logout", None));
40impl LogoutInput {
41 pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &LOGOUTINPUT_SCHEMA;
43 }
44impl ::aws_smithy_schema::serde::SerializableStruct for LogoutInput {
45 #[allow(unused_variables, clippy::diverging_sub_expression)]
46 fn serialize_members(&self, ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
47 if let Some(ref val) = self.access_token {
48 ser.write_string(&LOGOUTINPUT_MEMBER_ACCESS_TOKEN, val)?;
49 }
50 Ok(())
51 }
52 }
53impl LogoutInput {
54 pub fn deserialize(deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
56 #[allow(unused_variables, unused_mut)]
57 let mut builder = Self::builder();
58 #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
59 deserializer.read_struct(&LOGOUTINPUT_SCHEMA, &mut |member, deser| {
60 match member.member_index() {
61 Some(0) => {
62 builder.access_token = Some(deser.read_string(member)?);
63 }
64 _ => {}
65 }
66 Ok(())
67 })?;
68 builder.access_token = builder.access_token.or(Some(String::new()));
69builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
70 }
71 }
72impl LogoutInput {
73 pub fn deserialize_with_response(
77 _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
78 headers: &::aws_smithy_runtime_api::http::Headers,
79 _status: u16,
80 _body: &[u8],
81 ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
82 #[allow(unused_variables, unused_mut)]
83 let mut builder = Self::builder();
84if let Some(val) = headers.get("x-amz-sso_bearer_token") {
85 builder.access_token = Some(val.to_string());
86 }
87builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
88 }
89 }
90impl LogoutInput {
91 pub fn builder() -> crate::operation::logout::builders::LogoutInputBuilder {
93 crate::operation::logout::builders::LogoutInputBuilder::default()
94 }
95}
96
97#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
99#[non_exhaustive]
100pub struct LogoutInputBuilder {
101 pub(crate) access_token: ::std::option::Option<::std::string::String>,
102}
103impl LogoutInputBuilder {
104 pub fn access_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107 self.access_token = ::std::option::Option::Some(input.into());
108 self
109 }
110 pub fn set_access_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
112 self.access_token = input; self
113 }
114 pub fn get_access_token(&self) -> &::std::option::Option<::std::string::String> {
116 &self.access_token
117 }
118 pub fn build(self) -> ::std::result::Result<crate::operation::logout::LogoutInput, ::aws_smithy_types::error::operation::BuildError> {
120 ::std::result::Result::Ok(
121 crate::operation::logout::LogoutInput {
122 access_token: self.access_token
123 ,
124 }
125 )
126 }
127}
128impl ::std::fmt::Debug for LogoutInputBuilder {
129 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
130 let mut formatter = f.debug_struct("LogoutInputBuilder");
131 formatter.field("access_token", &"*** Sensitive Data Redacted ***");
132 formatter.finish()
133 }
134}
135