"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SendMailRequestBuilderUriTemplate = exports.SendMailRequestBuilderRequestsMetadata = exports.serializeSendMailPostRequestBody = exports.deserializeIntoSendMailPostRequestBody = exports.createSendMailPostRequestBodyFromDiscriminatorValue = void 0;
/* tslint:disable */
/* eslint-disable */
// Generated by Microsoft Kiota
const models_1 = require("@microsoft/msgraph-beta-sdk/models/");
const oDataErrors_1 = require("@microsoft/msgraph-beta-sdk/models/oDataErrors/");
/**
 * Creates a new instance of the appropriate class based on discriminator value
 * @param parseNode The parse node to use to read the discriminator value and create the object
 * @returns a sendMailPostRequestBody
 */
function createSendMailPostRequestBodyFromDiscriminatorValue(parseNode) {
    return deserializeIntoSendMailPostRequestBody;
}
exports.createSendMailPostRequestBodyFromDiscriminatorValue = createSendMailPostRequestBodyFromDiscriminatorValue;
/**
 * The deserialization information for the current model
 * @returns a Record<string, (node: ParseNode) => void>
 */
function deserializeIntoSendMailPostRequestBody(sendMailPostRequestBody = {}) {
    return {
        "backingStoreEnabled": n => { sendMailPostRequestBody.backingStoreEnabled = true; },
        "message": n => { sendMailPostRequestBody.message = n.getObjectValue(models_1.createMessageFromDiscriminatorValue); },
        "saveToSentItems": n => { sendMailPostRequestBody.saveToSentItems = n.getBooleanValue(); },
    };
}
exports.deserializeIntoSendMailPostRequestBody = deserializeIntoSendMailPostRequestBody;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
function serializeSendMailPostRequestBody(writer, sendMailPostRequestBody = {}) {
    writer.writeObjectValue("Message", sendMailPostRequestBody.message, models_1.serializeMessage);
    writer.writeBooleanValue("SaveToSentItems", sendMailPostRequestBody.saveToSentItems);
    writer.writeAdditionalData(sendMailPostRequestBody.additionalData);
}
exports.serializeSendMailPostRequestBody = serializeSendMailPostRequestBody;
/**
 * Metadata for all the requests in the request builder.
 */
exports.SendMailRequestBuilderRequestsMetadata = {
    post: {
        responseBodyContentType: "application/json",
        errorMappings: {
            _4XX: oDataErrors_1.createODataErrorFromDiscriminatorValue,
            _5XX: oDataErrors_1.createODataErrorFromDiscriminatorValue,
        },
        adapterMethodName: "sendNoResponseContentAsync",
        requestBodyContentType: "application/json",
        requestBodySerializer: serializeSendMailPostRequestBody,
        requestInformationContentSetMethod: "setContentFromParsable",
    },
};
/**
 * Uri template for the request builder.
 */
exports.SendMailRequestBuilderUriTemplate = "{+baseurl}/users/{user%2Did}/sendMail";
/* tslint:enable */
/* eslint-enable */
