use serde::{Deserialize, Serialize}; /*
                                      * Service Control API
                                      *
                                      * Provides admission control and telemetry reporting for services integrated with Service Infrastructure.
                                      *
                                      * The version of the OpenAPI document: v2
                                      *
                                      * Generated by: https://openapi-generator.tech
                                      */

use crate::google_rest_apis::servicecontrol_v2::models;

/// ServiceAccountDelegationInfo : Identity delegation history of an authenticated service account.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServiceAccountDelegationInfo {
    #[serde(
        rename = "firstPartyPrincipal",
        skip_serializing_if = "Option::is_none"
    )]
    pub first_party_principal: Option<Box<models::FirstPartyPrincipal>>,
    /// A string representing the principal_subject associated with the identity. For most identities, the format will be `principal://iam.googleapis.com/{identity pool name}/subject/{subject)` except for some GKE identities (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the legacy format `serviceAccount:{identity pool name}[{subject}]`
    #[serde(rename = "principalSubject", skip_serializing_if = "Option::is_none")]
    pub principal_subject: Option<String>,
    #[serde(
        rename = "thirdPartyPrincipal",
        skip_serializing_if = "Option::is_none"
    )]
    pub third_party_principal: Option<Box<models::ThirdPartyPrincipal>>,
}

impl ServiceAccountDelegationInfo {
    /// Identity delegation history of an authenticated service account.
    pub fn new() -> ServiceAccountDelegationInfo {
        ServiceAccountDelegationInfo {
            first_party_principal: None,
            principal_subject: None,
            third_party_principal: None,
        }
    }
}
