"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FindMeetingTimesRequestBuilderRequestsMetadata = exports.FindMeetingTimesRequestBuilderUriTemplate = exports.serializeFindMeetingTimesPostRequestBody = exports.deserializeIntoFindMeetingTimesPostRequestBody = exports.createFindMeetingTimesPostRequestBodyFromDiscriminatorValue = 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 {FindMeetingTimesPostRequestBody}
 */
function createFindMeetingTimesPostRequestBodyFromDiscriminatorValue(parseNode) {
    return deserializeIntoFindMeetingTimesPostRequestBody;
}
exports.createFindMeetingTimesPostRequestBodyFromDiscriminatorValue = createFindMeetingTimesPostRequestBodyFromDiscriminatorValue;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
function deserializeIntoFindMeetingTimesPostRequestBody(findMeetingTimesPostRequestBody = {}) {
    return {
        "attendees": n => { findMeetingTimesPostRequestBody.attendees = n.getCollectionOfObjectValues(models_1.createAttendeeBaseFromDiscriminatorValue); },
        "backingStoreEnabled": n => { findMeetingTimesPostRequestBody.backingStoreEnabled = true; },
        "isOrganizerOptional": n => { findMeetingTimesPostRequestBody.isOrganizerOptional = n.getBooleanValue(); },
        "locationConstraint": n => { findMeetingTimesPostRequestBody.locationConstraint = n.getObjectValue(models_1.createLocationConstraintFromDiscriminatorValue); },
        "maxCandidates": n => { findMeetingTimesPostRequestBody.maxCandidates = n.getNumberValue(); },
        "meetingDuration": n => { findMeetingTimesPostRequestBody.meetingDuration = n.getDurationValue(); },
        "minimumAttendeePercentage": n => { findMeetingTimesPostRequestBody.minimumAttendeePercentage = n.getNumberValue(); },
        "returnSuggestionReasons": n => { findMeetingTimesPostRequestBody.returnSuggestionReasons = n.getBooleanValue(); },
        "timeConstraint": n => { findMeetingTimesPostRequestBody.timeConstraint = n.getObjectValue(models_1.createTimeConstraintFromDiscriminatorValue); },
    };
}
exports.deserializeIntoFindMeetingTimesPostRequestBody = deserializeIntoFindMeetingTimesPostRequestBody;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
function serializeFindMeetingTimesPostRequestBody(writer, findMeetingTimesPostRequestBody = {}) {
    writer.writeCollectionOfObjectValues("attendees", findMeetingTimesPostRequestBody.attendees, models_1.serializeAttendeeBase);
    writer.writeBooleanValue("isOrganizerOptional", findMeetingTimesPostRequestBody.isOrganizerOptional);
    writer.writeObjectValue("locationConstraint", findMeetingTimesPostRequestBody.locationConstraint, models_1.serializeLocationConstraint);
    writer.writeNumberValue("maxCandidates", findMeetingTimesPostRequestBody.maxCandidates);
    writer.writeDurationValue("meetingDuration", findMeetingTimesPostRequestBody.meetingDuration);
    writer.writeNumberValue("minimumAttendeePercentage", findMeetingTimesPostRequestBody.minimumAttendeePercentage);
    writer.writeBooleanValue("returnSuggestionReasons", findMeetingTimesPostRequestBody.returnSuggestionReasons);
    writer.writeObjectValue("timeConstraint", findMeetingTimesPostRequestBody.timeConstraint, models_1.serializeTimeConstraint);
    writer.writeAdditionalData(findMeetingTimesPostRequestBody.additionalData);
}
exports.serializeFindMeetingTimesPostRequestBody = serializeFindMeetingTimesPostRequestBody;
/**
 * Uri template for the request builder.
 */
exports.FindMeetingTimesRequestBuilderUriTemplate = "{+baseurl}/users/{user%2Did}/findMeetingTimes";
/**
 * Metadata for all the requests in the request builder.
 */
exports.FindMeetingTimesRequestBuilderRequestsMetadata = {
    post: {
        uriTemplate: exports.FindMeetingTimesRequestBuilderUriTemplate,
        responseBodyContentType: "application/json",
        errorMappings: {
            XXX: oDataErrors_1.createODataErrorFromDiscriminatorValue,
        },
        adapterMethodName: "send",
        responseBodyFactory: models_1.createMeetingTimeSuggestionsResultFromDiscriminatorValue,
        requestBodyContentType: "application/json",
        requestBodySerializer: serializeFindMeetingTimesPostRequestBody,
        requestInformationContentSetMethod: "setContentFromParsable",
    },
};
/* tslint:enable */
/* eslint-enable */
