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

package com.azure.resourcemanager.digitaltwins.models;

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

/** The properties of the Managed Identity. */
@Fluent
public final class ManagedIdentityReference {
    /*
     * The type of managed identity used.
     */
    @JsonProperty(value = "type")
    private IdentityType type;

    /*
     * The user identity ARM resource id if the managed identity type is 'UserAssigned'.
     */
    @JsonProperty(value = "userAssignedIdentity")
    private String userAssignedIdentity;

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

    /**
     * Get the type property: The type of managed identity used.
     *
     * @return the type value.
     */
    public IdentityType type() {
        return this.type;
    }

    /**
     * Set the type property: The type of managed identity used.
     *
     * @param type the type value to set.
     * @return the ManagedIdentityReference object itself.
     */
    public ManagedIdentityReference withType(IdentityType type) {
        this.type = type;
        return this;
    }

    /**
     * Get the userAssignedIdentity property: The user identity ARM resource id if the managed identity type is
     * 'UserAssigned'.
     *
     * @return the userAssignedIdentity value.
     */
    public String userAssignedIdentity() {
        return this.userAssignedIdentity;
    }

    /**
     * Set the userAssignedIdentity property: The user identity ARM resource id if the managed identity type is
     * 'UserAssigned'.
     *
     * @param userAssignedIdentity the userAssignedIdentity value to set.
     * @return the ManagedIdentityReference object itself.
     */
    public ManagedIdentityReference withUserAssignedIdentity(String userAssignedIdentity) {
        this.userAssignedIdentity = userAssignedIdentity;
        return this;
    }

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