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

package tsptest.armresourceprovider.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * The CustomTemplateResourcePatch model.
 */
@Fluent
public final class CustomTemplateResourcePatch {
    /*
     * Managed identity.
     */
    @JsonProperty(value = "identity")
    private ManagedServiceIdentity identity;

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

    /**
     * Get the identity property: Managed identity.
     * 
     * @return the identity value.
     */
    public ManagedServiceIdentity identity() {
        return this.identity;
    }

    /**
     * Set the identity property: Managed identity.
     * 
     * @param identity the identity value to set.
     * @return the CustomTemplateResourcePatch object itself.
     */
    public CustomTemplateResourcePatch withIdentity(ManagedServiceIdentity identity) {
        this.identity = identity;
        return this;
    }

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