"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddRequestBuilderRequestsMetadata = exports.AddRequestBuilderUriTemplate = exports.serializeAddPostResponse = exports.serializeAddPostRequestBody = exports.deserializeIntoAddPostResponse = exports.deserializeIntoAddPostRequestBody = exports.createAddPostResponseFromDiscriminatorValue = exports.createAddPostRequestBodyFromDiscriminatorValue = 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 {AddPostRequestBody}
 */
function createAddPostRequestBodyFromDiscriminatorValue(parseNode) {
    return deserializeIntoAddPostRequestBody;
}
exports.createAddPostRequestBodyFromDiscriminatorValue = createAddPostRequestBodyFromDiscriminatorValue;
/**
 * 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 {AddPostResponse}
 */
function createAddPostResponseFromDiscriminatorValue(parseNode) {
    return deserializeIntoAddPostResponse;
}
exports.createAddPostResponseFromDiscriminatorValue = createAddPostResponseFromDiscriminatorValue;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
function deserializeIntoAddPostRequestBody(addPostRequestBody = {}) {
    return {
        "backingStoreEnabled": n => { addPostRequestBody.backingStoreEnabled = true; },
        "values": n => { addPostRequestBody.values = n.getCollectionOfObjectValues(models_1.createConversationMemberFromDiscriminatorValue); },
    };
}
exports.deserializeIntoAddPostRequestBody = deserializeIntoAddPostRequestBody;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
function deserializeIntoAddPostResponse(addPostResponse = {}) {
    return Object.assign(Object.assign({}, (0, models_1.deserializeIntoBaseCollectionPaginationCountResponse)(addPostResponse)), { "value": n => { addPostResponse.value = n.getCollectionOfObjectValues(models_1.createActionResultPartFromDiscriminatorValue); } });
}
exports.deserializeIntoAddPostResponse = deserializeIntoAddPostResponse;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
function serializeAddPostRequestBody(writer, addPostRequestBody = {}) {
    writer.writeCollectionOfObjectValues("values", addPostRequestBody.values, models_1.serializeConversationMember);
    writer.writeAdditionalData(addPostRequestBody.additionalData);
}
exports.serializeAddPostRequestBody = serializeAddPostRequestBody;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
function serializeAddPostResponse(writer, addPostResponse = {}) {
    (0, models_1.serializeBaseCollectionPaginationCountResponse)(writer, addPostResponse);
    writer.writeCollectionOfObjectValues("value", addPostResponse.value, models_1.serializeActionResultPart);
}
exports.serializeAddPostResponse = serializeAddPostResponse;
/**
 * Uri template for the request builder.
 */
exports.AddRequestBuilderUriTemplate = "{+baseurl}/users/{user%2Did}/chats/{chat%2Did}/members/add";
/**
 * Metadata for all the requests in the request builder.
 */
exports.AddRequestBuilderRequestsMetadata = {
    post: {
        uriTemplate: exports.AddRequestBuilderUriTemplate,
        responseBodyContentType: "application/json",
        errorMappings: {
            XXX: oDataErrors_1.createODataErrorFromDiscriminatorValue,
        },
        adapterMethodName: "send",
        responseBodyFactory: createAddPostResponseFromDiscriminatorValue,
        requestBodyContentType: "application/json",
        requestBodySerializer: serializeAddPostRequestBody,
        requestInformationContentSetMethod: "setContentFromParsable",
    },
};
/* tslint:enable */
/* eslint-enable */
