Skip to main content

nominal_api/conjure/objects/scout/datasource/connection/api/
password_credentials.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct PasswordCredentials {
16    #[builder(into)]
17    #[serde(rename = "username")]
18    username: String,
19    #[serde(rename = "passwordSecretRid")]
20    password_secret_rid: super::SecretRid,
21}
22impl PasswordCredentials {
23    /// Constructs a new instance of the type.
24    #[inline]
25    pub fn new(
26        username: impl Into<String>,
27        password_secret_rid: super::SecretRid,
28    ) -> Self {
29        Self::builder()
30            .username(username)
31            .password_secret_rid(password_secret_rid)
32            .build()
33    }
34    #[inline]
35    pub fn username(&self) -> &str {
36        &*self.username
37    }
38    /// Secret Rid of password secret stored in Secrets Service.
39    #[inline]
40    pub fn password_secret_rid(&self) -> &super::SecretRid {
41        &self.password_secret_rid
42    }
43}