use serde::{Deserialize, Serialize}; /*
                                      * Cloud Resource Manager API
                                      *
                                      * Creates, reads, and updates metadata for Google Cloud Platform resource containers.
                                      *
                                      * The version of the OpenAPI document: v3
                                      *
                                      * Generated by: https://openapi-generator.tech
                                      */

use crate::google_rest_apis::cloudresourcemanager_v3::models;

/// EffectiveTag : An EffectiveTag represents a tag that applies to a resource during policy evaluation. Tags can be either directly bound to a resource or inherited from its ancestor. EffectiveTag contains the name and namespaced_name of the tag value and tag key, with additional fields of `inherited` to indicate the inheritance status of the effective tag.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EffectiveTag {
    /// Indicates the inheritance status of a tag value attached to the given resource. If the tag value is inherited from one of the resource's ancestors, inherited will be true. If false, then the tag value is directly attached to the resource, inherited will be false.
    #[serde(rename = "inherited", skip_serializing_if = "Option::is_none")]
    pub inherited: Option<bool>,
    /// The namespaced name of the TagKey. Can be in the form `{organization_id}/{tag_key_short_name}` or `{project_id}/{tag_key_short_name}` or `{project_number}/{tag_key_short_name}`.
    #[serde(rename = "namespacedTagKey", skip_serializing_if = "Option::is_none")]
    pub namespaced_tag_key: Option<String>,
    /// The namespaced name of the TagValue. Can be in the form `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or `{project_number}/{tag_key_short_name}/{tag_value_short_name}`.
    #[serde(rename = "namespacedTagValue", skip_serializing_if = "Option::is_none")]
    pub namespaced_tag_value: Option<String>,
    /// The name of the TagKey, in the format `tagKeys/{id}`, such as `tagKeys/123`.
    #[serde(rename = "tagKey", skip_serializing_if = "Option::is_none")]
    pub tag_key: Option<String>,
    /// The parent name of the tag key. Must be in the format `organizations/{organization_id}` or `projects/{project_number}`
    #[serde(rename = "tagKeyParentName", skip_serializing_if = "Option::is_none")]
    pub tag_key_parent_name: Option<String>,
    /// Resource name for TagValue in the format `tagValues/456`.
    #[serde(rename = "tagValue", skip_serializing_if = "Option::is_none")]
    pub tag_value: Option<String>,
}

impl EffectiveTag {
    /// An EffectiveTag represents a tag that applies to a resource during policy evaluation. Tags can be either directly bound to a resource or inherited from its ancestor. EffectiveTag contains the name and namespaced_name of the tag value and tag key, with additional fields of `inherited` to indicate the inheritance status of the effective tag.
    pub fn new() -> EffectiveTag {
        EffectiveTag {
            inherited: None,
            namespaced_tag_key: None,
            namespaced_tag_value: None,
            tag_key: None,
            tag_key_parent_name: None,
            tag_value: None,
        }
    }
}
