/* 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 { GroupMember } from './GroupMember';
import {
    GroupMemberFromJSON,
    GroupMemberFromJSONTyped,
    GroupMemberToJSON,
    GroupMemberToJSONTyped,
} from './GroupMember';

/**
 * GoogleWorkspaceProviderUser Serializer
 * @export
 * @interface GoogleWorkspaceProviderUser
 */
export interface GoogleWorkspaceProviderUser {
    /**
     * 
     * @type {string}
     * @memberof GoogleWorkspaceProviderUser
     */
    readonly id: string;
    /**
     * 
     * @type {string}
     * @memberof GoogleWorkspaceProviderUser
     */
    googleId: string;
    /**
     * 
     * @type {number}
     * @memberof GoogleWorkspaceProviderUser
     */
    user: number;
    /**
     * 
     * @type {GroupMember}
     * @memberof GoogleWorkspaceProviderUser
     */
    readonly userObj: GroupMember;
    /**
     * 
     * @type {number}
     * @memberof GoogleWorkspaceProviderUser
     */
    provider: number;
    /**
     * 
     * @type {{ [key: string]: any; }}
     * @memberof GoogleWorkspaceProviderUser
     */
    readonly attributes: { [key: string]: any; };
}

/**
 * Check if a given object implements the GoogleWorkspaceProviderUser interface.
 */
export function instanceOfGoogleWorkspaceProviderUser(value: object): value is GoogleWorkspaceProviderUser {
    if (!('id' in value) || value['id'] === undefined) return false;
    if (!('googleId' in value) || value['googleId'] === undefined) return false;
    if (!('user' in value) || value['user'] === undefined) return false;
    if (!('userObj' in value) || value['userObj'] === undefined) return false;
    if (!('provider' in value) || value['provider'] === undefined) return false;
    if (!('attributes' in value) || value['attributes'] === undefined) return false;
    return true;
}

export function GoogleWorkspaceProviderUserFromJSON(json: any): GoogleWorkspaceProviderUser {
    return GoogleWorkspaceProviderUserFromJSONTyped(json, false);
}

export function GoogleWorkspaceProviderUserFromJSONTyped(json: any, ignoreDiscriminator: boolean): GoogleWorkspaceProviderUser {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'],
        'googleId': json['google_id'],
        'user': json['user'],
        'userObj': GroupMemberFromJSON(json['user_obj']),
        'provider': json['provider'],
        'attributes': json['attributes'],
    };
}

export function GoogleWorkspaceProviderUserToJSON(json: any): GoogleWorkspaceProviderUser {
    return GoogleWorkspaceProviderUserToJSONTyped(json, false);
}

export function GoogleWorkspaceProviderUserToJSONTyped(value?: Omit<GoogleWorkspaceProviderUser, 'id'|'user_obj'|'attributes'> | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'google_id': value['googleId'],
        'user': value['user'],
        'provider': value['provider'],
    };
}

