/* 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 { mapValues } from "../runtime.js";
import type { ApiGroupPermissions } from "./ApiGroupPermissions.js";
import {
  ApiGroupPermissionsFromJSON,
  ApiGroupPermissionsFromJSONTyped,
  ApiGroupPermissionsToJSON,
} from "./ApiGroupPermissions.js";

/**
 *
 * @export
 * @interface ApiCreateGroupRequest
 */
export interface ApiCreateGroupRequest {
  /**
   *
   * @type {string}
   * @memberof ApiCreateGroupRequest
   */
  description?: string;
  /**
   *
   * @type {string}
   * @memberof ApiCreateGroupRequest
   */
  groupLink?: ApiCreateGroupRequestGroupLinkEnum;
  /**
   *
   * @type {Array<string>}
   * @memberof ApiCreateGroupRequest
   */
  members?: Array<string>;
  /**
   *
   * @type {string}
   * @memberof ApiCreateGroupRequest
   */
  name?: string;
  /**
   *
   * @type {ApiGroupPermissions}
   * @memberof ApiCreateGroupRequest
   */
  permissions?: ApiGroupPermissions;
}

/**
 * @export
 */
export const ApiCreateGroupRequestGroupLinkEnum = {
  Disabled: "disabled",
  Enabled: "enabled",
  EnabledWithApproval: "enabled-with-approval",
} as const;
export type ApiCreateGroupRequestGroupLinkEnum =
  (typeof ApiCreateGroupRequestGroupLinkEnum)[keyof typeof ApiCreateGroupRequestGroupLinkEnum];

/**
 * Check if a given object implements the ApiCreateGroupRequest interface.
 */
export function instanceOfApiCreateGroupRequest(
  value: object,
): value is ApiCreateGroupRequest {
  return true;
}

export function ApiCreateGroupRequestFromJSON(
  json: any,
): ApiCreateGroupRequest {
  return ApiCreateGroupRequestFromJSONTyped(json, false);
}

export function ApiCreateGroupRequestFromJSONTyped(
  json: any,
  ignoreDiscriminator: boolean,
): ApiCreateGroupRequest {
  if (json == null) {
    return json;
  }
  return {
    description: json["description"] == null ? undefined : json["description"],
    groupLink: json["group_link"] == null ? undefined : json["group_link"],
    members: json["members"] == null ? undefined : json["members"],
    name: json["name"] == null ? undefined : json["name"],
    permissions:
      json["permissions"] == null
        ? undefined
        : ApiGroupPermissionsFromJSON(json["permissions"]),
  };
}

export function ApiCreateGroupRequestToJSON(
  value?: ApiCreateGroupRequest | null,
): any {
  if (value == null) {
    return value;
  }
  return {
    description: value["description"],
    group_link: value["groupLink"],
    members: value["members"],
    name: value["name"],
    permissions: ApiGroupPermissionsToJSON(value["permissions"]),
  };
}
