1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A structure for the ICE server connection data.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct IceServer {
    /// <p>An array of URIs, in the form specified in the <a href="https://tools.ietf.org/html/draft-petithuguenin-behave-turn-uris-03">I-D.petithuguenin-behave-turn-uris</a> spec. These URIs provide the different
    /// addresses and/or protocols that can be used to reach the TURN server.</p>
    pub uris: std::option::Option<std::vec::Vec<std::string::String>>,
    /// <p>A username to login to the ICE server.</p>
    pub username: std::option::Option<std::string::String>,
    /// <p>A password to login to the ICE server.</p>
    pub password: std::option::Option<std::string::String>,
    /// <p>The period of time, in seconds, during which the username and password are
    /// valid.</p>
    pub ttl: i32,
}
impl IceServer {
    /// <p>An array of URIs, in the form specified in the <a href="https://tools.ietf.org/html/draft-petithuguenin-behave-turn-uris-03">I-D.petithuguenin-behave-turn-uris</a> spec. These URIs provide the different
    /// addresses and/or protocols that can be used to reach the TURN server.</p>
    pub fn uris(&self) -> std::option::Option<&[std::string::String]> {
        self.uris.as_deref()
    }
    /// <p>A username to login to the ICE server.</p>
    pub fn username(&self) -> std::option::Option<&str> {
        self.username.as_deref()
    }
    /// <p>A password to login to the ICE server.</p>
    pub fn password(&self) -> std::option::Option<&str> {
        self.password.as_deref()
    }
    /// <p>The period of time, in seconds, during which the username and password are
    /// valid.</p>
    pub fn ttl(&self) -> i32 {
        self.ttl
    }
}
impl std::fmt::Debug for IceServer {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("IceServer");
        formatter.field("uris", &self.uris);
        formatter.field("username", &self.username);
        formatter.field("password", &self.password);
        formatter.field("ttl", &self.ttl);
        formatter.finish()
    }
}
/// See [`IceServer`](crate::model::IceServer)
pub mod ice_server {
    /// A builder for [`IceServer`](crate::model::IceServer)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) uris: std::option::Option<std::vec::Vec<std::string::String>>,
        pub(crate) username: std::option::Option<std::string::String>,
        pub(crate) password: std::option::Option<std::string::String>,
        pub(crate) ttl: std::option::Option<i32>,
    }
    impl Builder {
        /// Appends an item to `uris`.
        ///
        /// To override the contents of this collection use [`set_uris`](Self::set_uris).
        ///
        /// <p>An array of URIs, in the form specified in the <a href="https://tools.ietf.org/html/draft-petithuguenin-behave-turn-uris-03">I-D.petithuguenin-behave-turn-uris</a> spec. These URIs provide the different
        /// addresses and/or protocols that can be used to reach the TURN server.</p>
        pub fn uris(mut self, input: impl Into<std::string::String>) -> Self {
            let mut v = self.uris.unwrap_or_default();
            v.push(input.into());
            self.uris = Some(v);
            self
        }
        /// <p>An array of URIs, in the form specified in the <a href="https://tools.ietf.org/html/draft-petithuguenin-behave-turn-uris-03">I-D.petithuguenin-behave-turn-uris</a> spec. These URIs provide the different
        /// addresses and/or protocols that can be used to reach the TURN server.</p>
        pub fn set_uris(
            mut self,
            input: std::option::Option<std::vec::Vec<std::string::String>>,
        ) -> Self {
            self.uris = input;
            self
        }
        /// <p>A username to login to the ICE server.</p>
        pub fn username(mut self, input: impl Into<std::string::String>) -> Self {
            self.username = Some(input.into());
            self
        }
        /// <p>A username to login to the ICE server.</p>
        pub fn set_username(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.username = input;
            self
        }
        /// <p>A password to login to the ICE server.</p>
        pub fn password(mut self, input: impl Into<std::string::String>) -> Self {
            self.password = Some(input.into());
            self
        }
        /// <p>A password to login to the ICE server.</p>
        pub fn set_password(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.password = input;
            self
        }
        /// <p>The period of time, in seconds, during which the username and password are
        /// valid.</p>
        pub fn ttl(mut self, input: i32) -> Self {
            self.ttl = Some(input);
            self
        }
        /// <p>The period of time, in seconds, during which the username and password are
        /// valid.</p>
        pub fn set_ttl(mut self, input: std::option::Option<i32>) -> Self {
            self.ttl = input;
            self
        }
        /// Consumes the builder and constructs a [`IceServer`](crate::model::IceServer)
        pub fn build(self) -> crate::model::IceServer {
            crate::model::IceServer {
                uris: self.uris,
                username: self.username,
                password: self.password,
                ttl: self.ttl.unwrap_or_default(),
            }
        }
    }
}
impl IceServer {
    /// Creates a new builder-style object to manufacture [`IceServer`](crate::model::IceServer)
    pub fn builder() -> crate::model::ice_server::Builder {
        crate::model::ice_server::Builder::default()
    }
}

#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum Service {
    #[allow(missing_docs)] // documentation missing in model
    Turn,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
impl std::convert::From<&str> for Service {
    fn from(s: &str) -> Self {
        match s {
            "TURN" => Service::Turn,
            other => Service::Unknown(other.to_owned()),
        }
    }
}
impl std::str::FromStr for Service {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(Service::from(s))
    }
}
impl Service {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            Service::Turn => "TURN",
            Service::Unknown(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &["TURN"]
    }
}
impl AsRef<str> for Service {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}