/* 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 { PolicyEngineMode } from "./PolicyEngineMode";
import { PolicyEngineModeFromJSON, PolicyEngineModeToJSON } from "./PolicyEngineMode";

/**
 * Application Serializer
 * @export
 * @interface ApplicationRequest
 */
export interface ApplicationRequest {
    /**
     * Application's display Name.
     * @type {string}
     * @memberof ApplicationRequest
     */
    name: string;
    /**
     * Internal application name, used in URLs.
     * @type {string}
     * @memberof ApplicationRequest
     */
    slug: string;
    /**
     *
     * @type {number}
     * @memberof ApplicationRequest
     */
    provider?: number | null;
    /**
     *
     * @type {Array<number>}
     * @memberof ApplicationRequest
     */
    backchannelProviders?: Array<number>;
    /**
     * Open launch URL in a new browser tab or window.
     * @type {boolean}
     * @memberof ApplicationRequest
     */
    openInNewTab?: boolean;
    /**
     *
     * @type {string}
     * @memberof ApplicationRequest
     */
    metaLaunchUrl?: string;
    /**
     *
     * @type {string}
     * @memberof ApplicationRequest
     */
    metaIcon?: string;
    /**
     *
     * @type {string}
     * @memberof ApplicationRequest
     */
    metaDescription?: string;
    /**
     *
     * @type {string}
     * @memberof ApplicationRequest
     */
    metaPublisher?: string;
    /**
     *
     * @type {PolicyEngineMode}
     * @memberof ApplicationRequest
     */
    policyEngineMode?: PolicyEngineMode;
    /**
     *
     * @type {string}
     * @memberof ApplicationRequest
     */
    group?: string;
    /**
     * Hide this application from the user dashboard.
     * @type {boolean}
     * @memberof ApplicationRequest
     */
    metaHide?: boolean;
}

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

export function ApplicationRequestFromJSON(json: any): ApplicationRequest {
    return ApplicationRequestFromJSONTyped(json, false);
}

export function ApplicationRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): ApplicationRequest {
    if (json == null) {
        return json;
    }
    return {
        name: json["name"],
        slug: json["slug"],
        provider: json["provider"] == null ? undefined : json["provider"],
        backchannelProviders:
            json["backchannel_providers"] == null ? undefined : json["backchannel_providers"],
        openInNewTab: json["open_in_new_tab"] == null ? undefined : json["open_in_new_tab"],
        metaLaunchUrl: json["meta_launch_url"] == null ? undefined : json["meta_launch_url"],
        metaIcon: json["meta_icon"] == null ? undefined : json["meta_icon"],
        metaDescription: json["meta_description"] == null ? undefined : json["meta_description"],
        metaPublisher: json["meta_publisher"] == null ? undefined : json["meta_publisher"],
        policyEngineMode:
            json["policy_engine_mode"] == null
                ? undefined
                : PolicyEngineModeFromJSON(json["policy_engine_mode"]),
        group: json["group"] == null ? undefined : json["group"],
        metaHide: json["meta_hide"] == null ? undefined : json["meta_hide"],
    };
}

export function ApplicationRequestToJSON(json: any): ApplicationRequest {
    return ApplicationRequestToJSONTyped(json, false);
}

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

    return {
        name: value["name"],
        slug: value["slug"],
        provider: value["provider"],
        backchannel_providers: value["backchannelProviders"],
        open_in_new_tab: value["openInNewTab"],
        meta_launch_url: value["metaLaunchUrl"],
        meta_icon: value["metaIcon"],
        meta_description: value["metaDescription"],
        meta_publisher: value["metaPublisher"],
        policy_engine_mode: PolicyEngineModeToJSON(value["policyEngineMode"]),
        group: value["group"],
        meta_hide: value["metaHide"],
    };
}
