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

package com.azure.resourcemanager.loadtesting.models;

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

/**
 * All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key
 * Vault.
 */
@Fluent
public class EncryptionPropertiesIdentity {
    /*
     * Managed identity type to use for accessing encryption key Url
     */
    @JsonProperty(value = "type")
    private Type type;

    /*
     * user assigned identity to use for accessing key encryption key Url. Ex:
     * /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource
     * group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId
     */
    @JsonProperty(value = "resourceId")
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    private String resourceId;

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

    /**
     * Get the type property: Managed identity type to use for accessing encryption key Url.
     *
     * @return the type value.
     */
    public Type type() {
        return this.type;
    }

    /**
     * Set the type property: Managed identity type to use for accessing encryption key Url.
     *
     * @param type the type value to set.
     * @return the EncryptionPropertiesIdentity object itself.
     */
    public EncryptionPropertiesIdentity withType(Type type) {
        this.type = type;
        return this;
    }

    /**
     * Get the resourceId property: user assigned identity to use for accessing key encryption key Url. Ex:
     * /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/&lt;resource
     * group&gt;/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId.
     *
     * @return the resourceId value.
     */
    public String resourceId() {
        return this.resourceId;
    }

    /**
     * Set the resourceId property: user assigned identity to use for accessing key encryption key Url. Ex:
     * /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/&lt;resource
     * group&gt;/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId.
     *
     * @param resourceId the resourceId value to set.
     * @return the EncryptionPropertiesIdentity object itself.
     */
    public EncryptionPropertiesIdentity withResourceId(String resourceId) {
        this.resourceId = resourceId;
        return this;
    }

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