/* 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.
 */

/**
 * Stripped down group serializer to show relevant children/parents for groups
 * @export
 * @interface RelatedGroup
 */
export interface RelatedGroup {
    /**
     *
     * @type {string}
     * @memberof RelatedGroup
     */
    readonly pk: string;
    /**
     *
     * @type {string}
     * @memberof RelatedGroup
     */
    name: string;
    /**
     * Users added to this group will be superusers.
     * @type {boolean}
     * @memberof RelatedGroup
     */
    isSuperuser?: boolean;
    /**
     *
     * @type {{ [key: string]: any; }}
     * @memberof RelatedGroup
     */
    attributes?: { [key: string]: any };
    /**
     *
     * @type {string}
     * @memberof RelatedGroup
     */
    readonly groupUuid: string;
}

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

export function RelatedGroupFromJSON(json: any): RelatedGroup {
    return RelatedGroupFromJSONTyped(json, false);
}

export function RelatedGroupFromJSONTyped(json: any, ignoreDiscriminator: boolean): RelatedGroup {
    if (json == null) {
        return json;
    }
    return {
        pk: json["pk"],
        name: json["name"],
        isSuperuser: json["is_superuser"] == null ? undefined : json["is_superuser"],
        attributes: json["attributes"] == null ? undefined : json["attributes"],
        groupUuid: json["group_uuid"],
    };
}

export function RelatedGroupToJSON(json: any): RelatedGroup {
    return RelatedGroupToJSONTyped(json, false);
}

export function RelatedGroupToJSONTyped(
    value?: Omit<RelatedGroup, "pk" | "group_uuid"> | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

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