"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.2.0-rc5
 * 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.instanceOfGeoIPPolicy = instanceOfGeoIPPolicy;
exports.GeoIPPolicyFromJSON = GeoIPPolicyFromJSON;
exports.GeoIPPolicyFromJSONTyped = GeoIPPolicyFromJSONTyped;
exports.GeoIPPolicyToJSON = GeoIPPolicyToJSON;
exports.GeoIPPolicyToJSONTyped = GeoIPPolicyToJSONTyped;
const DetailedCountryField_1 = require("./DetailedCountryField");
const CountryCodeEnum_1 = require("./CountryCodeEnum");
/**
 * Check if a given object implements the GeoIPPolicy interface.
 */
function instanceOfGeoIPPolicy(value) {
    if (!('pk' in value) || value['pk'] === undefined)
        return false;
    if (!('name' in value) || value['name'] === 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 (!('boundTo' in value) || value['boundTo'] === undefined)
        return false;
    if (!('countries' in value) || value['countries'] === undefined)
        return false;
    if (!('countriesObj' in value) || value['countriesObj'] === undefined)
        return false;
    return true;
}
function GeoIPPolicyFromJSON(json) {
    return GeoIPPolicyFromJSONTyped(json, false);
}
function GeoIPPolicyFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    return {
        'pk': json['pk'],
        'name': json['name'],
        'executionLogging': json['execution_logging'] == null ? undefined : json['execution_logging'],
        'component': json['component'],
        'verboseName': json['verbose_name'],
        'verboseNamePlural': json['verbose_name_plural'],
        'metaModelName': json['meta_model_name'],
        'boundTo': json['bound_to'],
        'asns': json['asns'] == null ? undefined : json['asns'],
        'countries': (json['countries'].map(CountryCodeEnum_1.CountryCodeEnumFromJSON)),
        'countriesObj': (json['countries_obj'].map(DetailedCountryField_1.DetailedCountryFieldFromJSON)),
        'checkHistoryDistance': json['check_history_distance'] == null ? undefined : json['check_history_distance'],
        'historyMaxDistanceKm': json['history_max_distance_km'] == null ? undefined : json['history_max_distance_km'],
        'distanceToleranceKm': json['distance_tolerance_km'] == null ? undefined : json['distance_tolerance_km'],
        'historyLoginCount': json['history_login_count'] == null ? undefined : json['history_login_count'],
        'checkImpossibleTravel': json['check_impossible_travel'] == null ? undefined : json['check_impossible_travel'],
        'impossibleToleranceKm': json['impossible_tolerance_km'] == null ? undefined : json['impossible_tolerance_km'],
    };
}
function GeoIPPolicyToJSON(json) {
    return GeoIPPolicyToJSONTyped(json, false);
}
function GeoIPPolicyToJSONTyped(value, ignoreDiscriminator = false) {
    if (value == null) {
        return value;
    }
    return {
        'name': value['name'],
        'execution_logging': value['executionLogging'],
        'asns': value['asns'],
        'countries': (value['countries'].map(CountryCodeEnum_1.CountryCodeEnumToJSON)),
        'check_history_distance': value['checkHistoryDistance'],
        'history_max_distance_km': value['historyMaxDistanceKm'],
        'distance_tolerance_km': value['distanceToleranceKm'],
        'history_login_count': value['historyLoginCount'],
        'check_impossible_travel': value['checkImpossibleTravel'],
        'impossible_tolerance_km': value['impossibleToleranceKm'],
    };
}
//# sourceMappingURL=GeoIPPolicy.js.map