/* tslint:disable */
/* eslint-disable */
// Generated by Microsoft Kiota
// @ts-ignore
import { deserializeIntoEntity, serializeEntity } from '../index.js';
/**
 * 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 {GroupCloudLicensing}
 */
// @ts-ignore
export function createGroupCloudLicensingFromDiscriminatorValue(parseNode) {
    return deserializeIntoGroupCloudLicensing;
}
/**
 * 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 {Service}
 */
// @ts-ignore
export function createServiceFromDiscriminatorValue(parseNode) {
    return deserializeIntoService;
}
/**
 * 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 {UsageRight}
 */
// @ts-ignore
export function createUsageRightFromDiscriminatorValue(parseNode) {
    return deserializeIntoUsageRight;
}
/**
 * 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 {UserCloudLicensing}
 */
// @ts-ignore
export function createUserCloudLicensingFromDiscriminatorValue(parseNode) {
    return deserializeIntoUserCloudLicensing;
}
/**
 * The deserialization information for the current model
 * @param GroupCloudLicensing The instance to deserialize into.
 * @returns {Record<string, (node: ParseNode) => void>}
 */
// @ts-ignore
export function deserializeIntoGroupCloudLicensing(groupCloudLicensing = {}) {
    return {
        "backingStoreEnabled": n => { groupCloudLicensing.backingStoreEnabled = true; },
        "@odata.type": n => { groupCloudLicensing.odataType = n.getStringValue(); },
        "usageRights": n => { groupCloudLicensing.usageRights = n.getCollectionOfObjectValues(createUsageRightFromDiscriminatorValue); },
    };
}
/**
 * The deserialization information for the current model
 * @param Service The instance to deserialize into.
 * @returns {Record<string, (node: ParseNode) => void>}
 */
// @ts-ignore
export function deserializeIntoService(service = {}) {
    return {
        "assignableTo": n => { service.assignableTo = n.getCollectionOfEnumValues(AssigneeTypesObject); },
        "backingStoreEnabled": n => { service.backingStoreEnabled = true; },
        "@odata.type": n => { service.odataType = n.getStringValue(); },
        "planId": n => { service.planId = n.getGuidValue(); },
        "planName": n => { service.planName = n.getStringValue(); },
    };
}
/**
 * The deserialization information for the current model
 * @param UsageRight The instance to deserialize into.
 * @returns {Record<string, (node: ParseNode) => void>}
 */
// @ts-ignore
export function deserializeIntoUsageRight(usageRight = {}) {
    return Object.assign(Object.assign({}, deserializeIntoEntity(usageRight)), { "services": n => { usageRight.services = n.getCollectionOfObjectValues(createServiceFromDiscriminatorValue); }, "skuId": n => { usageRight.skuId = n.getGuidValue(); }, "skuPartNumber": n => { usageRight.skuPartNumber = n.getStringValue(); } });
}
/**
 * The deserialization information for the current model
 * @param UserCloudLicensing The instance to deserialize into.
 * @returns {Record<string, (node: ParseNode) => void>}
 */
// @ts-ignore
export function deserializeIntoUserCloudLicensing(userCloudLicensing = {}) {
    return {
        "backingStoreEnabled": n => { userCloudLicensing.backingStoreEnabled = true; },
        "@odata.type": n => { userCloudLicensing.odataType = n.getStringValue(); },
        "usageRights": n => { userCloudLicensing.usageRights = n.getCollectionOfObjectValues(createUsageRightFromDiscriminatorValue); },
    };
}
/**
 * Serializes information the current object
 * @param GroupCloudLicensing The instance to serialize from.
 * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type.
 * @param writer Serialization writer to use to serialize this model
 */
// @ts-ignore
export function serializeGroupCloudLicensing(writer, groupCloudLicensing = {}, isSerializingDerivedType = false) {
    if (!groupCloudLicensing || isSerializingDerivedType) {
        return;
    }
    writer.writeStringValue("@odata.type", groupCloudLicensing.odataType);
    writer.writeCollectionOfObjectValues("usageRights", groupCloudLicensing.usageRights, serializeUsageRight);
    writer.writeAdditionalData(groupCloudLicensing.additionalData);
}
/**
 * Serializes information the current object
 * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type.
 * @param Service The instance to serialize from.
 * @param writer Serialization writer to use to serialize this model
 */
// @ts-ignore
export function serializeService(writer, service = {}, isSerializingDerivedType = false) {
    if (!service || isSerializingDerivedType) {
        return;
    }
    writer.writeEnumValue("assignableTo", service.assignableTo);
    writer.writeStringValue("@odata.type", service.odataType);
    writer.writeGuidValue("planId", service.planId);
    writer.writeStringValue("planName", service.planName);
    writer.writeAdditionalData(service.additionalData);
}
/**
 * Serializes information the current object
 * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type.
 * @param UsageRight The instance to serialize from.
 * @param writer Serialization writer to use to serialize this model
 */
// @ts-ignore
export function serializeUsageRight(writer, usageRight = {}, isSerializingDerivedType = false) {
    if (!usageRight || isSerializingDerivedType) {
        return;
    }
    serializeEntity(writer, usageRight, isSerializingDerivedType);
    writer.writeCollectionOfObjectValues("services", usageRight.services, serializeService);
    writer.writeGuidValue("skuId", usageRight.skuId);
    writer.writeStringValue("skuPartNumber", usageRight.skuPartNumber);
}
/**
 * Serializes information the current object
 * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type.
 * @param UserCloudLicensing The instance to serialize from.
 * @param writer Serialization writer to use to serialize this model
 */
// @ts-ignore
export function serializeUserCloudLicensing(writer, userCloudLicensing = {}, isSerializingDerivedType = false) {
    if (!userCloudLicensing || isSerializingDerivedType) {
        return;
    }
    writer.writeStringValue("@odata.type", userCloudLicensing.odataType);
    writer.writeCollectionOfObjectValues("usageRights", userCloudLicensing.usageRights, serializeUsageRight);
    writer.writeAdditionalData(userCloudLicensing.additionalData);
}
export const AssigneeTypesObject = {
    None: "none",
    User: "user",
    Group: "group",
    Device: "device",
    UnknownFutureValue: "unknownFutureValue",
};
/* tslint:enable */
/* eslint-enable */
//# sourceMappingURL=index.js.map