/* 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 { CurrentBrandFlags } from "./CurrentBrandFlags";
import { CurrentBrandFlagsFromJSON, CurrentBrandFlagsToJSON } from "./CurrentBrandFlags";
import type { FooterLink } from "./FooterLink";
import { FooterLinkFromJSON } from "./FooterLink";
import type { ThemedUrls } from "./ThemedUrls";
import { ThemedUrlsFromJSON } from "./ThemedUrls";
import type { UiThemeEnum } from "./UiThemeEnum";
import { UiThemeEnumFromJSON } from "./UiThemeEnum";

/**
 * Partial brand information for styling
 * @export
 * @interface CurrentBrand
 */
export interface CurrentBrand {
    /**
     *
     * @type {string}
     * @memberof CurrentBrand
     */
    matchedDomain: string;
    /**
     *
     * @type {string}
     * @memberof CurrentBrand
     */
    brandingTitle: string;
    /**
     *
     * @type {string}
     * @memberof CurrentBrand
     */
    brandingLogo: string;
    /**
     *
     * @type {ThemedUrls}
     * @memberof CurrentBrand
     */
    readonly brandingLogoThemedUrls: ThemedUrls | null;
    /**
     *
     * @type {string}
     * @memberof CurrentBrand
     */
    brandingFavicon: string;
    /**
     *
     * @type {ThemedUrls}
     * @memberof CurrentBrand
     */
    readonly brandingFaviconThemedUrls: ThemedUrls | null;
    /**
     *
     * @type {string}
     * @memberof CurrentBrand
     */
    brandingCustomCss: string;
    /**
     *
     * @type {Array<FooterLink>}
     * @memberof CurrentBrand
     */
    readonly uiFooterLinks: Array<FooterLink>;
    /**
     *
     * @type {UiThemeEnum}
     * @memberof CurrentBrand
     */
    readonly uiTheme: UiThemeEnum;
    /**
     *
     * @type {string}
     * @memberof CurrentBrand
     */
    flowAuthentication?: string;
    /**
     *
     * @type {string}
     * @memberof CurrentBrand
     */
    flowInvalidation?: string;
    /**
     *
     * @type {string}
     * @memberof CurrentBrand
     */
    flowRecovery?: string;
    /**
     *
     * @type {string}
     * @memberof CurrentBrand
     */
    flowUnenrollment?: string;
    /**
     *
     * @type {string}
     * @memberof CurrentBrand
     */
    flowUserSettings?: string;
    /**
     *
     * @type {string}
     * @memberof CurrentBrand
     */
    flowDeviceCode?: string;
    /**
     *
     * @type {string}
     * @memberof CurrentBrand
     */
    readonly defaultLocale: string;
    /**
     *
     * @type {CurrentBrandFlags}
     * @memberof CurrentBrand
     */
    flags: CurrentBrandFlags;
}

/**
 * Check if a given object implements the CurrentBrand interface.
 */
export function instanceOfCurrentBrand(value: object): value is CurrentBrand {
    if (!("matchedDomain" in value) || value["matchedDomain"] === undefined) return false;
    if (!("brandingTitle" in value) || value["brandingTitle"] === undefined) return false;
    if (!("brandingLogo" in value) || value["brandingLogo"] === undefined) return false;
    if (!("brandingLogoThemedUrls" in value) || value["brandingLogoThemedUrls"] === undefined)
        return false;
    if (!("brandingFavicon" in value) || value["brandingFavicon"] === undefined) return false;
    if (!("brandingFaviconThemedUrls" in value) || value["brandingFaviconThemedUrls"] === undefined)
        return false;
    if (!("brandingCustomCss" in value) || value["brandingCustomCss"] === undefined) return false;
    if (!("uiFooterLinks" in value) || value["uiFooterLinks"] === undefined) return false;
    if (!("uiTheme" in value) || value["uiTheme"] === undefined) return false;
    if (!("defaultLocale" in value) || value["defaultLocale"] === undefined) return false;
    if (!("flags" in value) || value["flags"] === undefined) return false;
    return true;
}

export function CurrentBrandFromJSON(json: any): CurrentBrand {
    return CurrentBrandFromJSONTyped(json, false);
}

export function CurrentBrandFromJSONTyped(json: any, ignoreDiscriminator: boolean): CurrentBrand {
    if (json == null) {
        return json;
    }
    return {
        matchedDomain: json["matched_domain"],
        brandingTitle: json["branding_title"],
        brandingLogo: json["branding_logo"],
        brandingLogoThemedUrls: ThemedUrlsFromJSON(json["branding_logo_themed_urls"]),
        brandingFavicon: json["branding_favicon"],
        brandingFaviconThemedUrls: ThemedUrlsFromJSON(json["branding_favicon_themed_urls"]),
        brandingCustomCss: json["branding_custom_css"],
        uiFooterLinks: (json["ui_footer_links"] as Array<any>).map(FooterLinkFromJSON),
        uiTheme: UiThemeEnumFromJSON(json["ui_theme"]),
        flowAuthentication:
            json["flow_authentication"] == null ? undefined : json["flow_authentication"],
        flowInvalidation: json["flow_invalidation"] == null ? undefined : json["flow_invalidation"],
        flowRecovery: json["flow_recovery"] == null ? undefined : json["flow_recovery"],
        flowUnenrollment: json["flow_unenrollment"] == null ? undefined : json["flow_unenrollment"],
        flowUserSettings:
            json["flow_user_settings"] == null ? undefined : json["flow_user_settings"],
        flowDeviceCode: json["flow_device_code"] == null ? undefined : json["flow_device_code"],
        defaultLocale: json["default_locale"],
        flags: CurrentBrandFlagsFromJSON(json["flags"]),
    };
}

export function CurrentBrandToJSON(json: any): CurrentBrand {
    return CurrentBrandToJSONTyped(json, false);
}

export function CurrentBrandToJSONTyped(
    value?: Omit<
        CurrentBrand,
        | "branding_logo_themed_urls"
        | "branding_favicon_themed_urls"
        | "ui_footer_links"
        | "ui_theme"
        | "default_locale"
    > | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

    return {
        matched_domain: value["matchedDomain"],
        branding_title: value["brandingTitle"],
        branding_logo: value["brandingLogo"],
        branding_favicon: value["brandingFavicon"],
        branding_custom_css: value["brandingCustomCss"],
        flow_authentication: value["flowAuthentication"],
        flow_invalidation: value["flowInvalidation"],
        flow_recovery: value["flowRecovery"],
        flow_unenrollment: value["flowUnenrollment"],
        flow_user_settings: value["flowUserSettings"],
        flow_device_code: value["flowDeviceCode"],
        flags: CurrentBrandFlagsToJSON(value["flags"]),
    };
}
