/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.5.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 type { EndpointAuthModeEnum } from "./EndpointAuthModeEnum";
import { EndpointAuthModeEnumFromJSON, EndpointAuthModeEnumToJSON } from "./EndpointAuthModeEnum";
import type { ProtocolEnum } from "./ProtocolEnum";
import { ProtocolEnumFromJSON, ProtocolEnumToJSON } from "./ProtocolEnum";

/**
 * Endpoint Serializer
 * @export
 * @interface PatchedEndpointRequest
 */
export interface PatchedEndpointRequest {
    /**
     *
     * @type {string}
     * @memberof PatchedEndpointRequest
     */
    name?: string;
    /**
     *
     * @type {number}
     * @memberof PatchedEndpointRequest
     */
    provider?: number;
    /**
     *
     * @type {ProtocolEnum}
     * @memberof PatchedEndpointRequest
     */
    protocol?: ProtocolEnum;
    /**
     *
     * @type {string}
     * @memberof PatchedEndpointRequest
     */
    host?: string;
    /**
     *
     * @type {{ [key: string]: any; }}
     * @memberof PatchedEndpointRequest
     */
    settings?: { [key: string]: any };
    /**
     *
     * @type {Array<string>}
     * @memberof PatchedEndpointRequest
     */
    propertyMappings?: Array<string>;
    /**
     *
     * @type {EndpointAuthModeEnum}
     * @memberof PatchedEndpointRequest
     */
    authMode?: EndpointAuthModeEnum;
    /**
     *
     * @type {number}
     * @memberof PatchedEndpointRequest
     */
    maximumConnections?: number;
}

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

export function PatchedEndpointRequestFromJSON(json: any): PatchedEndpointRequest {
    return PatchedEndpointRequestFromJSONTyped(json, false);
}

export function PatchedEndpointRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): PatchedEndpointRequest {
    if (json == null) {
        return json;
    }
    return {
        name: json["name"] == null ? undefined : json["name"],
        provider: json["provider"] == null ? undefined : json["provider"],
        protocol: json["protocol"] == null ? undefined : ProtocolEnumFromJSON(json["protocol"]),
        host: json["host"] == null ? undefined : json["host"],
        settings: json["settings"] == null ? undefined : json["settings"],
        propertyMappings: json["property_mappings"] == null ? undefined : json["property_mappings"],
        authMode:
            json["auth_mode"] == null ? undefined : EndpointAuthModeEnumFromJSON(json["auth_mode"]),
        maximumConnections:
            json["maximum_connections"] == null ? undefined : json["maximum_connections"],
    };
}

export function PatchedEndpointRequestToJSON(json: any): PatchedEndpointRequest {
    return PatchedEndpointRequestToJSONTyped(json, false);
}

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

    return {
        name: value["name"],
        provider: value["provider"],
        protocol: ProtocolEnumToJSON(value["protocol"]),
        host: value["host"],
        settings: value["settings"],
        property_mappings: value["propertyMappings"],
        auth_mode: EndpointAuthModeEnumToJSON(value["authMode"]),
        maximum_connections: value["maximumConnections"],
    };
}
