aws_sdk_workspacesweb/types/
_identity_provider_summary.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The summary of the identity provider.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
6pub struct IdentityProviderSummary {
7    /// <p>The ARN of the identity provider.</p>
8    pub identity_provider_arn: ::std::string::String,
9    /// <p>The identity provider name.</p>
10    pub identity_provider_name: ::std::option::Option<::std::string::String>,
11    /// <p>The identity provider type.</p>
12    pub identity_provider_type: ::std::option::Option<crate::types::IdentityProviderType>,
13}
14impl IdentityProviderSummary {
15    /// <p>The ARN of the identity provider.</p>
16    pub fn identity_provider_arn(&self) -> &str {
17        use std::ops::Deref;
18        self.identity_provider_arn.deref()
19    }
20    /// <p>The identity provider name.</p>
21    pub fn identity_provider_name(&self) -> ::std::option::Option<&str> {
22        self.identity_provider_name.as_deref()
23    }
24    /// <p>The identity provider type.</p>
25    pub fn identity_provider_type(&self) -> ::std::option::Option<&crate::types::IdentityProviderType> {
26        self.identity_provider_type.as_ref()
27    }
28}
29impl ::std::fmt::Debug for IdentityProviderSummary {
30    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
31        let mut formatter = f.debug_struct("IdentityProviderSummary");
32        formatter.field("identity_provider_arn", &self.identity_provider_arn);
33        formatter.field("identity_provider_name", &"*** Sensitive Data Redacted ***");
34        formatter.field("identity_provider_type", &self.identity_provider_type);
35        formatter.finish()
36    }
37}
38impl IdentityProviderSummary {
39    /// Creates a new builder-style object to manufacture [`IdentityProviderSummary`](crate::types::IdentityProviderSummary).
40    pub fn builder() -> crate::types::builders::IdentityProviderSummaryBuilder {
41        crate::types::builders::IdentityProviderSummaryBuilder::default()
42    }
43}
44
45/// A builder for [`IdentityProviderSummary`](crate::types::IdentityProviderSummary).
46#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
47#[non_exhaustive]
48pub struct IdentityProviderSummaryBuilder {
49    pub(crate) identity_provider_arn: ::std::option::Option<::std::string::String>,
50    pub(crate) identity_provider_name: ::std::option::Option<::std::string::String>,
51    pub(crate) identity_provider_type: ::std::option::Option<crate::types::IdentityProviderType>,
52}
53impl IdentityProviderSummaryBuilder {
54    /// <p>The ARN of the identity provider.</p>
55    /// This field is required.
56    pub fn identity_provider_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
57        self.identity_provider_arn = ::std::option::Option::Some(input.into());
58        self
59    }
60    /// <p>The ARN of the identity provider.</p>
61    pub fn set_identity_provider_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
62        self.identity_provider_arn = input;
63        self
64    }
65    /// <p>The ARN of the identity provider.</p>
66    pub fn get_identity_provider_arn(&self) -> &::std::option::Option<::std::string::String> {
67        &self.identity_provider_arn
68    }
69    /// <p>The identity provider name.</p>
70    pub fn identity_provider_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71        self.identity_provider_name = ::std::option::Option::Some(input.into());
72        self
73    }
74    /// <p>The identity provider name.</p>
75    pub fn set_identity_provider_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.identity_provider_name = input;
77        self
78    }
79    /// <p>The identity provider name.</p>
80    pub fn get_identity_provider_name(&self) -> &::std::option::Option<::std::string::String> {
81        &self.identity_provider_name
82    }
83    /// <p>The identity provider type.</p>
84    pub fn identity_provider_type(mut self, input: crate::types::IdentityProviderType) -> Self {
85        self.identity_provider_type = ::std::option::Option::Some(input);
86        self
87    }
88    /// <p>The identity provider type.</p>
89    pub fn set_identity_provider_type(mut self, input: ::std::option::Option<crate::types::IdentityProviderType>) -> Self {
90        self.identity_provider_type = input;
91        self
92    }
93    /// <p>The identity provider type.</p>
94    pub fn get_identity_provider_type(&self) -> &::std::option::Option<crate::types::IdentityProviderType> {
95        &self.identity_provider_type
96    }
97    /// Consumes the builder and constructs a [`IdentityProviderSummary`](crate::types::IdentityProviderSummary).
98    /// This method will fail if any of the following fields are not set:
99    /// - [`identity_provider_arn`](crate::types::builders::IdentityProviderSummaryBuilder::identity_provider_arn)
100    pub fn build(self) -> ::std::result::Result<crate::types::IdentityProviderSummary, ::aws_smithy_types::error::operation::BuildError> {
101        ::std::result::Result::Ok(crate::types::IdentityProviderSummary {
102            identity_provider_arn: self.identity_provider_arn.ok_or_else(|| {
103                ::aws_smithy_types::error::operation::BuildError::missing_field(
104                    "identity_provider_arn",
105                    "identity_provider_arn was not specified but it is required when building IdentityProviderSummary",
106                )
107            })?,
108            identity_provider_name: self.identity_provider_name,
109            identity_provider_type: self.identity_provider_type,
110        })
111    }
112}
113impl ::std::fmt::Debug for IdentityProviderSummaryBuilder {
114    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
115        let mut formatter = f.debug_struct("IdentityProviderSummaryBuilder");
116        formatter.field("identity_provider_arn", &self.identity_provider_arn);
117        formatter.field("identity_provider_name", &"*** Sensitive Data Redacted ***");
118        formatter.field("identity_provider_type", &self.identity_provider_type);
119        formatter.finish()
120    }
121}