"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SecurityAlertStatusObject = exports.SecurityAlertSeverityObject = exports.SecurityAlertResolvedReasonObject = exports.SecurityAlertConfidenceObject = exports.serializePartnerSecurityAlertCollectionResponse = exports.serializePartnerSecurityAlert = exports.serializePartnerSecurity = exports.serializeAffectedResource = exports.serializeAdditionalDataDictionary = exports.serializeActivityLog = exports.deserializeIntoPartnerSecurityAlertCollectionResponse = exports.deserializeIntoPartnerSecurityAlert = exports.deserializeIntoPartnerSecurity = exports.deserializeIntoAffectedResource = exports.deserializeIntoAdditionalDataDictionary = exports.deserializeIntoActivityLog = exports.createPartnerSecurityFromDiscriminatorValue = exports.createPartnerSecurityAlertFromDiscriminatorValue = exports.createPartnerSecurityAlertCollectionResponseFromDiscriminatorValue = exports.createAffectedResourceFromDiscriminatorValue = exports.createAdditionalDataDictionaryFromDiscriminatorValue = exports.createActivityLogFromDiscriminatorValue = void 0;
/* tslint:disable */
/* eslint-disable */
// Generated by Microsoft Kiota
// @ts-ignore
const __1 = require("../../");
/**
 * 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 {ActivityLog}
 */
function createActivityLogFromDiscriminatorValue(parseNode) {
    return deserializeIntoActivityLog;
}
exports.createActivityLogFromDiscriminatorValue = createActivityLogFromDiscriminatorValue;
/**
 * 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 {AdditionalDataDictionary}
 */
function createAdditionalDataDictionaryFromDiscriminatorValue(parseNode) {
    return deserializeIntoAdditionalDataDictionary;
}
exports.createAdditionalDataDictionaryFromDiscriminatorValue = createAdditionalDataDictionaryFromDiscriminatorValue;
/**
 * 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 {AffectedResource}
 */
function createAffectedResourceFromDiscriminatorValue(parseNode) {
    return deserializeIntoAffectedResource;
}
exports.createAffectedResourceFromDiscriminatorValue = createAffectedResourceFromDiscriminatorValue;
/**
 * 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 {PartnerSecurityAlertCollectionResponse}
 */
function createPartnerSecurityAlertCollectionResponseFromDiscriminatorValue(parseNode) {
    return deserializeIntoPartnerSecurityAlertCollectionResponse;
}
exports.createPartnerSecurityAlertCollectionResponseFromDiscriminatorValue = createPartnerSecurityAlertCollectionResponseFromDiscriminatorValue;
/**
 * 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 {PartnerSecurityAlert}
 */
function createPartnerSecurityAlertFromDiscriminatorValue(parseNode) {
    return deserializeIntoPartnerSecurityAlert;
}
exports.createPartnerSecurityAlertFromDiscriminatorValue = createPartnerSecurityAlertFromDiscriminatorValue;
/**
 * 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 {PartnerSecurity}
 */
function createPartnerSecurityFromDiscriminatorValue(parseNode) {
    return deserializeIntoPartnerSecurity;
}
exports.createPartnerSecurityFromDiscriminatorValue = createPartnerSecurityFromDiscriminatorValue;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
function deserializeIntoActivityLog(activityLog = {}) {
    return {
        "backingStoreEnabled": n => { activityLog.backingStoreEnabled = true; },
        "@odata.type": n => { activityLog.odataType = n.getStringValue(); },
        "statusFrom": n => { activityLog.statusFrom = n.getEnumValue(exports.SecurityAlertStatusObject); },
        "statusTo": n => { activityLog.statusTo = n.getEnumValue(exports.SecurityAlertStatusObject); },
        "updatedBy": n => { activityLog.updatedBy = n.getStringValue(); },
        "updatedDateTime": n => { activityLog.updatedDateTime = n.getDateValue(); },
    };
}
exports.deserializeIntoActivityLog = deserializeIntoActivityLog;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
function deserializeIntoAdditionalDataDictionary(additionalDataDictionary = {}) {
    return Object.assign({}, (0, __1.deserializeIntoDictionary)(additionalDataDictionary));
}
exports.deserializeIntoAdditionalDataDictionary = deserializeIntoAdditionalDataDictionary;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
function deserializeIntoAffectedResource(affectedResource = {}) {
    return {
        "backingStoreEnabled": n => { affectedResource.backingStoreEnabled = true; },
        "@odata.type": n => { affectedResource.odataType = n.getStringValue(); },
        "resourceId": n => { affectedResource.resourceId = n.getStringValue(); },
        "resourceType": n => { affectedResource.resourceType = n.getStringValue(); },
    };
}
exports.deserializeIntoAffectedResource = deserializeIntoAffectedResource;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
function deserializeIntoPartnerSecurity(partnerSecurity = {}) {
    return Object.assign(Object.assign({}, (0, __1.deserializeIntoEntity)(partnerSecurity)), { "securityAlerts": n => { partnerSecurity.securityAlerts = n.getCollectionOfObjectValues(createPartnerSecurityAlertFromDiscriminatorValue); } });
}
exports.deserializeIntoPartnerSecurity = deserializeIntoPartnerSecurity;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
function deserializeIntoPartnerSecurityAlert(partnerSecurityAlert = {}) {
    return Object.assign(Object.assign({}, (0, __1.deserializeIntoEntity)(partnerSecurityAlert)), { "activityLogs": n => { partnerSecurityAlert.activityLogs = n.getCollectionOfObjectValues(createActivityLogFromDiscriminatorValue); }, "additionalDetails": n => { partnerSecurityAlert.additionalDetails = n.getObjectValue(createAdditionalDataDictionaryFromDiscriminatorValue); }, "affectedResources": n => { partnerSecurityAlert.affectedResources = n.getCollectionOfObjectValues(createAffectedResourceFromDiscriminatorValue); }, "alertType": n => { partnerSecurityAlert.alertType = n.getStringValue(); }, "catalogOfferId": n => { partnerSecurityAlert.catalogOfferId = n.getStringValue(); }, "confidenceLevel": n => { partnerSecurityAlert.confidenceLevel = n.getEnumValue(exports.SecurityAlertConfidenceObject); }, "customerTenantId": n => { partnerSecurityAlert.customerTenantId = n.getStringValue(); }, "description": n => { partnerSecurityAlert.description = n.getStringValue(); }, "detectedDateTime": n => { partnerSecurityAlert.detectedDateTime = n.getDateValue(); }, "displayName": n => { partnerSecurityAlert.displayName = n.getStringValue(); }, "firstObservedDateTime": n => { partnerSecurityAlert.firstObservedDateTime = n.getDateValue(); }, "isTest": n => { partnerSecurityAlert.isTest = n.getBooleanValue(); }, "lastObservedDateTime": n => { partnerSecurityAlert.lastObservedDateTime = n.getDateValue(); }, "resolvedBy": n => { partnerSecurityAlert.resolvedBy = n.getStringValue(); }, "resolvedOnDateTime": n => { partnerSecurityAlert.resolvedOnDateTime = n.getDateValue(); }, "resolvedReason": n => { partnerSecurityAlert.resolvedReason = n.getEnumValue(exports.SecurityAlertResolvedReasonObject); }, "severity": n => { partnerSecurityAlert.severity = n.getEnumValue(exports.SecurityAlertSeverityObject); }, "status": n => { partnerSecurityAlert.status = n.getEnumValue(exports.SecurityAlertStatusObject); }, "subscriptionId": n => { partnerSecurityAlert.subscriptionId = n.getStringValue(); }, "valueAddedResellerTenantId": n => { partnerSecurityAlert.valueAddedResellerTenantId = n.getStringValue(); } });
}
exports.deserializeIntoPartnerSecurityAlert = deserializeIntoPartnerSecurityAlert;
/**
 * The deserialization information for the current model
 * @returns {Record<string, (node: ParseNode) => void>}
 */
function deserializeIntoPartnerSecurityAlertCollectionResponse(partnerSecurityAlertCollectionResponse = {}) {
    return Object.assign(Object.assign({}, (0, __1.deserializeIntoBaseCollectionPaginationCountResponse)(partnerSecurityAlertCollectionResponse)), { "value": n => { partnerSecurityAlertCollectionResponse.value = n.getCollectionOfObjectValues(createPartnerSecurityAlertFromDiscriminatorValue); } });
}
exports.deserializeIntoPartnerSecurityAlertCollectionResponse = deserializeIntoPartnerSecurityAlertCollectionResponse;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
function serializeActivityLog(writer, activityLog = {}) {
    writer.writeStringValue("@odata.type", activityLog.odataType);
    writer.writeEnumValue("statusFrom", activityLog.statusFrom);
    writer.writeEnumValue("statusTo", activityLog.statusTo);
    writer.writeStringValue("updatedBy", activityLog.updatedBy);
    writer.writeDateValue("updatedDateTime", activityLog.updatedDateTime);
    writer.writeAdditionalData(activityLog.additionalData);
}
exports.serializeActivityLog = serializeActivityLog;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
function serializeAdditionalDataDictionary(writer, additionalDataDictionary = {}) {
    (0, __1.serializeDictionary)(writer, additionalDataDictionary);
}
exports.serializeAdditionalDataDictionary = serializeAdditionalDataDictionary;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
function serializeAffectedResource(writer, affectedResource = {}) {
    writer.writeStringValue("@odata.type", affectedResource.odataType);
    writer.writeStringValue("resourceId", affectedResource.resourceId);
    writer.writeStringValue("resourceType", affectedResource.resourceType);
    writer.writeAdditionalData(affectedResource.additionalData);
}
exports.serializeAffectedResource = serializeAffectedResource;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
function serializePartnerSecurity(writer, partnerSecurity = {}) {
    (0, __1.serializeEntity)(writer, partnerSecurity);
    writer.writeCollectionOfObjectValues("securityAlerts", partnerSecurity.securityAlerts, serializePartnerSecurityAlert);
}
exports.serializePartnerSecurity = serializePartnerSecurity;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
function serializePartnerSecurityAlert(writer, partnerSecurityAlert = {}) {
    (0, __1.serializeEntity)(writer, partnerSecurityAlert);
    writer.writeCollectionOfObjectValues("activityLogs", partnerSecurityAlert.activityLogs, serializeActivityLog);
    writer.writeObjectValue("additionalDetails", partnerSecurityAlert.additionalDetails, serializeAdditionalDataDictionary);
    writer.writeCollectionOfObjectValues("affectedResources", partnerSecurityAlert.affectedResources, serializeAffectedResource);
    writer.writeStringValue("alertType", partnerSecurityAlert.alertType);
    writer.writeStringValue("catalogOfferId", partnerSecurityAlert.catalogOfferId);
    writer.writeEnumValue("confidenceLevel", partnerSecurityAlert.confidenceLevel);
    writer.writeStringValue("customerTenantId", partnerSecurityAlert.customerTenantId);
    writer.writeStringValue("description", partnerSecurityAlert.description);
    writer.writeDateValue("detectedDateTime", partnerSecurityAlert.detectedDateTime);
    writer.writeStringValue("displayName", partnerSecurityAlert.displayName);
    writer.writeDateValue("firstObservedDateTime", partnerSecurityAlert.firstObservedDateTime);
    writer.writeBooleanValue("isTest", partnerSecurityAlert.isTest);
    writer.writeDateValue("lastObservedDateTime", partnerSecurityAlert.lastObservedDateTime);
    writer.writeStringValue("resolvedBy", partnerSecurityAlert.resolvedBy);
    writer.writeDateValue("resolvedOnDateTime", partnerSecurityAlert.resolvedOnDateTime);
    writer.writeEnumValue("resolvedReason", partnerSecurityAlert.resolvedReason);
    writer.writeEnumValue("severity", partnerSecurityAlert.severity);
    writer.writeEnumValue("status", partnerSecurityAlert.status);
    writer.writeStringValue("subscriptionId", partnerSecurityAlert.subscriptionId);
    writer.writeStringValue("valueAddedResellerTenantId", partnerSecurityAlert.valueAddedResellerTenantId);
}
exports.serializePartnerSecurityAlert = serializePartnerSecurityAlert;
/**
 * Serializes information the current object
 * @param writer Serialization writer to use to serialize this model
 */
function serializePartnerSecurityAlertCollectionResponse(writer, partnerSecurityAlertCollectionResponse = {}) {
    (0, __1.serializeBaseCollectionPaginationCountResponse)(writer, partnerSecurityAlertCollectionResponse);
    writer.writeCollectionOfObjectValues("value", partnerSecurityAlertCollectionResponse.value, serializePartnerSecurityAlert);
}
exports.serializePartnerSecurityAlertCollectionResponse = serializePartnerSecurityAlertCollectionResponse;
exports.SecurityAlertConfidenceObject = {
    Low: "low",
    Medium: "medium",
    High: "high",
    UnknownFutureValue: "unknownFutureValue",
};
exports.SecurityAlertResolvedReasonObject = {
    Legitimate: "legitimate",
    Ignore: "ignore",
    Fraud: "fraud",
    UnknownFutureValue: "unknownFutureValue",
};
exports.SecurityAlertSeverityObject = {
    Informational: "informational",
    High: "high",
    Medium: "medium",
    Low: "low",
    UnknownFutureValue: "unknownFutureValue",
};
exports.SecurityAlertStatusObject = {
    Active: "active",
    Resolved: "resolved",
    Investigating: "investigating",
    UnknownFutureValue: "unknownFutureValue",
};
/* tslint:enable */
/* eslint-enable */
