UNPKG

@microsoft/msgraph-beta-sdk

Version:
543 lines 25.8 kB
/* tslint:disable */ /* eslint-disable */ // Generated by Microsoft Kiota // @ts-ignore import { createPublicErrorFromDiscriminatorValue, deserializeIntoBaseCollectionPaginationCountResponse, deserializeIntoEntity, LongRunningOperationStatusObject, serializeBaseCollectionPaginationCountResponse, serializeEntity, serializePublicError } 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 {AzureUsage} */ // @ts-ignore export function createAzureUsageFromDiscriminatorValue(parseNode) { return deserializeIntoAzureUsage; } /** * 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 {BilledReconciliation} */ // @ts-ignore export function createBilledReconciliationFromDiscriminatorValue(parseNode) { return deserializeIntoBilledReconciliation; } /** * 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 {BilledUsage} */ // @ts-ignore export function createBilledUsageFromDiscriminatorValue(parseNode) { return deserializeIntoBilledUsage; } /** * 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 {Billing} */ // @ts-ignore export function createBillingFromDiscriminatorValue(parseNode) { return deserializeIntoBilling; } /** * 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 {BillingReconciliation} */ // @ts-ignore export function createBillingReconciliationFromDiscriminatorValue(parseNode) { return deserializeIntoBillingReconciliation; } /** * 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 {Blob} */ // @ts-ignore export function createBlobFromDiscriminatorValue(parseNode) { return deserializeIntoBlob; } /** * 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 {ExportSuccessOperation} */ // @ts-ignore export function createExportSuccessOperationFromDiscriminatorValue(parseNode) { return deserializeIntoExportSuccessOperation; } /** * 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 {FailedOperation} */ // @ts-ignore export function createFailedOperationFromDiscriminatorValue(parseNode) { return deserializeIntoFailedOperation; } /** * 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 {ManifestCollectionResponse} */ // @ts-ignore export function createManifestCollectionResponseFromDiscriminatorValue(parseNode) { return deserializeIntoManifestCollectionResponse; } /** * 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 {Manifest} */ // @ts-ignore export function createManifestFromDiscriminatorValue(parseNode) { return deserializeIntoManifest; } /** * 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 {OperationCollectionResponse} */ // @ts-ignore export function createOperationCollectionResponseFromDiscriminatorValue(parseNode) { return deserializeIntoOperationCollectionResponse; } /** * 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 {Operation} */ // @ts-ignore export function createOperationFromDiscriminatorValue(parseNode) { if (!parseNode) throw new Error("parseNode cannot be undefined"); const mappingValueNode = parseNode === null || parseNode === void 0 ? void 0 : parseNode.getChildNode("@odata.type"); if (mappingValueNode) { const mappingValue = mappingValueNode.getStringValue(); if (mappingValue) { switch (mappingValue) { case "#microsoft.graph.partners.billing.exportSuccessOperation": return deserializeIntoExportSuccessOperation; case "#microsoft.graph.partners.billing.failedOperation": return deserializeIntoFailedOperation; case "#microsoft.graph.partners.billing.runningOperation": return deserializeIntoRunningOperation; } } } return deserializeIntoOperation; } /** * 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 {RunningOperation} */ // @ts-ignore export function createRunningOperationFromDiscriminatorValue(parseNode) { return deserializeIntoRunningOperation; } /** * 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 {UnbilledReconciliation} */ // @ts-ignore export function createUnbilledReconciliationFromDiscriminatorValue(parseNode) { return deserializeIntoUnbilledReconciliation; } /** * 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 {UnbilledUsage} */ // @ts-ignore export function createUnbilledUsageFromDiscriminatorValue(parseNode) { return deserializeIntoUnbilledUsage; } /** * The deserialization information for the current model * @param AzureUsage The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoAzureUsage(azureUsage = {}) { return Object.assign(Object.assign({}, deserializeIntoEntity(azureUsage)), { "billed": n => { azureUsage.billed = n.getObjectValue(createBilledUsageFromDiscriminatorValue); }, "unbilled": n => { azureUsage.unbilled = n.getObjectValue(createUnbilledUsageFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @param BilledReconciliation The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoBilledReconciliation(billedReconciliation = {}) { return Object.assign({}, deserializeIntoEntity(billedReconciliation)); } /** * The deserialization information for the current model * @param BilledUsage The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoBilledUsage(billedUsage = {}) { return Object.assign({}, deserializeIntoEntity(billedUsage)); } /** * The deserialization information for the current model * @param Billing The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoBilling(billing = {}) { return Object.assign(Object.assign({}, deserializeIntoEntity(billing)), { "manifests": n => { billing.manifests = n.getCollectionOfObjectValues(createManifestFromDiscriminatorValue); }, "operations": n => { billing.operations = n.getCollectionOfObjectValues(createOperationFromDiscriminatorValue); }, "reconciliation": n => { billing.reconciliation = n.getObjectValue(createBillingReconciliationFromDiscriminatorValue); }, "usage": n => { billing.usage = n.getObjectValue(createAzureUsageFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @param BillingReconciliation The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoBillingReconciliation(billingReconciliation = {}) { return Object.assign(Object.assign({}, deserializeIntoEntity(billingReconciliation)), { "billed": n => { billingReconciliation.billed = n.getObjectValue(createBilledReconciliationFromDiscriminatorValue); }, "unbilled": n => { billingReconciliation.unbilled = n.getObjectValue(createUnbilledReconciliationFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @param Blob The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoBlob(blob = {}) { return { "backingStoreEnabled": n => { blob.backingStoreEnabled = true; }, "name": n => { blob.name = n.getStringValue(); }, "@odata.type": n => { blob.odataType = n.getStringValue(); }, "partitionValue": n => { blob.partitionValue = n.getStringValue(); }, }; } /** * The deserialization information for the current model * @param ExportSuccessOperation The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoExportSuccessOperation(exportSuccessOperation = {}) { return Object.assign(Object.assign({}, deserializeIntoOperation(exportSuccessOperation)), { "resourceLocation": n => { exportSuccessOperation.resourceLocation = n.getObjectValue(createManifestFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @param FailedOperation The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoFailedOperation(failedOperation = {}) { return Object.assign(Object.assign({}, deserializeIntoOperation(failedOperation)), { "error": n => { failedOperation.errorEscaped = n.getObjectValue(createPublicErrorFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @param Manifest The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoManifest(manifest = {}) { return Object.assign(Object.assign({}, deserializeIntoEntity(manifest)), { "blobCount": n => { manifest.blobCount = n.getNumberValue(); }, "blobs": n => { manifest.blobs = n.getCollectionOfObjectValues(createBlobFromDiscriminatorValue); }, "createdDateTime": n => { manifest.createdDateTime = n.getDateValue(); }, "dataFormat": n => { manifest.dataFormat = n.getStringValue(); }, "eTag": n => { manifest.eTag = n.getStringValue(); }, "partitionType": n => { manifest.partitionType = n.getStringValue(); }, "partnerTenantId": n => { manifest.partnerTenantId = n.getStringValue(); }, "rootDirectory": n => { manifest.rootDirectory = n.getStringValue(); }, "sasToken": n => { manifest.sasToken = n.getStringValue(); }, "schemaVersion": n => { manifest.schemaVersion = n.getStringValue(); } }); } /** * The deserialization information for the current model * @param ManifestCollectionResponse The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoManifestCollectionResponse(manifestCollectionResponse = {}) { return Object.assign(Object.assign({}, deserializeIntoBaseCollectionPaginationCountResponse(manifestCollectionResponse)), { "value": n => { manifestCollectionResponse.value = n.getCollectionOfObjectValues(createManifestFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @param Operation The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoOperation(operation = {}) { return Object.assign(Object.assign({}, deserializeIntoEntity(operation)), { "createdDateTime": n => { operation.createdDateTime = n.getDateValue(); }, "lastActionDateTime": n => { operation.lastActionDateTime = n.getDateValue(); }, "status": n => { operation.status = n.getEnumValue(LongRunningOperationStatusObject); } }); } /** * The deserialization information for the current model * @param OperationCollectionResponse The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoOperationCollectionResponse(operationCollectionResponse = {}) { return Object.assign(Object.assign({}, deserializeIntoBaseCollectionPaginationCountResponse(operationCollectionResponse)), { "value": n => { operationCollectionResponse.value = n.getCollectionOfObjectValues(createOperationFromDiscriminatorValue); } }); } /** * The deserialization information for the current model * @param RunningOperation The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoRunningOperation(runningOperation = {}) { return Object.assign({}, deserializeIntoOperation(runningOperation)); } /** * The deserialization information for the current model * @param UnbilledReconciliation The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoUnbilledReconciliation(unbilledReconciliation = {}) { return Object.assign({}, deserializeIntoEntity(unbilledReconciliation)); } /** * The deserialization information for the current model * @param UnbilledUsage The instance to deserialize into. * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoUnbilledUsage(unbilledUsage = {}) { return Object.assign({}, deserializeIntoEntity(unbilledUsage)); } /** * Serializes information the current object * @param AzureUsage 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 serializeAzureUsage(writer, azureUsage = {}, isSerializingDerivedType = false) { if (!azureUsage || isSerializingDerivedType) { return; } serializeEntity(writer, azureUsage, isSerializingDerivedType); writer.writeObjectValue("billed", azureUsage.billed, serializeBilledUsage); writer.writeObjectValue("unbilled", azureUsage.unbilled, serializeUnbilledUsage); } /** * Serializes information the current object * @param BilledReconciliation 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 serializeBilledReconciliation(writer, billedReconciliation = {}, isSerializingDerivedType = false) { if (!billedReconciliation || isSerializingDerivedType) { return; } serializeEntity(writer, billedReconciliation, isSerializingDerivedType); } /** * Serializes information the current object * @param BilledUsage 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 serializeBilledUsage(writer, billedUsage = {}, isSerializingDerivedType = false) { if (!billedUsage || isSerializingDerivedType) { return; } serializeEntity(writer, billedUsage, isSerializingDerivedType); } /** * Serializes information the current object * @param Billing 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 serializeBilling(writer, billing = {}, isSerializingDerivedType = false) { if (!billing || isSerializingDerivedType) { return; } serializeEntity(writer, billing, isSerializingDerivedType); writer.writeCollectionOfObjectValues("manifests", billing.manifests, serializeManifest); writer.writeCollectionOfObjectValues("operations", billing.operations, serializeOperation); writer.writeObjectValue("reconciliation", billing.reconciliation, serializeBillingReconciliation); writer.writeObjectValue("usage", billing.usage, serializeAzureUsage); } /** * Serializes information the current object * @param BillingReconciliation 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 serializeBillingReconciliation(writer, billingReconciliation = {}, isSerializingDerivedType = false) { if (!billingReconciliation || isSerializingDerivedType) { return; } serializeEntity(writer, billingReconciliation, isSerializingDerivedType); writer.writeObjectValue("billed", billingReconciliation.billed, serializeBilledReconciliation); writer.writeObjectValue("unbilled", billingReconciliation.unbilled, serializeUnbilledReconciliation); } /** * Serializes information the current object * @param Blob 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 serializeBlob(writer, blob = {}, isSerializingDerivedType = false) { if (!blob || isSerializingDerivedType) { return; } writer.writeStringValue("name", blob.name); writer.writeStringValue("@odata.type", blob.odataType); writer.writeStringValue("partitionValue", blob.partitionValue); writer.writeAdditionalData(blob.additionalData); } /** * Serializes information the current object * @param ExportSuccessOperation 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 serializeExportSuccessOperation(writer, exportSuccessOperation = {}, isSerializingDerivedType = false) { if (!exportSuccessOperation || isSerializingDerivedType) { return; } serializeOperation(writer, exportSuccessOperation, isSerializingDerivedType); writer.writeObjectValue("resourceLocation", exportSuccessOperation.resourceLocation, serializeManifest); } /** * Serializes information the current object * @param FailedOperation 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 serializeFailedOperation(writer, failedOperation = {}, isSerializingDerivedType = false) { if (!failedOperation || isSerializingDerivedType) { return; } serializeOperation(writer, failedOperation, isSerializingDerivedType); writer.writeObjectValue("error", failedOperation.errorEscaped, serializePublicError); } /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param Manifest The instance to serialize from. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeManifest(writer, manifest = {}, isSerializingDerivedType = false) { if (!manifest || isSerializingDerivedType) { return; } serializeEntity(writer, manifest, isSerializingDerivedType); writer.writeNumberValue("blobCount", manifest.blobCount); writer.writeCollectionOfObjectValues("blobs", manifest.blobs, serializeBlob); writer.writeDateValue("createdDateTime", manifest.createdDateTime); writer.writeStringValue("dataFormat", manifest.dataFormat); writer.writeStringValue("eTag", manifest.eTag); writer.writeStringValue("partitionType", manifest.partitionType); writer.writeStringValue("partnerTenantId", manifest.partnerTenantId); writer.writeStringValue("rootDirectory", manifest.rootDirectory); writer.writeStringValue("sasToken", manifest.sasToken); writer.writeStringValue("schemaVersion", manifest.schemaVersion); } /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param ManifestCollectionResponse The instance to serialize from. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeManifestCollectionResponse(writer, manifestCollectionResponse = {}, isSerializingDerivedType = false) { if (!manifestCollectionResponse || isSerializingDerivedType) { return; } serializeBaseCollectionPaginationCountResponse(writer, manifestCollectionResponse, isSerializingDerivedType); writer.writeCollectionOfObjectValues("value", manifestCollectionResponse.value, serializeManifest); } /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param Operation The instance to serialize from. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeOperation(writer, operation = {}, isSerializingDerivedType = false) { if (!operation || isSerializingDerivedType) { return; } serializeEntity(writer, operation, isSerializingDerivedType); writer.writeDateValue("createdDateTime", operation.createdDateTime); writer.writeDateValue("lastActionDateTime", operation.lastActionDateTime); writer.writeEnumValue("status", operation.status); switch (operation.odataType) { case "#microsoft.graph.partners.billing.exportSuccessOperation": serializeExportSuccessOperation(writer, operation, true); break; case "#microsoft.graph.partners.billing.failedOperation": serializeFailedOperation(writer, operation, true); break; case "#microsoft.graph.partners.billing.runningOperation": serializeRunningOperation(writer, operation, true); break; } } /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param OperationCollectionResponse The instance to serialize from. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeOperationCollectionResponse(writer, operationCollectionResponse = {}, isSerializingDerivedType = false) { if (!operationCollectionResponse || isSerializingDerivedType) { return; } serializeBaseCollectionPaginationCountResponse(writer, operationCollectionResponse, isSerializingDerivedType); writer.writeCollectionOfObjectValues("value", operationCollectionResponse.value, serializeOperation); } /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param RunningOperation The instance to serialize from. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeRunningOperation(writer, runningOperation = {}, isSerializingDerivedType = false) { if (!runningOperation || isSerializingDerivedType) { return; } serializeOperation(writer, runningOperation, isSerializingDerivedType); } /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param UnbilledReconciliation The instance to serialize from. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeUnbilledReconciliation(writer, unbilledReconciliation = {}, isSerializingDerivedType = false) { if (!unbilledReconciliation || isSerializingDerivedType) { return; } serializeEntity(writer, unbilledReconciliation, isSerializingDerivedType); } /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. * @param UnbilledUsage The instance to serialize from. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeUnbilledUsage(writer, unbilledUsage = {}, isSerializingDerivedType = false) { if (!unbilledUsage || isSerializingDerivedType) { return; } serializeEntity(writer, unbilledUsage, isSerializingDerivedType); } export const AttributeSetObject = { Full: "full", Basic: "basic", UnknownFutureValue: "unknownFutureValue", }; export const BillingPeriodObject = { Current: "current", Last: "last", UnknownFutureValue: "unknownFutureValue", }; /* tslint:enable */ /* eslint-enable */ //# sourceMappingURL=index.js.map