"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.2.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.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfOAuth2Provider = instanceOfOAuth2Provider;
exports.OAuth2ProviderFromJSON = OAuth2ProviderFromJSON;
exports.OAuth2ProviderFromJSONTyped = OAuth2ProviderFromJSONTyped;
exports.OAuth2ProviderToJSON = OAuth2ProviderToJSON;
exports.OAuth2ProviderToJSONTyped = OAuth2ProviderToJSONTyped;
const ClientTypeEnum_1 = require("./ClientTypeEnum");
const SubModeEnum_1 = require("./SubModeEnum");
const OAuth2ProviderLogoutMethodEnum_1 = require("./OAuth2ProviderLogoutMethodEnum");
const RedirectURI_1 = require("./RedirectURI");
const IssuerModeEnum_1 = require("./IssuerModeEnum");
/**
 * Check if a given object implements the OAuth2Provider interface.
 */
function instanceOfOAuth2Provider(value) {
    if (!('pk' in value) || value['pk'] === undefined)
        return false;
    if (!('name' in value) || value['name'] === undefined)
        return false;
    if (!('authorizationFlow' in value) || value['authorizationFlow'] === undefined)
        return false;
    if (!('invalidationFlow' in value) || value['invalidationFlow'] === undefined)
        return false;
    if (!('component' in value) || value['component'] === undefined)
        return false;
    if (!('assignedApplicationSlug' in value) || value['assignedApplicationSlug'] === undefined)
        return false;
    if (!('assignedApplicationName' in value) || value['assignedApplicationName'] === undefined)
        return false;
    if (!('assignedBackchannelApplicationSlug' in value) || value['assignedBackchannelApplicationSlug'] === undefined)
        return false;
    if (!('assignedBackchannelApplicationName' in value) || value['assignedBackchannelApplicationName'] === undefined)
        return false;
    if (!('verboseName' in value) || value['verboseName'] === undefined)
        return false;
    if (!('verboseNamePlural' in value) || value['verboseNamePlural'] === undefined)
        return false;
    if (!('metaModelName' in value) || value['metaModelName'] === undefined)
        return false;
    if (!('redirectUris' in value) || value['redirectUris'] === undefined)
        return false;
    return true;
}
function OAuth2ProviderFromJSON(json) {
    return OAuth2ProviderFromJSONTyped(json, false);
}
function OAuth2ProviderFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    return {
        'pk': json['pk'],
        'name': json['name'],
        'authenticationFlow': json['authentication_flow'] == null ? undefined : json['authentication_flow'],
        'authorizationFlow': json['authorization_flow'],
        'invalidationFlow': json['invalidation_flow'],
        'propertyMappings': json['property_mappings'] == null ? undefined : json['property_mappings'],
        'component': json['component'],
        'assignedApplicationSlug': json['assigned_application_slug'],
        'assignedApplicationName': json['assigned_application_name'],
        'assignedBackchannelApplicationSlug': json['assigned_backchannel_application_slug'],
        'assignedBackchannelApplicationName': json['assigned_backchannel_application_name'],
        'verboseName': json['verbose_name'],
        'verboseNamePlural': json['verbose_name_plural'],
        'metaModelName': json['meta_model_name'],
        'clientType': json['client_type'] == null ? undefined : (0, ClientTypeEnum_1.ClientTypeEnumFromJSON)(json['client_type']),
        'clientId': json['client_id'] == null ? undefined : json['client_id'],
        'clientSecret': json['client_secret'] == null ? undefined : json['client_secret'],
        'accessCodeValidity': json['access_code_validity'] == null ? undefined : json['access_code_validity'],
        'accessTokenValidity': json['access_token_validity'] == null ? undefined : json['access_token_validity'],
        'refreshTokenValidity': json['refresh_token_validity'] == null ? undefined : json['refresh_token_validity'],
        'refreshTokenThreshold': json['refresh_token_threshold'] == null ? undefined : json['refresh_token_threshold'],
        'includeClaimsInIdToken': json['include_claims_in_id_token'] == null ? undefined : json['include_claims_in_id_token'],
        'signingKey': json['signing_key'] == null ? undefined : json['signing_key'],
        'encryptionKey': json['encryption_key'] == null ? undefined : json['encryption_key'],
        'redirectUris': (json['redirect_uris'].map(RedirectURI_1.RedirectURIFromJSON)),
        'logoutUri': json['logout_uri'] == null ? undefined : json['logout_uri'],
        'logoutMethod': json['logout_method'] == null ? undefined : (0, OAuth2ProviderLogoutMethodEnum_1.OAuth2ProviderLogoutMethodEnumFromJSON)(json['logout_method']),
        'subMode': json['sub_mode'] == null ? undefined : (0, SubModeEnum_1.SubModeEnumFromJSON)(json['sub_mode']),
        'issuerMode': json['issuer_mode'] == null ? undefined : (0, IssuerModeEnum_1.IssuerModeEnumFromJSON)(json['issuer_mode']),
        'jwtFederationSources': json['jwt_federation_sources'] == null ? undefined : json['jwt_federation_sources'],
        'jwtFederationProviders': json['jwt_federation_providers'] == null ? undefined : json['jwt_federation_providers'],
    };
}
function OAuth2ProviderToJSON(json) {
    return OAuth2ProviderToJSONTyped(json, false);
}
function OAuth2ProviderToJSONTyped(value, ignoreDiscriminator = false) {
    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'],
        'client_type': (0, ClientTypeEnum_1.ClientTypeEnumToJSON)(value['clientType']),
        'client_id': value['clientId'],
        'client_secret': value['clientSecret'],
        'access_code_validity': value['accessCodeValidity'],
        'access_token_validity': value['accessTokenValidity'],
        'refresh_token_validity': value['refreshTokenValidity'],
        'refresh_token_threshold': value['refreshTokenThreshold'],
        'include_claims_in_id_token': value['includeClaimsInIdToken'],
        'signing_key': value['signingKey'],
        'encryption_key': value['encryptionKey'],
        'redirect_uris': (value['redirectUris'].map(RedirectURI_1.RedirectURIToJSON)),
        'logout_uri': value['logoutUri'],
        'logout_method': (0, OAuth2ProviderLogoutMethodEnum_1.OAuth2ProviderLogoutMethodEnumToJSON)(value['logoutMethod']),
        'sub_mode': (0, SubModeEnum_1.SubModeEnumToJSON)(value['subMode']),
        'issuer_mode': (0, IssuerModeEnum_1.IssuerModeEnumToJSON)(value['issuerMode']),
        'jwt_federation_sources': value['jwtFederationSources'],
        'jwt_federation_providers': value['jwtFederationProviders'],
    };
}
//# sourceMappingURL=OAuth2Provider.js.map