Skip to main content

nominal_api/conjure/objects/ingest/api/
user_and_password_authentication.rs

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