/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.5.0-rc1
 * Contact: hello@goauthentik.io
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

/**
 * Group Serializer
 * @export
 * @interface GroupRequest
 */
export interface GroupRequest {
    /**
     *
     * @type {string}
     * @memberof GroupRequest
     */
    name: string;
    /**
     * Users added to this group will be superusers.
     * @type {boolean}
     * @memberof GroupRequest
     */
    isSuperuser?: boolean;
    /**
     *
     * @type {Array<string>}
     * @memberof GroupRequest
     */
    parents?: Array<string>;
    /**
     *
     * @type {Array<number>}
     * @memberof GroupRequest
     */
    users?: Array<number>;
    /**
     *
     * @type {{ [key: string]: any; }}
     * @memberof GroupRequest
     */
    attributes?: { [key: string]: any };
    /**
     *
     * @type {Array<string>}
     * @memberof GroupRequest
     */
    roles?: Array<string>;
}

/**
 * Check if a given object implements the GroupRequest interface.
 */
export function instanceOfGroupRequest(value: object): value is GroupRequest {
    if (!("name" in value) || value["name"] === undefined) return false;
    return true;
}

export function GroupRequestFromJSON(json: any): GroupRequest {
    return GroupRequestFromJSONTyped(json, false);
}

export function GroupRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupRequest {
    if (json == null) {
        return json;
    }
    return {
        name: json["name"],
        isSuperuser: json["is_superuser"] == null ? undefined : json["is_superuser"],
        parents: json["parents"] == null ? undefined : json["parents"],
        users: json["users"] == null ? undefined : json["users"],
        attributes: json["attributes"] == null ? undefined : json["attributes"],
        roles: json["roles"] == null ? undefined : json["roles"],
    };
}

export function GroupRequestToJSON(json: any): GroupRequest {
    return GroupRequestToJSONTyped(json, false);
}

export function GroupRequestToJSONTyped(
    value?: GroupRequest | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

    return {
        name: value["name"],
        is_superuser: value["isSuperuser"],
        parents: value["parents"],
        users: value["users"],
        attributes: value["attributes"],
        roles: value["roles"],
    };
}
