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

package com.azure.resourcemanager.deploymentmanager.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Identity for the resource. */
@Fluent
public class Identity {
    /*
     * The identity type.
     */
    @JsonProperty(value = "type", required = true)
    private String type;

    /*
     * The list of identities.
     */
    @JsonProperty(value = "identityIds", required = true)
    private List<String> identityIds;

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

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

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

    /**
     * Get the identityIds property: The list of identities.
     *
     * @return the identityIds value.
     */
    public List<String> identityIds() {
        return this.identityIds;
    }

    /**
     * Set the identityIds property: The list of identities.
     *
     * @param identityIds the identityIds value to set.
     * @return the Identity object itself.
     */
    public Identity withIdentityIds(List<String> identityIds) {
        this.identityIds = identityIds;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (type() == null) {
            throw LOGGER
                .logExceptionAsError(new IllegalArgumentException("Missing required property type in model Identity"));
        }
        if (identityIds() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property identityIds in model Identity"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(Identity.class);
}
