/* tslint:disable */
/* eslint-disable */
/**
 * Signal Cli REST API
 * This is the Signal Cli REST API documentation.
 *
 * The version of the OpenAPI document: 1.0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import * as runtime from "../runtime.js";
import type {
  ApiChangeGroupAdminsRequest,
  ApiChangeGroupMembersRequest,
  ApiCreateGroupRequest,
  ApiCreateGroupResponse,
  ApiError,
  ApiUpdateGroupRequest,
  ClientGroupEntry,
} from "../models/index.js";
import {
  ApiChangeGroupAdminsRequestFromJSON,
  ApiChangeGroupAdminsRequestToJSON,
  ApiChangeGroupMembersRequestFromJSON,
  ApiChangeGroupMembersRequestToJSON,
  ApiCreateGroupRequestFromJSON,
  ApiCreateGroupRequestToJSON,
  ApiCreateGroupResponseFromJSON,
  ApiCreateGroupResponseToJSON,
  ApiErrorFromJSON,
  ApiErrorToJSON,
  ApiUpdateGroupRequestFromJSON,
  ApiUpdateGroupRequestToJSON,
  ClientGroupEntryFromJSON,
  ClientGroupEntryToJSON,
} from "../models/index.js";

export interface V1GroupsNumberGetRequest {
  number: string;
}

export interface V1GroupsNumberGroupidAdminsDeleteRequest {
  number: string;
  data: ApiChangeGroupAdminsRequest;
}

export interface V1GroupsNumberGroupidAdminsPostRequest {
  number: string;
  data: ApiChangeGroupAdminsRequest;
}

export interface V1GroupsNumberGroupidBlockPostRequest {
  number: string;
  groupid: string;
}

export interface V1GroupsNumberGroupidDeleteRequest {
  number: string;
  groupid: string;
}

export interface V1GroupsNumberGroupidGetRequest {
  number: string;
  groupid: string;
}

export interface V1GroupsNumberGroupidJoinPostRequest {
  number: string;
  groupid: string;
}

export interface V1GroupsNumberGroupidMembersDeleteRequest {
  number: string;
  data: ApiChangeGroupMembersRequest;
}

export interface V1GroupsNumberGroupidMembersPostRequest {
  number: string;
  data: ApiChangeGroupMembersRequest;
}

export interface V1GroupsNumberGroupidPutRequest {
  number: string;
  groupid: string;
  data: ApiUpdateGroupRequest;
}

export interface V1GroupsNumberGroupidQuitPostRequest {
  number: string;
  groupid: string;
}

export interface V1GroupsNumberPostRequest {
  number: string;
  data: ApiCreateGroupRequest;
}

/**
 *
 */
export class GroupsApi extends runtime.BaseAPI {
  /**
   * List all Signal Groups.
   * List all Signal Groups.
   */
  async v1GroupsNumberGetRaw(
    requestParameters: V1GroupsNumberGetRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<runtime.ApiResponse<Array<ClientGroupEntry>>> {
    if (requestParameters["number"] == null) {
      throw new runtime.RequiredError(
        "number",
        'Required parameter "number" was null or undefined when calling v1GroupsNumberGet().',
      );
    }

    const queryParameters: any = {};

    const headerParameters: runtime.HTTPHeaders = {};

    const response = await this.request(
      {
        path: `/v1/groups/{number}`.replace(
          `{${"number"}}`,
          encodeURIComponent(String(requestParameters["number"])),
        ),
        method: "GET",
        headers: headerParameters,
        query: queryParameters,
      },
      initOverrides,
    );

    return new runtime.JSONApiResponse(response, (jsonValue) =>
      jsonValue.map(ClientGroupEntryFromJSON),
    );
  }

  /**
   * List all Signal Groups.
   * List all Signal Groups.
   */
  async v1GroupsNumberGet(
    requestParameters: V1GroupsNumberGetRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<Array<ClientGroupEntry>> {
    const response = await this.v1GroupsNumberGetRaw(
      requestParameters,
      initOverrides,
    );
    return await response.value();
  }

  /**
   * Remove one or more admins from an existing Signal Group.
   * Remove one or more admins from an existing Signal Group.
   */
  async v1GroupsNumberGroupidAdminsDeleteRaw(
    requestParameters: V1GroupsNumberGroupidAdminsDeleteRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<runtime.ApiResponse<string>> {
    if (requestParameters["number"] == null) {
      throw new runtime.RequiredError(
        "number",
        'Required parameter "number" was null or undefined when calling v1GroupsNumberGroupidAdminsDelete().',
      );
    }

    if (requestParameters["data"] == null) {
      throw new runtime.RequiredError(
        "data",
        'Required parameter "data" was null or undefined when calling v1GroupsNumberGroupidAdminsDelete().',
      );
    }

    const queryParameters: any = {};

    const headerParameters: runtime.HTTPHeaders = {};

    headerParameters["Content-Type"] = "application/json";

    const response = await this.request(
      {
        path: `/v1/groups/{number}/{groupid}/admins`.replace(
          `{${"number"}}`,
          encodeURIComponent(String(requestParameters["number"])),
        ),
        method: "DELETE",
        headers: headerParameters,
        query: queryParameters,
        body: ApiChangeGroupAdminsRequestToJSON(requestParameters["data"]),
      },
      initOverrides,
    );

    if (this.isJsonMime(response.headers.get("content-type"))) {
      return new runtime.JSONApiResponse<string>(response);
    } else {
      return new runtime.TextApiResponse(response) as any;
    }
  }

  /**
   * Remove one or more admins from an existing Signal Group.
   * Remove one or more admins from an existing Signal Group.
   */
  async v1GroupsNumberGroupidAdminsDelete(
    requestParameters: V1GroupsNumberGroupidAdminsDeleteRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<string> {
    const response = await this.v1GroupsNumberGroupidAdminsDeleteRaw(
      requestParameters,
      initOverrides,
    );
    return await response.value();
  }

  /**
   * Add one or more admins to an existing Signal Group.
   * Add one or more admins to an existing Signal Group.
   */
  async v1GroupsNumberGroupidAdminsPostRaw(
    requestParameters: V1GroupsNumberGroupidAdminsPostRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<runtime.ApiResponse<string>> {
    if (requestParameters["number"] == null) {
      throw new runtime.RequiredError(
        "number",
        'Required parameter "number" was null or undefined when calling v1GroupsNumberGroupidAdminsPost().',
      );
    }

    if (requestParameters["data"] == null) {
      throw new runtime.RequiredError(
        "data",
        'Required parameter "data" was null or undefined when calling v1GroupsNumberGroupidAdminsPost().',
      );
    }

    const queryParameters: any = {};

    const headerParameters: runtime.HTTPHeaders = {};

    headerParameters["Content-Type"] = "application/json";

    const response = await this.request(
      {
        path: `/v1/groups/{number}/{groupid}/admins`.replace(
          `{${"number"}}`,
          encodeURIComponent(String(requestParameters["number"])),
        ),
        method: "POST",
        headers: headerParameters,
        query: queryParameters,
        body: ApiChangeGroupAdminsRequestToJSON(requestParameters["data"]),
      },
      initOverrides,
    );

    if (this.isJsonMime(response.headers.get("content-type"))) {
      return new runtime.JSONApiResponse<string>(response);
    } else {
      return new runtime.TextApiResponse(response) as any;
    }
  }

  /**
   * Add one or more admins to an existing Signal Group.
   * Add one or more admins to an existing Signal Group.
   */
  async v1GroupsNumberGroupidAdminsPost(
    requestParameters: V1GroupsNumberGroupidAdminsPostRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<string> {
    const response = await this.v1GroupsNumberGroupidAdminsPostRaw(
      requestParameters,
      initOverrides,
    );
    return await response.value();
  }

  /**
   * Block the specified Signal Group.
   * Block a Signal Group.
   */
  async v1GroupsNumberGroupidBlockPostRaw(
    requestParameters: V1GroupsNumberGroupidBlockPostRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<runtime.ApiResponse<string>> {
    if (requestParameters["number"] == null) {
      throw new runtime.RequiredError(
        "number",
        'Required parameter "number" was null or undefined when calling v1GroupsNumberGroupidBlockPost().',
      );
    }

    if (requestParameters["groupid"] == null) {
      throw new runtime.RequiredError(
        "groupid",
        'Required parameter "groupid" was null or undefined when calling v1GroupsNumberGroupidBlockPost().',
      );
    }

    const queryParameters: any = {};

    const headerParameters: runtime.HTTPHeaders = {};

    const response = await this.request(
      {
        path: `/v1/groups/{number}/{groupid}/block`
          .replace(
            `{${"number"}}`,
            encodeURIComponent(String(requestParameters["number"])),
          )
          .replace(
            `{${"groupid"}}`,
            encodeURIComponent(String(requestParameters["groupid"])),
          ),
        method: "POST",
        headers: headerParameters,
        query: queryParameters,
      },
      initOverrides,
    );

    if (this.isJsonMime(response.headers.get("content-type"))) {
      return new runtime.JSONApiResponse<string>(response);
    } else {
      return new runtime.TextApiResponse(response) as any;
    }
  }

  /**
   * Block the specified Signal Group.
   * Block a Signal Group.
   */
  async v1GroupsNumberGroupidBlockPost(
    requestParameters: V1GroupsNumberGroupidBlockPostRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<string> {
    const response = await this.v1GroupsNumberGroupidBlockPostRaw(
      requestParameters,
      initOverrides,
    );
    return await response.value();
  }

  /**
   * Delete the specified Signal Group.
   * Delete a Signal Group.
   */
  async v1GroupsNumberGroupidDeleteRaw(
    requestParameters: V1GroupsNumberGroupidDeleteRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<runtime.ApiResponse<string>> {
    if (requestParameters["number"] == null) {
      throw new runtime.RequiredError(
        "number",
        'Required parameter "number" was null or undefined when calling v1GroupsNumberGroupidDelete().',
      );
    }

    if (requestParameters["groupid"] == null) {
      throw new runtime.RequiredError(
        "groupid",
        'Required parameter "groupid" was null or undefined when calling v1GroupsNumberGroupidDelete().',
      );
    }

    const queryParameters: any = {};

    const headerParameters: runtime.HTTPHeaders = {};

    const response = await this.request(
      {
        path: `/v1/groups/{number}/{groupid}`
          .replace(
            `{${"number"}}`,
            encodeURIComponent(String(requestParameters["number"])),
          )
          .replace(
            `{${"groupid"}}`,
            encodeURIComponent(String(requestParameters["groupid"])),
          ),
        method: "DELETE",
        headers: headerParameters,
        query: queryParameters,
      },
      initOverrides,
    );

    if (this.isJsonMime(response.headers.get("content-type"))) {
      return new runtime.JSONApiResponse<string>(response);
    } else {
      return new runtime.TextApiResponse(response) as any;
    }
  }

  /**
   * Delete the specified Signal Group.
   * Delete a Signal Group.
   */
  async v1GroupsNumberGroupidDelete(
    requestParameters: V1GroupsNumberGroupidDeleteRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<string> {
    const response = await this.v1GroupsNumberGroupidDeleteRaw(
      requestParameters,
      initOverrides,
    );
    return await response.value();
  }

  /**
   * List a specific Signal Group.
   * List a Signal Group.
   */
  async v1GroupsNumberGroupidGetRaw(
    requestParameters: V1GroupsNumberGroupidGetRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<runtime.ApiResponse<ClientGroupEntry>> {
    if (requestParameters["number"] == null) {
      throw new runtime.RequiredError(
        "number",
        'Required parameter "number" was null or undefined when calling v1GroupsNumberGroupidGet().',
      );
    }

    if (requestParameters["groupid"] == null) {
      throw new runtime.RequiredError(
        "groupid",
        'Required parameter "groupid" was null or undefined when calling v1GroupsNumberGroupidGet().',
      );
    }

    const queryParameters: any = {};

    const headerParameters: runtime.HTTPHeaders = {};

    const response = await this.request(
      {
        path: `/v1/groups/{number}/{groupid}`
          .replace(
            `{${"number"}}`,
            encodeURIComponent(String(requestParameters["number"])),
          )
          .replace(
            `{${"groupid"}}`,
            encodeURIComponent(String(requestParameters["groupid"])),
          ),
        method: "GET",
        headers: headerParameters,
        query: queryParameters,
      },
      initOverrides,
    );

    return new runtime.JSONApiResponse(response, (jsonValue) =>
      ClientGroupEntryFromJSON(jsonValue),
    );
  }

  /**
   * List a specific Signal Group.
   * List a Signal Group.
   */
  async v1GroupsNumberGroupidGet(
    requestParameters: V1GroupsNumberGroupidGetRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<ClientGroupEntry> {
    const response = await this.v1GroupsNumberGroupidGetRaw(
      requestParameters,
      initOverrides,
    );
    return await response.value();
  }

  /**
   * Join the specified Signal Group.
   * Join a Signal Group.
   */
  async v1GroupsNumberGroupidJoinPostRaw(
    requestParameters: V1GroupsNumberGroupidJoinPostRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<runtime.ApiResponse<string>> {
    if (requestParameters["number"] == null) {
      throw new runtime.RequiredError(
        "number",
        'Required parameter "number" was null or undefined when calling v1GroupsNumberGroupidJoinPost().',
      );
    }

    if (requestParameters["groupid"] == null) {
      throw new runtime.RequiredError(
        "groupid",
        'Required parameter "groupid" was null or undefined when calling v1GroupsNumberGroupidJoinPost().',
      );
    }

    const queryParameters: any = {};

    const headerParameters: runtime.HTTPHeaders = {};

    const response = await this.request(
      {
        path: `/v1/groups/{number}/{groupid}/join`
          .replace(
            `{${"number"}}`,
            encodeURIComponent(String(requestParameters["number"])),
          )
          .replace(
            `{${"groupid"}}`,
            encodeURIComponent(String(requestParameters["groupid"])),
          ),
        method: "POST",
        headers: headerParameters,
        query: queryParameters,
      },
      initOverrides,
    );

    if (this.isJsonMime(response.headers.get("content-type"))) {
      return new runtime.JSONApiResponse<string>(response);
    } else {
      return new runtime.TextApiResponse(response) as any;
    }
  }

  /**
   * Join the specified Signal Group.
   * Join a Signal Group.
   */
  async v1GroupsNumberGroupidJoinPost(
    requestParameters: V1GroupsNumberGroupidJoinPostRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<string> {
    const response = await this.v1GroupsNumberGroupidJoinPostRaw(
      requestParameters,
      initOverrides,
    );
    return await response.value();
  }

  /**
   * Remove one or more members from an existing Signal Group.
   * Remove one or more members from an existing Signal Group.
   */
  async v1GroupsNumberGroupidMembersDeleteRaw(
    requestParameters: V1GroupsNumberGroupidMembersDeleteRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<runtime.ApiResponse<string>> {
    if (requestParameters["number"] == null) {
      throw new runtime.RequiredError(
        "number",
        'Required parameter "number" was null or undefined when calling v1GroupsNumberGroupidMembersDelete().',
      );
    }

    if (requestParameters["data"] == null) {
      throw new runtime.RequiredError(
        "data",
        'Required parameter "data" was null or undefined when calling v1GroupsNumberGroupidMembersDelete().',
      );
    }

    const queryParameters: any = {};

    const headerParameters: runtime.HTTPHeaders = {};

    headerParameters["Content-Type"] = "application/json";

    const response = await this.request(
      {
        path: `/v1/groups/{number}/{groupid}/members`.replace(
          `{${"number"}}`,
          encodeURIComponent(String(requestParameters["number"])),
        ),
        method: "DELETE",
        headers: headerParameters,
        query: queryParameters,
        body: ApiChangeGroupMembersRequestToJSON(requestParameters["data"]),
      },
      initOverrides,
    );

    if (this.isJsonMime(response.headers.get("content-type"))) {
      return new runtime.JSONApiResponse<string>(response);
    } else {
      return new runtime.TextApiResponse(response) as any;
    }
  }

  /**
   * Remove one or more members from an existing Signal Group.
   * Remove one or more members from an existing Signal Group.
   */
  async v1GroupsNumberGroupidMembersDelete(
    requestParameters: V1GroupsNumberGroupidMembersDeleteRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<string> {
    const response = await this.v1GroupsNumberGroupidMembersDeleteRaw(
      requestParameters,
      initOverrides,
    );
    return await response.value();
  }

  /**
   * Add one or more members to an existing Signal Group.
   * Add one or more members to an existing Signal Group.
   */
  async v1GroupsNumberGroupidMembersPostRaw(
    requestParameters: V1GroupsNumberGroupidMembersPostRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<runtime.ApiResponse<string>> {
    if (requestParameters["number"] == null) {
      throw new runtime.RequiredError(
        "number",
        'Required parameter "number" was null or undefined when calling v1GroupsNumberGroupidMembersPost().',
      );
    }

    if (requestParameters["data"] == null) {
      throw new runtime.RequiredError(
        "data",
        'Required parameter "data" was null or undefined when calling v1GroupsNumberGroupidMembersPost().',
      );
    }

    const queryParameters: any = {};

    const headerParameters: runtime.HTTPHeaders = {};

    headerParameters["Content-Type"] = "application/json";

    const response = await this.request(
      {
        path: `/v1/groups/{number}/{groupid}/members`.replace(
          `{${"number"}}`,
          encodeURIComponent(String(requestParameters["number"])),
        ),
        method: "POST",
        headers: headerParameters,
        query: queryParameters,
        body: ApiChangeGroupMembersRequestToJSON(requestParameters["data"]),
      },
      initOverrides,
    );

    if (this.isJsonMime(response.headers.get("content-type"))) {
      return new runtime.JSONApiResponse<string>(response);
    } else {
      return new runtime.TextApiResponse(response) as any;
    }
  }

  /**
   * Add one or more members to an existing Signal Group.
   * Add one or more members to an existing Signal Group.
   */
  async v1GroupsNumberGroupidMembersPost(
    requestParameters: V1GroupsNumberGroupidMembersPostRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<string> {
    const response = await this.v1GroupsNumberGroupidMembersPostRaw(
      requestParameters,
      initOverrides,
    );
    return await response.value();
  }

  /**
   * Update the state of a Signal Group.
   * Update the state of a Signal Group.
   */
  async v1GroupsNumberGroupidPutRaw(
    requestParameters: V1GroupsNumberGroupidPutRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<runtime.ApiResponse<string>> {
    if (requestParameters["number"] == null) {
      throw new runtime.RequiredError(
        "number",
        'Required parameter "number" was null or undefined when calling v1GroupsNumberGroupidPut().',
      );
    }

    if (requestParameters["groupid"] == null) {
      throw new runtime.RequiredError(
        "groupid",
        'Required parameter "groupid" was null or undefined when calling v1GroupsNumberGroupidPut().',
      );
    }

    if (requestParameters["data"] == null) {
      throw new runtime.RequiredError(
        "data",
        'Required parameter "data" was null or undefined when calling v1GroupsNumberGroupidPut().',
      );
    }

    const queryParameters: any = {};

    const headerParameters: runtime.HTTPHeaders = {};

    headerParameters["Content-Type"] = "application/json";

    const response = await this.request(
      {
        path: `/v1/groups/{number}/{groupid}`
          .replace(
            `{${"number"}}`,
            encodeURIComponent(String(requestParameters["number"])),
          )
          .replace(
            `{${"groupid"}}`,
            encodeURIComponent(String(requestParameters["groupid"])),
          ),
        method: "PUT",
        headers: headerParameters,
        query: queryParameters,
        body: ApiUpdateGroupRequestToJSON(requestParameters["data"]),
      },
      initOverrides,
    );

    if (this.isJsonMime(response.headers.get("content-type"))) {
      return new runtime.JSONApiResponse<string>(response);
    } else {
      return new runtime.TextApiResponse(response) as any;
    }
  }

  /**
   * Update the state of a Signal Group.
   * Update the state of a Signal Group.
   */
  async v1GroupsNumberGroupidPut(
    requestParameters: V1GroupsNumberGroupidPutRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<string> {
    const response = await this.v1GroupsNumberGroupidPutRaw(
      requestParameters,
      initOverrides,
    );
    return await response.value();
  }

  /**
   * Quit the specified Signal Group.
   * Quit a Signal Group.
   */
  async v1GroupsNumberGroupidQuitPostRaw(
    requestParameters: V1GroupsNumberGroupidQuitPostRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<runtime.ApiResponse<string>> {
    if (requestParameters["number"] == null) {
      throw new runtime.RequiredError(
        "number",
        'Required parameter "number" was null or undefined when calling v1GroupsNumberGroupidQuitPost().',
      );
    }

    if (requestParameters["groupid"] == null) {
      throw new runtime.RequiredError(
        "groupid",
        'Required parameter "groupid" was null or undefined when calling v1GroupsNumberGroupidQuitPost().',
      );
    }

    const queryParameters: any = {};

    const headerParameters: runtime.HTTPHeaders = {};

    const response = await this.request(
      {
        path: `/v1/groups/{number}/{groupid}/quit`
          .replace(
            `{${"number"}}`,
            encodeURIComponent(String(requestParameters["number"])),
          )
          .replace(
            `{${"groupid"}}`,
            encodeURIComponent(String(requestParameters["groupid"])),
          ),
        method: "POST",
        headers: headerParameters,
        query: queryParameters,
      },
      initOverrides,
    );

    if (this.isJsonMime(response.headers.get("content-type"))) {
      return new runtime.JSONApiResponse<string>(response);
    } else {
      return new runtime.TextApiResponse(response) as any;
    }
  }

  /**
   * Quit the specified Signal Group.
   * Quit a Signal Group.
   */
  async v1GroupsNumberGroupidQuitPost(
    requestParameters: V1GroupsNumberGroupidQuitPostRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<string> {
    const response = await this.v1GroupsNumberGroupidQuitPostRaw(
      requestParameters,
      initOverrides,
    );
    return await response.value();
  }

  /**
   * Create a new Signal Group with the specified members.
   * Create a new Signal Group.
   */
  async v1GroupsNumberPostRaw(
    requestParameters: V1GroupsNumberPostRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<runtime.ApiResponse<ApiCreateGroupResponse>> {
    if (requestParameters["number"] == null) {
      throw new runtime.RequiredError(
        "number",
        'Required parameter "number" was null or undefined when calling v1GroupsNumberPost().',
      );
    }

    if (requestParameters["data"] == null) {
      throw new runtime.RequiredError(
        "data",
        'Required parameter "data" was null or undefined when calling v1GroupsNumberPost().',
      );
    }

    const queryParameters: any = {};

    const headerParameters: runtime.HTTPHeaders = {};

    headerParameters["Content-Type"] = "application/json";

    const response = await this.request(
      {
        path: `/v1/groups/{number}`.replace(
          `{${"number"}}`,
          encodeURIComponent(String(requestParameters["number"])),
        ),
        method: "POST",
        headers: headerParameters,
        query: queryParameters,
        body: ApiCreateGroupRequestToJSON(requestParameters["data"]),
      },
      initOverrides,
    );

    return new runtime.JSONApiResponse(response, (jsonValue) =>
      ApiCreateGroupResponseFromJSON(jsonValue),
    );
  }

  /**
   * Create a new Signal Group with the specified members.
   * Create a new Signal Group.
   */
  async v1GroupsNumberPost(
    requestParameters: V1GroupsNumberPostRequest,
    initOverrides?: RequestInit | runtime.InitOverrideFunction,
  ): Promise<ApiCreateGroupResponse> {
    const response = await this.v1GroupsNumberPostRaw(
      requestParameters,
      initOverrides,
    );
    return await response.value();
  }
}
