/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.5.3
 * 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 RedirectURIRequest
 */
export interface RedirectURIRequest {
    /**
     *
     * @type {MatchingModeEnum}
     * @memberof RedirectURIRequest
     */
    matchingMode: MatchingModeEnum;
    /**
     *
     * @type {string}
     * @memberof RedirectURIRequest
     */
    url: string;
    /**
     *
     * @type {RedirectURITypeEnum}
     * @memberof RedirectURIRequest
     */
    redirectUriType?: RedirectURITypeEnum;
}

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

export function RedirectURIRequestFromJSON(json: any): RedirectURIRequest {
    return RedirectURIRequestFromJSONTyped(json, false);
}

export function RedirectURIRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): RedirectURIRequest {
    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 RedirectURIRequestToJSON(json: any): RedirectURIRequest {
    return RedirectURIRequestToJSONTyped(json, false);
}

export function RedirectURIRequestToJSONTyped(
    value?: RedirectURIRequest | 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"]),
    };
}
