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

package com.azure.resourcemanager.dataprotection.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The DppTrackedResource model. */
@Fluent
public class DppTrackedResource extends DppBaseTrackedResource {
    /*
     * DppIdentityDetails
     *
     * Input Managed Identity Details
     */
    @JsonProperty(value = "identity")
    private DppIdentityDetails identity;

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

    /**
     * Get the identity property: DppIdentityDetails
     *
     * <p>Input Managed Identity Details.
     *
     * @return the identity value.
     */
    public DppIdentityDetails identity() {
        return this.identity;
    }

    /**
     * Set the identity property: DppIdentityDetails
     *
     * <p>Input Managed Identity Details.
     *
     * @param identity the identity value to set.
     * @return the DppTrackedResource object itself.
     */
    public DppTrackedResource withIdentity(DppIdentityDetails identity) {
        this.identity = identity;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public DppTrackedResource withEtag(String etag) {
        super.withEtag(etag);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public DppTrackedResource withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public DppTrackedResource withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

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