/* 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 { MatchingModeEnum } from "./MatchingModeEnum";
import { MatchingModeEnumFromJSON, MatchingModeEnumToJSON } from "./MatchingModeEnum";
import type { RedirectUriTypeEnum } from "./RedirectUriTypeEnum";
import { RedirectUriTypeEnumFromJSON, RedirectUriTypeEnumToJSON } from "./RedirectUriTypeEnum";

/**
 * A single allowed redirect URI entry
 * @export
 * @interface RedirectURI
 */
export interface RedirectURI {
    /**
     *
     * @type {MatchingModeEnum}
     * @memberof RedirectURI
     */
    matchingMode: MatchingModeEnum;
    /**
     *
     * @type {string}
     * @memberof RedirectURI
     */
    url: string;
    /**
     *
     * @type {RedirectUriTypeEnum}
     * @memberof RedirectURI
     */
    redirectUriType?: RedirectUriTypeEnum;
}

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

export function RedirectURIFromJSON(json: any): RedirectURI {
    return RedirectURIFromJSONTyped(json, false);
}

export function RedirectURIFromJSONTyped(json: any, ignoreDiscriminator: boolean): RedirectURI {
    if (json == null) {
        return json;
    }
    return {
        matchingMode: MatchingModeEnumFromJSON(json["matching_mode"]),
        url: json["url"],
        redirectUriType:
            json["redirect_uri_type"] == null
                ? undefined
                : RedirectUriTypeEnumFromJSON(json["redirect_uri_type"]),
    };
}

export function RedirectURIToJSON(json: any): RedirectURI {
    return RedirectURIToJSONTyped(json, false);
}

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

    return {
        matching_mode: MatchingModeEnumToJSON(value["matchingMode"]),
        url: value["url"],
        redirect_uri_type: RedirectUriTypeEnumToJSON(value["redirectUriType"]),
    };
}
