/* 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 { FlowInspectorPlan } from "./FlowInspectorPlan";
import { FlowInspectorPlanFromJSON, FlowInspectorPlanToJSON } from "./FlowInspectorPlan";

/**
 * Serializer for inspect endpoint
 * @export
 * @interface FlowInspection
 */
export interface FlowInspection {
    /**
     *
     * @type {Array<FlowInspectorPlan>}
     * @memberof FlowInspection
     */
    plans: Array<FlowInspectorPlan>;
    /**
     *
     * @type {FlowInspectorPlan}
     * @memberof FlowInspection
     */
    currentPlan?: FlowInspectorPlan;
    /**
     *
     * @type {boolean}
     * @memberof FlowInspection
     */
    isCompleted: boolean;
}

/**
 * Check if a given object implements the FlowInspection interface.
 */
export function instanceOfFlowInspection(value: object): value is FlowInspection {
    if (!("plans" in value) || value["plans"] === undefined) return false;
    if (!("isCompleted" in value) || value["isCompleted"] === undefined) return false;
    return true;
}

export function FlowInspectionFromJSON(json: any): FlowInspection {
    return FlowInspectionFromJSONTyped(json, false);
}

export function FlowInspectionFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): FlowInspection {
    if (json == null) {
        return json;
    }
    return {
        plans: (json["plans"] as Array<any>).map(FlowInspectorPlanFromJSON),
        currentPlan:
            json["current_plan"] == null
                ? undefined
                : FlowInspectorPlanFromJSON(json["current_plan"]),
        isCompleted: json["is_completed"],
    };
}

export function FlowInspectionToJSON(json: any): FlowInspection {
    return FlowInspectionToJSONTyped(json, false);
}

export function FlowInspectionToJSONTyped(
    value?: FlowInspection | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

    return {
        plans: (value["plans"] as Array<any>).map(FlowInspectorPlanToJSON),
        current_plan: FlowInspectorPlanToJSON(value["currentPlan"]),
        is_completed: value["isCompleted"],
    };
}
