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

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



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

export function PatchedNotificationTransportRequestFromJSON(json: any): PatchedNotificationTransportRequest {
    return PatchedNotificationTransportRequestFromJSONTyped(json, false);
}

export function PatchedNotificationTransportRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedNotificationTransportRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'name': json['name'] == null ? undefined : 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'],
        'emailSubjectPrefix': json['email_subject_prefix'] == null ? undefined : json['email_subject_prefix'],
        'emailTemplate': json['email_template'] == null ? undefined : json['email_template'],
        'sendOnce': json['send_once'] == null ? undefined : json['send_once'],
    };
}

export function PatchedNotificationTransportRequestToJSON(json: any): PatchedNotificationTransportRequest {
    return PatchedNotificationTransportRequestToJSONTyped(json, false);
}

export function PatchedNotificationTransportRequestToJSONTyped(value?: PatchedNotificationTransportRequest | 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'],
        'email_subject_prefix': value['emailSubjectPrefix'],
        'email_template': value['emailTemplate'],
        'send_once': value['sendOnce'],
    };
}

