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

package com.azure.resourcemanager.databox.models;

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

/** Managed identity properties. */
@Fluent
public final class IdentityProperties {
    /*
     * Managed service identity type.
     */
    @JsonProperty(value = "type")
    private String type;

    /*
     * User assigned identity properties.
     */
    @JsonProperty(value = "userAssigned")
    private UserAssignedProperties userAssigned;

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

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

    /**
     * Set the type property: Managed service identity type.
     *
     * @param type the type value to set.
     * @return the IdentityProperties object itself.
     */
    public IdentityProperties withType(String type) {
        this.type = type;
        return this;
    }

    /**
     * Get the userAssigned property: User assigned identity properties.
     *
     * @return the userAssigned value.
     */
    public UserAssignedProperties userAssigned() {
        return this.userAssigned;
    }

    /**
     * Set the userAssigned property: User assigned identity properties.
     *
     * @param userAssigned the userAssigned value to set.
     * @return the IdentityProperties object itself.
     */
    public IdentityProperties withUserAssigned(UserAssignedProperties userAssigned) {
        this.userAssigned = userAssigned;
        return this;
    }

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