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

/**
 * Reputation Serializer
 * @export
 * @interface Reputation
 */
export interface Reputation {
    /**
     *
     * @type {string}
     * @memberof Reputation
     */
    pk?: string;
    /**
     *
     * @type {string}
     * @memberof Reputation
     */
    identifier: string;
    /**
     *
     * @type {string}
     * @memberof Reputation
     */
    ip: string;
    /**
     *
     * @type {{ [key: string]: any; }}
     * @memberof Reputation
     */
    ipGeoData?: { [key: string]: any };
    /**
     *
     * @type {{ [key: string]: any; }}
     * @memberof Reputation
     */
    ipAsnData?: { [key: string]: any };
    /**
     *
     * @type {number}
     * @memberof Reputation
     */
    score?: number;
    /**
     *
     * @type {Date}
     * @memberof Reputation
     */
    readonly updated: Date;
}

/**
 * Check if a given object implements the Reputation interface.
 */
export function instanceOfReputation(value: object): value is Reputation {
    if (!("identifier" in value) || value["identifier"] === undefined) return false;
    if (!("ip" in value) || value["ip"] === undefined) return false;
    if (!("updated" in value) || value["updated"] === undefined) return false;
    return true;
}

export function ReputationFromJSON(json: any): Reputation {
    return ReputationFromJSONTyped(json, false);
}

export function ReputationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Reputation {
    if (json == null) {
        return json;
    }
    return {
        pk: json["pk"] == null ? undefined : json["pk"],
        identifier: json["identifier"],
        ip: json["ip"],
        ipGeoData: json["ip_geo_data"] == null ? undefined : json["ip_geo_data"],
        ipAsnData: json["ip_asn_data"] == null ? undefined : json["ip_asn_data"],
        score: json["score"] == null ? undefined : json["score"],
        updated: new Date(json["updated"]),
    };
}

export function ReputationToJSON(json: any): Reputation {
    return ReputationToJSONTyped(json, false);
}

export function ReputationToJSONTyped(
    value?: Omit<Reputation, "updated"> | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

    return {
        pk: value["pk"],
        identifier: value["identifier"],
        ip: value["ip"],
        ip_geo_data: value["ipGeoData"],
        ip_asn_data: value["ipAsnData"],
        score: value["score"],
    };
}
