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

import { microfrontendsCreateMicrofrontendsGroupWithApplications } from "../funcs/microfrontendsCreateMicrofrontendsGroupWithApplications.js";
import { microfrontendsGetMicrofrontendsConfig } from "../funcs/microfrontendsGetMicrofrontendsConfig.js";
import { microfrontendsGetMicrofrontendsConfigForProject } from "../funcs/microfrontendsGetMicrofrontendsConfigForProject.js";
import { microfrontendsGetMicrofrontendsGroups } from "../funcs/microfrontendsGetMicrofrontendsGroups.js";
import { microfrontendsGetMicrofrontendsInGroup } from "../funcs/microfrontendsGetMicrofrontendsInGroup.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import {
  CreateMicrofrontendsGroupWithApplicationsRequest,
  CreateMicrofrontendsGroupWithApplicationsResponseBody,
} from "../models/createmicrofrontendsgroupwithapplicationsop.js";
import {
  GetMicrofrontendsConfigForProjectRequest,
  GetMicrofrontendsConfigForProjectResponseBody,
} from "../models/getmicrofrontendsconfigforprojectop.js";
import {
  GetMicrofrontendsConfigRequest,
  GetMicrofrontendsConfigResponseBody,
} from "../models/getmicrofrontendsconfigop.js";
import {
  GetMicrofrontendsGroupsRequest,
  GetMicrofrontendsGroupsResponseBody,
} from "../models/getmicrofrontendsgroupsop.js";
import { GetMicrofrontendsInGroupResponseBody } from "../models/getmicrofrontendsingroupresponsebody.js";
import { GetMicrofrontendsInGroupRequest } from "../models/getmicrofrontendsingrouptomicrofrontends2.js";
import { unwrapAsync } from "../types/fp.js";

export class Microfrontends extends ClientSDK {
  /**
   * List microfrontends groups
   *
   * @remarks
   * Get the microfrontends group IDs for a team.
   */
  async getMicrofrontendsGroups(
    request: GetMicrofrontendsGroupsRequest,
    options?: RequestOptions,
  ): Promise<GetMicrofrontendsGroupsResponseBody> {
    return unwrapAsync(microfrontendsGetMicrofrontendsGroups(
      this,
      request,
      options,
    ));
  }

  /**
   * List projects in a microfrontends group
   *
   * @remarks
   * Get the microfrontends for a given group ID.
   */
  async getMicrofrontendsInGroup(
    request: GetMicrofrontendsInGroupRequest,
    options?: RequestOptions,
  ): Promise<GetMicrofrontendsInGroupResponseBody> {
    return unwrapAsync(microfrontendsGetMicrofrontendsInGroup(
      this,
      request,
      options,
    ));
  }

  /**
   * Get microfrontends config for a deployment
   *
   * @remarks
   * Get the microfrontends config for a deployment.
   */
  async getMicrofrontendsConfig(
    request: GetMicrofrontendsConfigRequest,
    options?: RequestOptions,
  ): Promise<GetMicrofrontendsConfigResponseBody> {
    return unwrapAsync(microfrontendsGetMicrofrontendsConfig(
      this,
      request,
      options,
    ));
  }

  /**
   * Get microfrontends config for a project
   *
   * @remarks
   * Get the microfrontends config for a project by ID or name.
   */
  async getMicrofrontendsConfigForProject(
    request: GetMicrofrontendsConfigForProjectRequest,
    options?: RequestOptions,
  ): Promise<GetMicrofrontendsConfigForProjectResponseBody> {
    return unwrapAsync(microfrontendsGetMicrofrontendsConfigForProject(
      this,
      request,
      options,
    ));
  }

  /**
   * Create a microfrontends group with applications
   *
   * @remarks
   * Creates a microfrontends group and attaches multiple projects in a single request.
   */
  async createMicrofrontendsGroupWithApplications(
    request: CreateMicrofrontendsGroupWithApplicationsRequest,
    options?: RequestOptions,
  ): Promise<CreateMicrofrontendsGroupWithApplicationsResponseBody> {
    return unwrapAsync(microfrontendsCreateMicrofrontendsGroupWithApplications(
      this,
      request,
      options,
    ));
  }
}
