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

package com.azure.resourcemanager.batchai.models;

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

/** Workspace creation parameters. */
@Fluent
public final class WorkspaceCreateParameters {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceCreateParameters.class);

    /*
     * The region in which to create the Workspace.
     */
    @JsonProperty(value = "location", required = true)
    private String location;

    /*
     * The user specified tags associated with the Workspace.
     */
    @JsonProperty(value = "tags")
    private Map<String, String> tags;

    /**
     * Get the location property: The region in which to create the Workspace.
     *
     * @return the location value.
     */
    public String location() {
        return this.location;
    }

    /**
     * Set the location property: The region in which to create the Workspace.
     *
     * @param location the location value to set.
     * @return the WorkspaceCreateParameters object itself.
     */
    public WorkspaceCreateParameters withLocation(String location) {
        this.location = location;
        return this;
    }

    /**
     * Get the tags property: The user specified tags associated with the Workspace.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: The user specified tags associated with the Workspace.
     *
     * @param tags the tags value to set.
     * @return the WorkspaceCreateParameters object itself.
     */
    public WorkspaceCreateParameters withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

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