"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.instanceOfTelegramSource = instanceOfTelegramSource;
exports.TelegramSourceFromJSON = TelegramSourceFromJSON;
exports.TelegramSourceFromJSONTyped = TelegramSourceFromJSONTyped;
exports.TelegramSourceToJSON = TelegramSourceToJSON;
exports.TelegramSourceToJSONTyped = TelegramSourceToJSONTyped;
const PolicyEngineMode_1 = require("./PolicyEngineMode");
const UserMatchingModeEnum_1 = require("./UserMatchingModeEnum");
const ThemedUrls_1 = require("./ThemedUrls");
/**
 * Check if a given object implements the TelegramSource interface.
 */
function instanceOfTelegramSource(value) {
    if (!('pk' in value) || value['pk'] === undefined)
        return false;
    if (!('name' in value) || value['name'] === undefined)
        return false;
    if (!('slug' in value) || value['slug'] === undefined)
        return false;
    if (!('component' in value) || value['component'] === 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 (!('managed' in value) || value['managed'] === undefined)
        return false;
    if (!('iconUrl' in value) || value['iconUrl'] === undefined)
        return false;
    if (!('iconThemedUrls' in value) || value['iconThemedUrls'] === undefined)
        return false;
    if (!('botUsername' in value) || value['botUsername'] === undefined)
        return false;
    if (!('preAuthenticationFlow' in value) || value['preAuthenticationFlow'] === undefined)
        return false;
    return true;
}
function TelegramSourceFromJSON(json) {
    return TelegramSourceFromJSONTyped(json, false);
}
function TelegramSourceFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    return {
        'pk': json['pk'],
        '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'],
        'component': json['component'],
        'verboseName': json['verbose_name'],
        'verboseNamePlural': json['verbose_name_plural'],
        'metaModelName': json['meta_model_name'],
        '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']),
        'managed': json['managed'],
        'userPathTemplate': json['user_path_template'] == null ? undefined : json['user_path_template'],
        'icon': json['icon'] == null ? undefined : json['icon'],
        'iconUrl': json['icon_url'],
        'iconThemedUrls': (0, ThemedUrls_1.ThemedUrlsFromJSON)(json['icon_themed_urls']),
        'botUsername': json['bot_username'],
        'requestMessageAccess': json['request_message_access'] == null ? undefined : json['request_message_access'],
        'preAuthenticationFlow': json['pre_authentication_flow'],
    };
}
function TelegramSourceToJSON(json) {
    return TelegramSourceToJSONTyped(json, false);
}
function TelegramSourceToJSONTyped(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'],
        'bot_username': value['botUsername'],
        'request_message_access': value['requestMessageAccess'],
        'pre_authentication_flow': value['preAuthenticationFlow'],
    };
}
//# sourceMappingURL=TelegramSource.js.map