Skip to main content

oci_rust_sdk/core/models/
instance_credentials.rs

1use serde::{Deserialize, Serialize};
2
3#[allow(unused_imports)]
4use super::*;
5/// The credentials for a particular instance.
6#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct InstanceCredentials {
9    /// The password for the username.
10    pub password: String,
11
12    /// The username.
13    pub username: String,
14}
15
16/// Required fields for InstanceCredentials
17pub struct InstanceCredentialsRequired {
18    /// The password for the username.
19    pub password: String,
20
21    /// The username.
22    pub username: String,
23}
24
25impl InstanceCredentials {
26    /// Create a new InstanceCredentials with required fields
27    pub fn new(required: InstanceCredentialsRequired) -> Self {
28        Self {
29            password: required.password,
30
31            username: required.username,
32        }
33    }
34
35    /// Set password
36    pub fn set_password(mut self, value: String) -> Self {
37        self.password = value;
38        self
39    }
40
41    /// Set username
42    pub fn set_username(mut self, value: String) -> Self {
43        self.username = value;
44        self
45    }
46}