/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.10.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.
 */

import { mapValues } from '../runtime';
import type { UserGroup } from './UserGroup';
import {
    UserGroupFromJSON,
    UserGroupFromJSONTyped,
    UserGroupToJSON,
    UserGroupToJSONTyped,
} from './UserGroup';

/**
 * SCIMSourceGroup Serializer
 * @export
 * @interface SCIMSourceGroup
 */
export interface SCIMSourceGroup {
    /**
     * 
     * @type {string}
     * @memberof SCIMSourceGroup
     */
    id?: string;
    /**
     * 
     * @type {string}
     * @memberof SCIMSourceGroup
     */
    externalId: string;
    /**
     * 
     * @type {string}
     * @memberof SCIMSourceGroup
     */
    group: string;
    /**
     * 
     * @type {UserGroup}
     * @memberof SCIMSourceGroup
     */
    readonly groupObj: UserGroup;
    /**
     * 
     * @type {string}
     * @memberof SCIMSourceGroup
     */
    source: string;
    /**
     * 
     * @type {{ [key: string]: any; }}
     * @memberof SCIMSourceGroup
     */
    attributes?: { [key: string]: any; };
}

/**
 * Check if a given object implements the SCIMSourceGroup interface.
 */
export function instanceOfSCIMSourceGroup(value: object): value is SCIMSourceGroup {
    if (!('externalId' in value) || value['externalId'] === undefined) return false;
    if (!('group' in value) || value['group'] === undefined) return false;
    if (!('groupObj' in value) || value['groupObj'] === undefined) return false;
    if (!('source' in value) || value['source'] === undefined) return false;
    return true;
}

export function SCIMSourceGroupFromJSON(json: any): SCIMSourceGroup {
    return SCIMSourceGroupFromJSONTyped(json, false);
}

export function SCIMSourceGroupFromJSONTyped(json: any, ignoreDiscriminator: boolean): SCIMSourceGroup {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'] == null ? undefined : json['id'],
        'externalId': json['external_id'],
        'group': json['group'],
        'groupObj': UserGroupFromJSON(json['group_obj']),
        'source': json['source'],
        'attributes': json['attributes'] == null ? undefined : json['attributes'],
    };
}

export function SCIMSourceGroupToJSON(json: any): SCIMSourceGroup {
    return SCIMSourceGroupToJSONTyped(json, false);
}

export function SCIMSourceGroupToJSONTyped(value?: Omit<SCIMSourceGroup, 'group_obj'> | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'id': value['id'],
        'external_id': value['externalId'],
        'group': value['group'],
        'source': value['source'],
        'attributes': value['attributes'],
    };
}

