/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import { networkingCreateNetwork } from "../funcs/networkingCreateNetwork.js";
import { networkingDeleteNetwork } from "../funcs/networkingDeleteNetwork.js";
import { networkingListNetworks } from "../funcs/networkingListNetworks.js";
import { networkingReadNetwork } from "../funcs/networkingReadNetwork.js";
import { networkingUpdateNetwork } from "../funcs/networkingUpdateNetwork.js";
import { networkingUpdateStaticIps } from "../funcs/networkingUpdateStaticIps.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import { CreateNetworkRequest } from "../models/createnetworkop.js";
import { DeleteNetworkRequest } from "../models/deletenetworkop.js";
import { ListNetworksRequest } from "../models/listnetworksop.js";
import { Network } from "../models/network.js";
import { ReadNetworkRequest } from "../models/readnetworkop.js";
import { UpdateNetworkRequest } from "../models/updatenetworkop.js";
import {
  UpdateStaticIpsRequest,
  UpdateStaticIpsResponseBody,
} from "../models/updatestaticipsop.js";
import { unwrapAsync } from "../types/fp.js";

export class Networking extends ClientSDK {
  /**
   * List Secure Compute networks
   *
   * @remarks
   * Allows to list Secure Compute networks.
   */
  async listNetworks(
    request: ListNetworksRequest,
    options?: RequestOptions,
  ): Promise<Array<Network>> {
    return unwrapAsync(networkingListNetworks(
      this,
      request,
      options,
    ));
  }

  /**
   * Create a Secure Compute network
   *
   * @remarks
   * Allows to create a Secure Compute network.
   */
  async createNetwork(
    request: CreateNetworkRequest,
    options?: RequestOptions,
  ): Promise<Network> {
    return unwrapAsync(networkingCreateNetwork(
      this,
      request,
      options,
    ));
  }

  /**
   * Delete a Secure Compute network
   *
   * @remarks
   * Allows to delete a Secure Compute network.
   */
  async deleteNetwork(
    request: DeleteNetworkRequest,
    options?: RequestOptions,
  ): Promise<void> {
    return unwrapAsync(networkingDeleteNetwork(
      this,
      request,
      options,
    ));
  }

  /**
   * Update a Secure Compute network
   *
   * @remarks
   * Allows to update a Secure Compute network.
   */
  async updateNetwork(
    request: UpdateNetworkRequest,
    options?: RequestOptions,
  ): Promise<Network> {
    return unwrapAsync(networkingUpdateNetwork(
      this,
      request,
      options,
    ));
  }

  /**
   * Read a Secure Compute network
   *
   * @remarks
   * Allows to read a Secure Compute network.
   */
  async readNetwork(
    request: ReadNetworkRequest,
    options?: RequestOptions,
  ): Promise<Network> {
    return unwrapAsync(networkingReadNetwork(
      this,
      request,
      options,
    ));
  }

  /**
   * Configures Static IPs for a project
   *
   * @remarks
   * Allows configuring Static IPs for a project
   */
  async updateStaticIps(
    request: UpdateStaticIpsRequest,
    options?: RequestOptions,
  ): Promise<Array<UpdateStaticIpsResponseBody>> {
    return unwrapAsync(networkingUpdateStaticIps(
      this,
      request,
      options,
    ));
  }
}
