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

/**
 * Serializer for email authenticator devices
 * @export
 * @interface EmailDevice
 */
export interface EmailDevice {
    /**
     * The human-readable name of this device.
     * @type {string}
     * @memberof EmailDevice
     */
    name: string;
    /**
     * 
     * @type {number}
     * @memberof EmailDevice
     */
    readonly pk: number;
    /**
     * 
     * @type {string}
     * @memberof EmailDevice
     */
    readonly email: string;
    /**
     * 
     * @type {GroupMember}
     * @memberof EmailDevice
     */
    readonly user: GroupMember;
}

/**
 * Check if a given object implements the EmailDevice interface.
 */
export function instanceOfEmailDevice(value: object): value is EmailDevice {
    if (!('name' in value) || value['name'] === undefined) return false;
    if (!('pk' in value) || value['pk'] === undefined) return false;
    if (!('email' in value) || value['email'] === undefined) return false;
    if (!('user' in value) || value['user'] === undefined) return false;
    return true;
}

export function EmailDeviceFromJSON(json: any): EmailDevice {
    return EmailDeviceFromJSONTyped(json, false);
}

export function EmailDeviceFromJSONTyped(json: any, ignoreDiscriminator: boolean): EmailDevice {
    if (json == null) {
        return json;
    }
    return {
        
        'name': json['name'],
        'pk': json['pk'],
        'email': json['email'],
        'user': GroupMemberFromJSON(json['user']),
    };
}

export function EmailDeviceToJSON(json: any): EmailDevice {
    return EmailDeviceToJSONTyped(json, false);
}

export function EmailDeviceToJSONTyped(value?: Omit<EmailDevice, 'pk'|'email'|'user'> | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'name': value['name'],
    };
}

