/* 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 { PromptTypeEnum } from "./PromptTypeEnum";
import { PromptTypeEnumFromJSON, PromptTypeEnumToJSON } from "./PromptTypeEnum";

/**
 * Prompt Serializer
 * @export
 * @interface PatchedPromptRequest
 */
export interface PatchedPromptRequest {
    /**
     *
     * @type {string}
     * @memberof PatchedPromptRequest
     */
    name?: string;
    /**
     * Name of the form field, also used to store the value
     * @type {string}
     * @memberof PatchedPromptRequest
     */
    fieldKey?: string;
    /**
     *
     * @type {string}
     * @memberof PatchedPromptRequest
     */
    label?: string;
    /**
     *
     * @type {PromptTypeEnum}
     * @memberof PatchedPromptRequest
     */
    type?: PromptTypeEnum;
    /**
     *
     * @type {boolean}
     * @memberof PatchedPromptRequest
     */
    required?: boolean;
    /**
     * Optionally provide a short hint that describes the expected input value. When creating a fixed choice field, enable interpreting as expression and return a list to return multiple choices.
     * @type {string}
     * @memberof PatchedPromptRequest
     */
    placeholder?: string;
    /**
     * Optionally pre-fill the input with an initial value. When creating a fixed choice field, enable interpreting as expression and return a list to return multiple default choices.
     * @type {string}
     * @memberof PatchedPromptRequest
     */
    initialValue?: string;
    /**
     *
     * @type {number}
     * @memberof PatchedPromptRequest
     */
    order?: number;
    /**
     *
     * @type {string}
     * @memberof PatchedPromptRequest
     */
    subText?: string;
    /**
     *
     * @type {boolean}
     * @memberof PatchedPromptRequest
     */
    placeholderExpression?: boolean;
    /**
     *
     * @type {boolean}
     * @memberof PatchedPromptRequest
     */
    initialValueExpression?: boolean;
}

/**
 * Check if a given object implements the PatchedPromptRequest interface.
 */
export function instanceOfPatchedPromptRequest(value: object): value is PatchedPromptRequest {
    return true;
}

export function PatchedPromptRequestFromJSON(json: any): PatchedPromptRequest {
    return PatchedPromptRequestFromJSONTyped(json, false);
}

export function PatchedPromptRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): PatchedPromptRequest {
    if (json == null) {
        return json;
    }
    return {
        name: json["name"] == null ? undefined : json["name"],
        fieldKey: json["field_key"] == null ? undefined : json["field_key"],
        label: json["label"] == null ? undefined : json["label"],
        type: json["type"] == null ? undefined : PromptTypeEnumFromJSON(json["type"]),
        required: json["required"] == null ? undefined : json["required"],
        placeholder: json["placeholder"] == null ? undefined : json["placeholder"],
        initialValue: json["initial_value"] == null ? undefined : json["initial_value"],
        order: json["order"] == null ? undefined : json["order"],
        subText: json["sub_text"] == null ? undefined : json["sub_text"],
        placeholderExpression:
            json["placeholder_expression"] == null ? undefined : json["placeholder_expression"],
        initialValueExpression:
            json["initial_value_expression"] == null ? undefined : json["initial_value_expression"],
    };
}

export function PatchedPromptRequestToJSON(json: any): PatchedPromptRequest {
    return PatchedPromptRequestToJSONTyped(json, false);
}

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

    return {
        name: value["name"],
        field_key: value["fieldKey"],
        label: value["label"],
        type: PromptTypeEnumToJSON(value["type"]),
        required: value["required"],
        placeholder: value["placeholder"],
        initial_value: value["initialValue"],
        order: value["order"],
        sub_text: value["subText"],
        placeholder_expression: value["placeholderExpression"],
        initial_value_expression: value["initialValueExpression"],
    };
}
