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

package com.azure.resourcemanager.quantum.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.quantum.models.Provider;
import com.azure.resourcemanager.quantum.models.ProvisioningStatus;
import com.azure.resourcemanager.quantum.models.UsableStatus;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Properties of a Workspace. */
@Fluent
public final class WorkspaceResourceProperties {
    /*
     * List of Providers selected for this Workspace
     */
    @JsonProperty(value = "providers")
    private List<Provider> providers;

    /*
     * Whether the current workspace is ready to accept Jobs.
     */
    @JsonProperty(value = "usable", access = JsonProperty.Access.WRITE_ONLY)
    private UsableStatus usable;

    /*
     * Provisioning status field
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningStatus provisioningState;

    /*
     * ARM Resource Id of the storage account associated with this workspace.
     */
    @JsonProperty(value = "storageAccount")
    private String storageAccount;

    /*
     * The URI of the workspace endpoint.
     */
    @JsonProperty(value = "endpointUri", access = JsonProperty.Access.WRITE_ONLY)
    private String endpointUri;

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

    /**
     * Get the providers property: List of Providers selected for this Workspace.
     *
     * @return the providers value.
     */
    public List<Provider> providers() {
        return this.providers;
    }

    /**
     * Set the providers property: List of Providers selected for this Workspace.
     *
     * @param providers the providers value to set.
     * @return the WorkspaceResourceProperties object itself.
     */
    public WorkspaceResourceProperties withProviders(List<Provider> providers) {
        this.providers = providers;
        return this;
    }

    /**
     * Get the usable property: Whether the current workspace is ready to accept Jobs.
     *
     * @return the usable value.
     */
    public UsableStatus usable() {
        return this.usable;
    }

    /**
     * Get the provisioningState property: Provisioning status field.
     *
     * @return the provisioningState value.
     */
    public ProvisioningStatus provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the storageAccount property: ARM Resource Id of the storage account associated with this workspace.
     *
     * @return the storageAccount value.
     */
    public String storageAccount() {
        return this.storageAccount;
    }

    /**
     * Set the storageAccount property: ARM Resource Id of the storage account associated with this workspace.
     *
     * @param storageAccount the storageAccount value to set.
     * @return the WorkspaceResourceProperties object itself.
     */
    public WorkspaceResourceProperties withStorageAccount(String storageAccount) {
        this.storageAccount = storageAccount;
        return this;
    }

    /**
     * Get the endpointUri property: The URI of the workspace endpoint.
     *
     * @return the endpointUri value.
     */
    public String endpointUri() {
        return this.endpointUri;
    }

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