/* 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 { ReviewerUser } from "./ReviewerUser";
import { ReviewerUserFromJSON } from "./ReviewerUser";

/**
 * Mixin to validate that a valid enterprise license
 * exists before allowing to save the object
 * @export
 * @interface Review
 */
export interface Review {
    /**
     *
     * @type {string}
     * @memberof Review
     */
    readonly id: string;
    /**
     *
     * @type {string}
     * @memberof Review
     */
    iteration: string;
    /**
     *
     * @type {ReviewerUser}
     * @memberof Review
     */
    readonly reviewer: ReviewerUser;
    /**
     *
     * @type {Date}
     * @memberof Review
     */
    readonly timestamp: Date;
    /**
     *
     * @type {string}
     * @memberof Review
     */
    note?: string | null;
}

/**
 * Check if a given object implements the Review interface.
 */
export function instanceOfReview(value: object): value is Review {
    if (!("id" in value) || value["id"] === undefined) return false;
    if (!("iteration" in value) || value["iteration"] === undefined) return false;
    if (!("reviewer" in value) || value["reviewer"] === undefined) return false;
    if (!("timestamp" in value) || value["timestamp"] === undefined) return false;
    return true;
}

export function ReviewFromJSON(json: any): Review {
    return ReviewFromJSONTyped(json, false);
}

export function ReviewFromJSONTyped(json: any, ignoreDiscriminator: boolean): Review {
    if (json == null) {
        return json;
    }
    return {
        id: json["id"],
        iteration: json["iteration"],
        reviewer: ReviewerUserFromJSON(json["reviewer"]),
        timestamp: new Date(json["timestamp"]),
        note: json["note"] == null ? undefined : json["note"],
    };
}

export function ReviewToJSON(json: any): Review {
    return ReviewToJSONTyped(json, false);
}

export function ReviewToJSONTyped(
    value?: Omit<Review, "id" | "reviewer" | "timestamp"> | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

    return {
        iteration: value["iteration"],
        note: value["note"],
    };
}
