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

import type { PartialUser } from "./PartialUser";
import { PartialUserFromJSON } from "./PartialUser";

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

/**
 * Check if a given object implements the SCIMProviderUser interface.
 */
export function instanceOfSCIMProviderUser(value: object): value is SCIMProviderUser {
    if (!("id" in value) || value["id"] === undefined) return false;
    if (!("scimId" in value) || value["scimId"] === 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 SCIMProviderUserFromJSON(json: any): SCIMProviderUser {
    return SCIMProviderUserFromJSONTyped(json, false);
}

export function SCIMProviderUserFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): SCIMProviderUser {
    if (json == null) {
        return json;
    }
    return {
        id: json["id"],
        scimId: json["scim_id"],
        user: json["user"],
        userObj: PartialUserFromJSON(json["user_obj"]),
        provider: json["provider"],
        attributes: json["attributes"],
    };
}

export function SCIMProviderUserToJSON(json: any): SCIMProviderUser {
    return SCIMProviderUserToJSONTyped(json, false);
}

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

    return {
        scim_id: value["scimId"],
        user: value["user"],
        provider: value["provider"],
    };
}
