"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExecuteActionRequestBuilderUriTemplate = exports.ExecuteActionRequestBuilderRequestsMetadata = exports.serializeExecuteActionPostRequestBody = exports.deserializeIntoExecuteActionPostRequestBody = exports.createExecuteActionPostRequestBodyFromDiscriminatorValue = 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 executeActionPostRequestBody
 */
function createExecuteActionPostRequestBodyFromDiscriminatorValue(parseNode) {
    return deserializeIntoExecuteActionPostRequestBody;
}
exports.createExecuteActionPostRequestBodyFromDiscriminatorValue = createExecuteActionPostRequestBodyFromDiscriminatorValue;
/**
 * The deserialization information for the current model
 * @returns a Record<string, (node: ParseNode) => void>
 */
function deserializeIntoExecuteActionPostRequestBody(executeActionPostRequestBody = {}) {
    return {
        "actionName": n => { executeActionPostRequestBody.actionName = n.getEnumValue(models_1.ManagedDeviceRemoteActionObject); },
        "backingStoreEnabled": n => { executeActionPostRequestBody.backingStoreEnabled = true; },
        "carrierUrl": n => { executeActionPostRequestBody.carrierUrl = n.getStringValue(); },
        "deprovisionReason": n => { executeActionPostRequestBody.deprovisionReason = n.getStringValue(); },
        "deviceIds": n => { executeActionPostRequestBody.deviceIds = n.getCollectionOfPrimitiveValues(); },
        "deviceName": n => { executeActionPostRequestBody.deviceName = n.getStringValue(); },
        "keepEnrollmentData": n => { executeActionPostRequestBody.keepEnrollmentData = n.getBooleanValue(); },
        "keepUserData": n => { executeActionPostRequestBody.keepUserData = n.getBooleanValue(); },
        "notificationBody": n => { executeActionPostRequestBody.notificationBody = n.getStringValue(); },
        "notificationTitle": n => { executeActionPostRequestBody.notificationTitle = n.getStringValue(); },
        "organizationalUnitPath": n => { executeActionPostRequestBody.organizationalUnitPath = n.getStringValue(); },
        "persistEsimDataPlan": n => { executeActionPostRequestBody.persistEsimDataPlan = n.getBooleanValue(); },
    };
}
exports.deserializeIntoExecuteActionPostRequestBody = deserializeIntoExecuteActionPostRequestBody;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
function serializeExecuteActionPostRequestBody(writer, executeActionPostRequestBody = {}) {
    writer.writeEnumValue("actionName", executeActionPostRequestBody.actionName);
    writer.writeStringValue("carrierUrl", executeActionPostRequestBody.carrierUrl);
    writer.writeStringValue("deprovisionReason", executeActionPostRequestBody.deprovisionReason);
    writer.writeCollectionOfPrimitiveValues("deviceIds", executeActionPostRequestBody.deviceIds);
    writer.writeStringValue("deviceName", executeActionPostRequestBody.deviceName);
    writer.writeBooleanValue("keepEnrollmentData", executeActionPostRequestBody.keepEnrollmentData);
    writer.writeBooleanValue("keepUserData", executeActionPostRequestBody.keepUserData);
    writer.writeStringValue("notificationBody", executeActionPostRequestBody.notificationBody);
    writer.writeStringValue("notificationTitle", executeActionPostRequestBody.notificationTitle);
    writer.writeStringValue("organizationalUnitPath", executeActionPostRequestBody.organizationalUnitPath);
    writer.writeBooleanValue("persistEsimDataPlan", executeActionPostRequestBody.persistEsimDataPlan);
    writer.writeAdditionalData(executeActionPostRequestBody.additionalData);
}
exports.serializeExecuteActionPostRequestBody = serializeExecuteActionPostRequestBody;
/**
 * Metadata for all the requests in the request builder.
 */
exports.ExecuteActionRequestBuilderRequestsMetadata = {
    post: {
        responseBodyContentType: "application/json",
        errorMappings: {
            _4XX: oDataErrors_1.createODataErrorFromDiscriminatorValue,
            _5XX: oDataErrors_1.createODataErrorFromDiscriminatorValue,
        },
        adapterMethodName: "sendAsync",
        responseBodyFactory: models_1.createBulkManagedDeviceActionResultFromDiscriminatorValue,
        requestBodyContentType: "application/json",
        requestBodySerializer: serializeExecuteActionPostRequestBody,
        requestInformationContentSetMethod: "setContentFromParsable",
    },
};
/**
 * Uri template for the request builder.
 */
exports.ExecuteActionRequestBuilderUriTemplate = "{+baseurl}/users/{user%2Did}/managedDevices/executeAction";
/* tslint:enable */
/* eslint-enable */
