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

package com.azure.resourcemanager.apimanagement.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.apimanagement.fluent.models.UserIdentityContractInner;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** User Entity Base Parameters set. */
@Fluent
public class UserEntityBaseParameters {
    /*
     * Account state. Specifies whether the user is active or not. Blocked
     * users are unable to sign into the developer portal or call any APIs of
     * subscribed products. Default state is Active.
     */
    @JsonProperty(value = "state")
    private UserState state;

    /*
     * Optional note about a user set by the administrator.
     */
    @JsonProperty(value = "note")
    private String note;

    /*
     * Collection of user identities.
     */
    @JsonProperty(value = "identities")
    private List<UserIdentityContractInner> identities;

    /**
     * Get the state property: Account state. Specifies whether the user is active or not. Blocked users are unable to
     * sign into the developer portal or call any APIs of subscribed products. Default state is Active.
     *
     * @return the state value.
     */
    public UserState state() {
        return this.state;
    }

    /**
     * Set the state property: Account state. Specifies whether the user is active or not. Blocked users are unable to
     * sign into the developer portal or call any APIs of subscribed products. Default state is Active.
     *
     * @param state the state value to set.
     * @return the UserEntityBaseParameters object itself.
     */
    public UserEntityBaseParameters withState(UserState state) {
        this.state = state;
        return this;
    }

    /**
     * Get the note property: Optional note about a user set by the administrator.
     *
     * @return the note value.
     */
    public String note() {
        return this.note;
    }

    /**
     * Set the note property: Optional note about a user set by the administrator.
     *
     * @param note the note value to set.
     * @return the UserEntityBaseParameters object itself.
     */
    public UserEntityBaseParameters withNote(String note) {
        this.note = note;
        return this;
    }

    /**
     * Get the identities property: Collection of user identities.
     *
     * @return the identities value.
     */
    public List<UserIdentityContractInner> identities() {
        return this.identities;
    }

    /**
     * Set the identities property: Collection of user identities.
     *
     * @param identities the identities value to set.
     * @return the UserEntityBaseParameters object itself.
     */
    public UserEntityBaseParameters withIdentities(List<UserIdentityContractInner> identities) {
        this.identities = identities;
        return this;
    }

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