/* Code generated by Azure.Iot.Operations.ProtocolCompilerLib v0.10.0.0; DO NOT EDIT. */
#![allow(unused_imports)]

use std::collections::HashMap;

use chrono::{DateTime, Utc};
use derive_builder::Builder;
use iso8601_duration::Duration;
use serde::{Deserialize, Serialize};
use uuid::Uuid;

use super::super::common_types::{b64::Bytes, date_only::Date, decimal::Decimal, time_only::Time};
use super::method_schema::MethodSchema;
use super::username_password_credentials_schema::UsernamePasswordCredentialsSchema;
use super::x509credentials_schema::X509credentialsSchema;

#[derive(Serialize, Deserialize, Debug, Clone, Builder)]
pub struct AuthenticationSchema {
    /// Defines the method to authenticate the user of the client at the server.
    pub method: MethodSchema,

    /// The credentials for authentication mode UsernamePassword.
    #[serde(rename = "usernamePasswordCredentials")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub username_password_credentials: Option<UsernamePasswordCredentialsSchema>,

    /// The x509 certificate for authentication mode Certificate.
    #[serde(rename = "x509Credentials")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub x509credentials: Option<X509credentialsSchema>,
}
