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

package com.azure.resourcemanager.fluidrelay.models;

import com.azure.core.annotation.Fluent;
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 CustomerManagedKeyEncryptionPropertiesKeyEncryptionKeyIdentity {
    /*
     * Values can be SystemAssigned or UserAssigned
     */
    @JsonProperty(value = "identityType")
    private CmkIdentityType identityType;

    /*
     * 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. Mutually exclusive with identityType
     * systemAssignedIdentity.
     */
    @JsonProperty(value = "userAssignedIdentityResourceId")
    private String userAssignedIdentityResourceId;

    /**
     * Get the identityType property: Values can be SystemAssigned or UserAssigned.
     *
     * @return the identityType value.
     */
    public CmkIdentityType identityType() {
        return this.identityType;
    }

    /**
     * Set the identityType property: Values can be SystemAssigned or UserAssigned.
     *
     * @param identityType the identityType value to set.
     * @return the CustomerManagedKeyEncryptionPropertiesKeyEncryptionKeyIdentity object itself.
     */
    public CustomerManagedKeyEncryptionPropertiesKeyEncryptionKeyIdentity withIdentityType(
        CmkIdentityType identityType) {
        this.identityType = identityType;
        return this;
    }

    /**
     * Get the userAssignedIdentityResourceId 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. Mutually exclusive with identityType
     * systemAssignedIdentity.
     *
     * @return the userAssignedIdentityResourceId value.
     */
    public String userAssignedIdentityResourceId() {
        return this.userAssignedIdentityResourceId;
    }

    /**
     * Set the userAssignedIdentityResourceId 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. Mutually exclusive with identityType
     * systemAssignedIdentity.
     *
     * @param userAssignedIdentityResourceId the userAssignedIdentityResourceId value to set.
     * @return the CustomerManagedKeyEncryptionPropertiesKeyEncryptionKeyIdentity object itself.
     */
    public CustomerManagedKeyEncryptionPropertiesKeyEncryptionKeyIdentity withUserAssignedIdentityResourceId(
        String userAssignedIdentityResourceId) {
        this.userAssignedIdentityResourceId = userAssignedIdentityResourceId;
        return this;
    }

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