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;

/// ServiceDelegationHistory : The history of delegation across multiple services as the result of the original user's action. Such as \"service A uses its own account to do something for user B\". This differs from ServiceAccountDelegationInfo, which only tracks the history of direct token exchanges (impersonation).
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ServiceDelegationHistory {
    /// The original end user who initiated the request to GCP.
    #[serde(rename = "originalPrincipal", skip_serializing_if = "Option::is_none")]
    pub original_principal: Option<String>,
    /// Data identifying the service specific jobs or units of work that were involved in a chain of service calls.
    #[serde(rename = "serviceMetadata", skip_serializing_if = "Option::is_none")]
    pub service_metadata: Option<Vec<models::ServiceMetadata>>,
}

impl ServiceDelegationHistory {
    /// The history of delegation across multiple services as the result of the original user's action. Such as \"service A uses its own account to do something for user B\". This differs from ServiceAccountDelegationInfo, which only tracks the history of direct token exchanges (impersonation).
    pub fn new() -> ServiceDelegationHistory {
        ServiceDelegationHistory {
            original_principal: None,
            service_metadata: None,
        }
    }
}
