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

package com.azure.resourcemanager.networkcloud.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.networkcloud.fluent.models.BmcKeySetPatchProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;

/** BmcKeySetPatchParameters represents the body of the request to patch the baseboard management controller key set. */
@Fluent
public final class BmcKeySetPatchParameters {
    /*
     * BmcKeySetPatchProperties represents the properties of baseboard management controller key set that are
     * patchable.
     *
     * The list of the resource properties.
     */
    @JsonProperty(value = "properties")
    private BmcKeySetPatchProperties innerProperties;

    /*
     * The Azure resource tags that will replace the existing ones.
     */
    @JsonProperty(value = "tags")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

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

    /**
     * Get the innerProperties property: BmcKeySetPatchProperties represents the properties of baseboard management
     * controller key set that are patchable.
     *
     * <p>The list of the resource properties.
     *
     * @return the innerProperties value.
     */
    private BmcKeySetPatchProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the tags property: The Azure resource tags that will replace the existing ones.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: The Azure resource tags that will replace the existing ones.
     *
     * @param tags the tags value to set.
     * @return the BmcKeySetPatchParameters object itself.
     */
    public BmcKeySetPatchParameters withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the expiration property: The date and time after which the users in this key set will be removed from the
     * baseboard management controllers.
     *
     * @return the expiration value.
     */
    public OffsetDateTime expiration() {
        return this.innerProperties() == null ? null : this.innerProperties().expiration();
    }

    /**
     * Set the expiration property: The date and time after which the users in this key set will be removed from the
     * baseboard management controllers.
     *
     * @param expiration the expiration value to set.
     * @return the BmcKeySetPatchParameters object itself.
     */
    public BmcKeySetPatchParameters withExpiration(OffsetDateTime expiration) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BmcKeySetPatchProperties();
        }
        this.innerProperties().withExpiration(expiration);
        return this;
    }

    /**
     * Get the userList property: The unique list of permitted users.
     *
     * @return the userList value.
     */
    public List<KeySetUser> userList() {
        return this.innerProperties() == null ? null : this.innerProperties().userList();
    }

    /**
     * Set the userList property: The unique list of permitted users.
     *
     * @param userList the userList value to set.
     * @return the BmcKeySetPatchParameters object itself.
     */
    public BmcKeySetPatchParameters withUserList(List<KeySetUser> userList) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BmcKeySetPatchProperties();
        }
        this.innerProperties().withUserList(userList);
        return this;
    }

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