// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.policyinsights.models;

import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** The details of the policy triggered deployment that created or modified the tracked resource. */
@Immutable
public final class TrackedResourceModificationDetails {
    /*
     * The details of the policy that created or modified the tracked resource.
     */
    @JsonProperty(value = "policyDetails", access = JsonProperty.Access.WRITE_ONLY)
    private PolicyDetails policyDetails;

    /*
     * The ID of the deployment that created or modified the tracked resource.
     */
    @JsonProperty(value = "deploymentId", access = JsonProperty.Access.WRITE_ONLY)
    private String deploymentId;

    /*
     * Timestamp of the deployment that created or modified the tracked resource.
     */
    @JsonProperty(value = "deploymentTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime deploymentTime;

    /** Creates an instance of TrackedResourceModificationDetails class. */
    public TrackedResourceModificationDetails() {
    }

    /**
     * Get the policyDetails property: The details of the policy that created or modified the tracked resource.
     *
     * @return the policyDetails value.
     */
    public PolicyDetails policyDetails() {
        return this.policyDetails;
    }

    /**
     * Get the deploymentId property: The ID of the deployment that created or modified the tracked resource.
     *
     * @return the deploymentId value.
     */
    public String deploymentId() {
        return this.deploymentId;
    }

    /**
     * Get the deploymentTime property: Timestamp of the deployment that created or modified the tracked resource.
     *
     * @return the deploymentTime value.
     */
    public OffsetDateTime deploymentTime() {
        return this.deploymentTime;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (policyDetails() != null) {
            policyDetails().validate();
        }
    }
}
