/* 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";

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

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

export function MicrosoftEntraProviderUserFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): MicrosoftEntraProviderUser {
    if (json == null) {
        return json;
    }
    return {
        id: json["id"],
        microsoftId: json["microsoft_id"],
        user: json["user"],
        userObj: PartialUserFromJSON(json["user_obj"]),
        provider: json["provider"],
        attributes: json["attributes"],
    };
}

export function MicrosoftEntraProviderUserToJSON(json: any): MicrosoftEntraProviderUser {
    return MicrosoftEntraProviderUserToJSONTyped(json, false);
}

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

    return {
        microsoft_id: value["microsoftId"],
        user: value["user"],
        provider: value["provider"],
    };
}
