"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.instanceOfOAuthSourceRequest = instanceOfOAuthSourceRequest;
exports.OAuthSourceRequestFromJSON = OAuthSourceRequestFromJSON;
exports.OAuthSourceRequestFromJSONTyped = OAuthSourceRequestFromJSONTyped;
exports.OAuthSourceRequestToJSON = OAuthSourceRequestToJSON;
exports.OAuthSourceRequestToJSONTyped = OAuthSourceRequestToJSONTyped;
const PolicyEngineMode_1 = require("./PolicyEngineMode");
const UserMatchingModeEnum_1 = require("./UserMatchingModeEnum");
const PKCEMethodEnum_1 = require("./PKCEMethodEnum");
const GroupMatchingModeEnum_1 = require("./GroupMatchingModeEnum");
const AuthorizationCodeAuthMethodEnum_1 = require("./AuthorizationCodeAuthMethodEnum");
const ProviderTypeEnum_1 = require("./ProviderTypeEnum");
/**
 * Check if a given object implements the OAuthSourceRequest interface.
 */
function instanceOfOAuthSourceRequest(value) {
    if (!('name' in value) || value['name'] === undefined)
        return false;
    if (!('slug' in value) || value['slug'] === undefined)
        return false;
    if (!('providerType' in value) || value['providerType'] === undefined)
        return false;
    if (!('consumerKey' in value) || value['consumerKey'] === undefined)
        return false;
    if (!('consumerSecret' in value) || value['consumerSecret'] === undefined)
        return false;
    return true;
}
function OAuthSourceRequestFromJSON(json) {
    return OAuthSourceRequestFromJSONTyped(json, false);
}
function OAuthSourceRequestFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    return {
        'name': json['name'],
        'slug': json['slug'],
        'enabled': json['enabled'] == null ? undefined : json['enabled'],
        'promoted': json['promoted'] == null ? undefined : json['promoted'],
        'authenticationFlow': json['authentication_flow'] == null ? undefined : json['authentication_flow'],
        'enrollmentFlow': json['enrollment_flow'] == null ? undefined : json['enrollment_flow'],
        'userPropertyMappings': json['user_property_mappings'] == null ? undefined : json['user_property_mappings'],
        'groupPropertyMappings': json['group_property_mappings'] == null ? undefined : json['group_property_mappings'],
        'policyEngineMode': json['policy_engine_mode'] == null ? undefined : (0, PolicyEngineMode_1.PolicyEngineModeFromJSON)(json['policy_engine_mode']),
        'userMatchingMode': json['user_matching_mode'] == null ? undefined : (0, UserMatchingModeEnum_1.UserMatchingModeEnumFromJSON)(json['user_matching_mode']),
        'userPathTemplate': json['user_path_template'] == null ? undefined : json['user_path_template'],
        'icon': json['icon'] == null ? undefined : json['icon'],
        'groupMatchingMode': json['group_matching_mode'] == null ? undefined : (0, GroupMatchingModeEnum_1.GroupMatchingModeEnumFromJSON)(json['group_matching_mode']),
        'providerType': (0, ProviderTypeEnum_1.ProviderTypeEnumFromJSON)(json['provider_type']),
        'requestTokenUrl': json['request_token_url'] == null ? undefined : json['request_token_url'],
        'authorizationUrl': json['authorization_url'] == null ? undefined : json['authorization_url'],
        'accessTokenUrl': json['access_token_url'] == null ? undefined : json['access_token_url'],
        'profileUrl': json['profile_url'] == null ? undefined : json['profile_url'],
        'pkce': json['pkce'] == null ? undefined : (0, PKCEMethodEnum_1.PKCEMethodEnumFromJSON)(json['pkce']),
        'consumerKey': json['consumer_key'],
        'consumerSecret': json['consumer_secret'],
        'additionalScopes': json['additional_scopes'] == null ? undefined : json['additional_scopes'],
        'oidcWellKnownUrl': json['oidc_well_known_url'] == null ? undefined : json['oidc_well_known_url'],
        'oidcJwksUrl': json['oidc_jwks_url'] == null ? undefined : json['oidc_jwks_url'],
        'oidcJwks': json['oidc_jwks'] == null ? undefined : json['oidc_jwks'],
        'authorizationCodeAuthMethod': json['authorization_code_auth_method'] == null ? undefined : (0, AuthorizationCodeAuthMethodEnum_1.AuthorizationCodeAuthMethodEnumFromJSON)(json['authorization_code_auth_method']),
    };
}
function OAuthSourceRequestToJSON(json) {
    return OAuthSourceRequestToJSONTyped(json, false);
}
function OAuthSourceRequestToJSONTyped(value, ignoreDiscriminator = false) {
    if (value == null) {
        return value;
    }
    return {
        'name': value['name'],
        'slug': value['slug'],
        'enabled': value['enabled'],
        'promoted': value['promoted'],
        'authentication_flow': value['authenticationFlow'],
        'enrollment_flow': value['enrollmentFlow'],
        'user_property_mappings': value['userPropertyMappings'],
        'group_property_mappings': value['groupPropertyMappings'],
        'policy_engine_mode': (0, PolicyEngineMode_1.PolicyEngineModeToJSON)(value['policyEngineMode']),
        'user_matching_mode': (0, UserMatchingModeEnum_1.UserMatchingModeEnumToJSON)(value['userMatchingMode']),
        'user_path_template': value['userPathTemplate'],
        'icon': value['icon'],
        'group_matching_mode': (0, GroupMatchingModeEnum_1.GroupMatchingModeEnumToJSON)(value['groupMatchingMode']),
        'provider_type': (0, ProviderTypeEnum_1.ProviderTypeEnumToJSON)(value['providerType']),
        'request_token_url': value['requestTokenUrl'],
        'authorization_url': value['authorizationUrl'],
        'access_token_url': value['accessTokenUrl'],
        'profile_url': value['profileUrl'],
        'pkce': (0, PKCEMethodEnum_1.PKCEMethodEnumToJSON)(value['pkce']),
        'consumer_key': value['consumerKey'],
        'consumer_secret': value['consumerSecret'],
        'additional_scopes': value['additionalScopes'],
        'oidc_well_known_url': value['oidcWellKnownUrl'],
        'oidc_jwks_url': value['oidcJwksUrl'],
        'oidc_jwks': value['oidcJwks'],
        'authorization_code_auth_method': (0, AuthorizationCodeAuthMethodEnum_1.AuthorizationCodeAuthMethodEnumToJSON)(value['authorizationCodeAuthMethod']),
    };
}
//# sourceMappingURL=OAuthSourceRequest.js.map