/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.6.4
 * 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 { mapValues } from '../runtime';
import type { NotificationTransportModeEnum } from './NotificationTransportModeEnum';
import {
    NotificationTransportModeEnumFromJSON,
    NotificationTransportModeEnumFromJSONTyped,
    NotificationTransportModeEnumToJSON,
    NotificationTransportModeEnumToJSONTyped,
} from './NotificationTransportModeEnum';

/**
 * NotificationTransport Serializer
 * @export
 * @interface NotificationTransportRequest
 */
export interface NotificationTransportRequest {
    /**
     * 
     * @type {string}
     * @memberof NotificationTransportRequest
     */
    name: string;
    /**
     * 
     * @type {NotificationTransportModeEnum}
     * @memberof NotificationTransportRequest
     */
    mode?: NotificationTransportModeEnum;
    /**
     * 
     * @type {string}
     * @memberof NotificationTransportRequest
     */
    webhookUrl?: string;
    /**
     * Customize the body of the request. Mapping should return data that is JSON-serializable.
     * @type {string}
     * @memberof NotificationTransportRequest
     */
    webhookMappingBody?: string | null;
    /**
     * Configure additional headers to be sent. Mapping should return a dictionary of key-value pairs
     * @type {string}
     * @memberof NotificationTransportRequest
     */
    webhookMappingHeaders?: string | null;
    /**
     * Only send notification once, for example when sending a webhook into a chat channel.
     * @type {boolean}
     * @memberof NotificationTransportRequest
     */
    sendOnce?: boolean;
}



/**
 * Check if a given object implements the NotificationTransportRequest interface.
 */
export function instanceOfNotificationTransportRequest(value: object): value is NotificationTransportRequest {
    if (!('name' in value) || value['name'] === undefined) return false;
    return true;
}

export function NotificationTransportRequestFromJSON(json: any): NotificationTransportRequest {
    return NotificationTransportRequestFromJSONTyped(json, false);
}

export function NotificationTransportRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): NotificationTransportRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'name': json['name'],
        'mode': json['mode'] == null ? undefined : NotificationTransportModeEnumFromJSON(json['mode']),
        'webhookUrl': json['webhook_url'] == null ? undefined : json['webhook_url'],
        'webhookMappingBody': json['webhook_mapping_body'] == null ? undefined : json['webhook_mapping_body'],
        'webhookMappingHeaders': json['webhook_mapping_headers'] == null ? undefined : json['webhook_mapping_headers'],
        'sendOnce': json['send_once'] == null ? undefined : json['send_once'],
    };
}

export function NotificationTransportRequestToJSON(json: any): NotificationTransportRequest {
    return NotificationTransportRequestToJSONTyped(json, false);
}

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

    return {
        
        'name': value['name'],
        'mode': NotificationTransportModeEnumToJSON(value['mode']),
        'webhook_url': value['webhookUrl'],
        'webhook_mapping_body': value['webhookMappingBody'],
        'webhook_mapping_headers': value['webhookMappingHeaders'],
        'send_once': value['sendOnce'],
    };
}

