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

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

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

export function SMSDeviceFromJSON(json: any): SMSDevice {
    return SMSDeviceFromJSONTyped(json, false);
}

export function SMSDeviceFromJSONTyped(json: any, ignoreDiscriminator: boolean): SMSDevice {
    if (json == null) {
        return json;
    }
    return {
        name: json["name"],
        pk: json["pk"],
        phoneNumber: json["phone_number"],
        user: PartialUserFromJSON(json["user"]),
    };
}

export function SMSDeviceToJSON(json: any): SMSDevice {
    return SMSDeviceToJSONTyped(json, false);
}

export function SMSDeviceToJSONTyped(
    value?: Omit<SMSDevice, "pk" | "phone_number" | "user"> | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

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