/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.10.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 { mapValues } from '../runtime';
import type { ProxyMode } from './ProxyMode';
import {
    ProxyModeFromJSON,
    ProxyModeFromJSONTyped,
    ProxyModeToJSON,
    ProxyModeToJSONTyped,
} from './ProxyMode';

/**
 * ProxyProvider Serializer
 * @export
 * @interface PatchedProxyProviderRequest
 */
export interface PatchedProxyProviderRequest {
    /**
     * 
     * @type {string}
     * @memberof PatchedProxyProviderRequest
     */
    name?: string;
    /**
     * Flow used for authentication when the associated application is accessed by an un-authenticated user.
     * @type {string}
     * @memberof PatchedProxyProviderRequest
     */
    authenticationFlow?: string | null;
    /**
     * Flow used when authorizing this provider.
     * @type {string}
     * @memberof PatchedProxyProviderRequest
     */
    authorizationFlow?: string;
    /**
     * Flow used ending the session from a provider.
     * @type {string}
     * @memberof PatchedProxyProviderRequest
     */
    invalidationFlow?: string;
    /**
     * 
     * @type {Array<string>}
     * @memberof PatchedProxyProviderRequest
     */
    propertyMappings?: Array<string>;
    /**
     * 
     * @type {string}
     * @memberof PatchedProxyProviderRequest
     */
    internalHost?: string;
    /**
     * 
     * @type {string}
     * @memberof PatchedProxyProviderRequest
     */
    externalHost?: string;
    /**
     * Validate SSL Certificates of upstream servers
     * @type {boolean}
     * @memberof PatchedProxyProviderRequest
     */
    internalHostSslValidation?: boolean;
    /**
     * 
     * @type {string}
     * @memberof PatchedProxyProviderRequest
     */
    certificate?: string | null;
    /**
     * Regular expressions for which authentication is not required. Each new line is interpreted as a new Regular Expression.
     * @type {string}
     * @memberof PatchedProxyProviderRequest
     */
    skipPathRegex?: string;
    /**
     * Set a custom HTTP-Basic Authentication header based on values from authentik.
     * @type {boolean}
     * @memberof PatchedProxyProviderRequest
     */
    basicAuthEnabled?: boolean;
    /**
     * User/Group Attribute used for the password part of the HTTP-Basic Header.
     * @type {string}
     * @memberof PatchedProxyProviderRequest
     */
    basicAuthPasswordAttribute?: string;
    /**
     * User/Group Attribute used for the user part of the HTTP-Basic Header. If not set, the user's Email address is used.
     * @type {string}
     * @memberof PatchedProxyProviderRequest
     */
    basicAuthUserAttribute?: string;
    /**
     * Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with internal_host.
     * @type {ProxyMode}
     * @memberof PatchedProxyProviderRequest
     */
    mode?: ProxyMode;
    /**
     * When enabled, this provider will intercept the authorization header and authenticate requests based on its value.
     * @type {boolean}
     * @memberof PatchedProxyProviderRequest
     */
    interceptHeaderAuth?: boolean;
    /**
     * 
     * @type {string}
     * @memberof PatchedProxyProviderRequest
     */
    cookieDomain?: string;
    /**
     * 
     * @type {Array<string>}
     * @memberof PatchedProxyProviderRequest
     */
    jwtFederationSources?: Array<string>;
    /**
     * 
     * @type {Array<number>}
     * @memberof PatchedProxyProviderRequest
     */
    jwtFederationProviders?: Array<number>;
    /**
     * Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).
     * @type {string}
     * @memberof PatchedProxyProviderRequest
     */
    accessTokenValidity?: string;
    /**
     * Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).
     * @type {string}
     * @memberof PatchedProxyProviderRequest
     */
    refreshTokenValidity?: string;
}



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

export function PatchedProxyProviderRequestFromJSON(json: any): PatchedProxyProviderRequest {
    return PatchedProxyProviderRequestFromJSONTyped(json, false);
}

export function PatchedProxyProviderRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedProxyProviderRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'name': json['name'] == null ? undefined : json['name'],
        'authenticationFlow': json['authentication_flow'] == null ? undefined : json['authentication_flow'],
        'authorizationFlow': json['authorization_flow'] == null ? undefined : json['authorization_flow'],
        'invalidationFlow': json['invalidation_flow'] == null ? undefined : json['invalidation_flow'],
        'propertyMappings': json['property_mappings'] == null ? undefined : json['property_mappings'],
        'internalHost': json['internal_host'] == null ? undefined : json['internal_host'],
        'externalHost': json['external_host'] == null ? undefined : json['external_host'],
        'internalHostSslValidation': json['internal_host_ssl_validation'] == null ? undefined : json['internal_host_ssl_validation'],
        'certificate': json['certificate'] == null ? undefined : json['certificate'],
        'skipPathRegex': json['skip_path_regex'] == null ? undefined : json['skip_path_regex'],
        'basicAuthEnabled': json['basic_auth_enabled'] == null ? undefined : json['basic_auth_enabled'],
        'basicAuthPasswordAttribute': json['basic_auth_password_attribute'] == null ? undefined : json['basic_auth_password_attribute'],
        'basicAuthUserAttribute': json['basic_auth_user_attribute'] == null ? undefined : json['basic_auth_user_attribute'],
        'mode': json['mode'] == null ? undefined : ProxyModeFromJSON(json['mode']),
        'interceptHeaderAuth': json['intercept_header_auth'] == null ? undefined : json['intercept_header_auth'],
        'cookieDomain': json['cookie_domain'] == null ? undefined : json['cookie_domain'],
        'jwtFederationSources': json['jwt_federation_sources'] == null ? undefined : json['jwt_federation_sources'],
        'jwtFederationProviders': json['jwt_federation_providers'] == null ? undefined : json['jwt_federation_providers'],
        'accessTokenValidity': json['access_token_validity'] == null ? undefined : json['access_token_validity'],
        'refreshTokenValidity': json['refresh_token_validity'] == null ? undefined : json['refresh_token_validity'],
    };
}

export function PatchedProxyProviderRequestToJSON(json: any): PatchedProxyProviderRequest {
    return PatchedProxyProviderRequestToJSONTyped(json, false);
}

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

    return {
        
        'name': value['name'],
        'authentication_flow': value['authenticationFlow'],
        'authorization_flow': value['authorizationFlow'],
        'invalidation_flow': value['invalidationFlow'],
        'property_mappings': value['propertyMappings'],
        'internal_host': value['internalHost'],
        'external_host': value['externalHost'],
        'internal_host_ssl_validation': value['internalHostSslValidation'],
        'certificate': value['certificate'],
        'skip_path_regex': value['skipPathRegex'],
        'basic_auth_enabled': value['basicAuthEnabled'],
        'basic_auth_password_attribute': value['basicAuthPasswordAttribute'],
        'basic_auth_user_attribute': value['basicAuthUserAttribute'],
        'mode': ProxyModeToJSON(value['mode']),
        'intercept_header_auth': value['interceptHeaderAuth'],
        'cookie_domain': value['cookieDomain'],
        'jwt_federation_sources': value['jwtFederationSources'],
        'jwt_federation_providers': value['jwtFederationProviders'],
        'access_token_validity': value['accessTokenValidity'],
        'refresh_token_validity': value['refreshTokenValidity'],
    };
}

