"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetScheduleRequestBuilderUriTemplate = exports.GetScheduleRequestBuilderRequestsMetadata = exports.serializeGetSchedulePostResponse = exports.serializeGetSchedulePostRequestBody = exports.deserializeIntoGetSchedulePostResponse = exports.deserializeIntoGetSchedulePostRequestBody = exports.createGetSchedulePostResponseFromDiscriminatorValue = exports.createGetSchedulePostRequestBodyFromDiscriminatorValue = 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 getSchedulePostRequestBody
 */
function createGetSchedulePostRequestBodyFromDiscriminatorValue(parseNode) {
    return deserializeIntoGetSchedulePostRequestBody;
}
exports.createGetSchedulePostRequestBodyFromDiscriminatorValue = createGetSchedulePostRequestBodyFromDiscriminatorValue;
/**
 * 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 getSchedulePostResponse
 */
function createGetSchedulePostResponseFromDiscriminatorValue(parseNode) {
    return deserializeIntoGetSchedulePostResponse;
}
exports.createGetSchedulePostResponseFromDiscriminatorValue = createGetSchedulePostResponseFromDiscriminatorValue;
/**
 * The deserialization information for the current model
 * @returns a Record<string, (node: ParseNode) => void>
 */
function deserializeIntoGetSchedulePostRequestBody(getSchedulePostRequestBody = {}) {
    return {
        "availabilityViewInterval": n => { getSchedulePostRequestBody.availabilityViewInterval = n.getNumberValue(); },
        "backingStoreEnabled": n => { getSchedulePostRequestBody.backingStoreEnabled = true; },
        "endTime": n => { getSchedulePostRequestBody.endTime = n.getObjectValue(models_1.createDateTimeTimeZoneFromDiscriminatorValue); },
        "schedules": n => { getSchedulePostRequestBody.schedules = n.getCollectionOfPrimitiveValues(); },
        "startTime": n => { getSchedulePostRequestBody.startTime = n.getObjectValue(models_1.createDateTimeTimeZoneFromDiscriminatorValue); },
    };
}
exports.deserializeIntoGetSchedulePostRequestBody = deserializeIntoGetSchedulePostRequestBody;
/**
 * The deserialization information for the current model
 * @returns a Record<string, (node: ParseNode) => void>
 */
function deserializeIntoGetSchedulePostResponse(getSchedulePostResponse = {}) {
    return Object.assign(Object.assign({}, (0, models_1.deserializeIntoBaseCollectionPaginationCountResponse)(getSchedulePostResponse)), { "value": n => { getSchedulePostResponse.value = n.getCollectionOfObjectValues(models_1.createScheduleInformationFromDiscriminatorValue); } });
}
exports.deserializeIntoGetSchedulePostResponse = deserializeIntoGetSchedulePostResponse;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
function serializeGetSchedulePostRequestBody(writer, getSchedulePostRequestBody = {}) {
    writer.writeNumberValue("AvailabilityViewInterval", getSchedulePostRequestBody.availabilityViewInterval);
    writer.writeObjectValue("EndTime", getSchedulePostRequestBody.endTime, models_1.serializeDateTimeTimeZone);
    writer.writeCollectionOfPrimitiveValues("Schedules", getSchedulePostRequestBody.schedules);
    writer.writeObjectValue("StartTime", getSchedulePostRequestBody.startTime, models_1.serializeDateTimeTimeZone);
    writer.writeAdditionalData(getSchedulePostRequestBody.additionalData);
}
exports.serializeGetSchedulePostRequestBody = serializeGetSchedulePostRequestBody;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
function serializeGetSchedulePostResponse(writer, getSchedulePostResponse = {}) {
    (0, models_1.serializeBaseCollectionPaginationCountResponse)(writer, getSchedulePostResponse);
    writer.writeCollectionOfObjectValues("value", getSchedulePostResponse.value, models_1.serializeScheduleInformation);
}
exports.serializeGetSchedulePostResponse = serializeGetSchedulePostResponse;
/**
 * Metadata for all the requests in the request builder.
 */
exports.GetScheduleRequestBuilderRequestsMetadata = {
    post: {
        responseBodyContentType: "application/json",
        errorMappings: {
            _4XX: oDataErrors_1.createODataErrorFromDiscriminatorValue,
            _5XX: oDataErrors_1.createODataErrorFromDiscriminatorValue,
        },
        adapterMethodName: "sendAsync",
        responseBodyFactory: createGetSchedulePostResponseFromDiscriminatorValue,
        requestBodyContentType: "application/json",
        requestBodySerializer: serializeGetSchedulePostRequestBody,
        requestInformationContentSetMethod: "setContentFromParsable",
    },
};
/**
 * Uri template for the request builder.
 */
exports.GetScheduleRequestBuilderUriTemplate = "{+baseurl}/users/{user%2Did}/calendar/getSchedule";
/* tslint:enable */
/* eslint-enable */
