UNPKG

@microsoft/msgraph-sdk

Version:
444 lines 19.3 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 {UnbilledUsage} */ // @ts-ignore export function createUnbilledUsageFromDiscriminatorValue(parseNode) { return deserializeIntoUnbilledUsage; } /** * The deserialization information for the current model * @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 * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoBilledReconciliation(billedReconciliation = {}) { return Object.assign({}, deserializeIntoEntity(billedReconciliation)); } /** * The deserialization information for the current model * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoBilledUsage(billedUsage = {}) { return Object.assign({}, deserializeIntoEntity(billedUsage)); } /** * The deserialization information for the current model * @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 * @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); } }); } /** * The deserialization information for the current model * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoRunningOperation(runningOperation = {}) { return Object.assign({}, deserializeIntoOperation(runningOperation)); } /** * The deserialization information for the current model * @returns {Record<string, (node: ParseNode) => void>} */ // @ts-ignore export function deserializeIntoUnbilledUsage(unbilledUsage = {}) { return Object.assign({}, deserializeIntoEntity(unbilledUsage)); } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeAzureUsage(writer, azureUsage = {}) { if (azureUsage) { serializeEntity(writer, azureUsage); writer.writeObjectValue("billed", azureUsage.billed, serializeBilledUsage); writer.writeObjectValue("unbilled", azureUsage.unbilled, serializeUnbilledUsage); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeBilledReconciliation(writer, billedReconciliation = {}) { if (billedReconciliation) { serializeEntity(writer, billedReconciliation); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeBilledUsage(writer, billedUsage = {}) { if (billedUsage) { serializeEntity(writer, billedUsage); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeBilling(writer, billing = {}) { if (billing) { serializeEntity(writer, billing); 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 writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeBillingReconciliation(writer, billingReconciliation = {}) { if (billingReconciliation) { serializeEntity(writer, billingReconciliation); writer.writeObjectValue("billed", billingReconciliation.billed, serializeBilledReconciliation); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeBlob(writer, blob = {}) { if (blob) { 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 writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeExportSuccessOperation(writer, exportSuccessOperation = {}) { if (exportSuccessOperation) { serializeOperation(writer, exportSuccessOperation); writer.writeObjectValue("resourceLocation", exportSuccessOperation.resourceLocation, serializeManifest); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeFailedOperation(writer, failedOperation = {}) { if (failedOperation) { serializeOperation(writer, failedOperation); writer.writeObjectValue("error", failedOperation.errorEscaped, serializePublicError); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeManifest(writer, manifest = {}) { if (manifest) { serializeEntity(writer, manifest); 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 writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeManifestCollectionResponse(writer, manifestCollectionResponse = {}) { if (manifestCollectionResponse) { serializeBaseCollectionPaginationCountResponse(writer, manifestCollectionResponse); writer.writeCollectionOfObjectValues("value", manifestCollectionResponse.value, serializeManifest); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeOperation(writer, operation = {}) { if (operation) { serializeEntity(writer, operation); writer.writeDateValue("createdDateTime", operation.createdDateTime); writer.writeDateValue("lastActionDateTime", operation.lastActionDateTime); writer.writeEnumValue("status", operation.status); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeOperationCollectionResponse(writer, operationCollectionResponse = {}) { if (operationCollectionResponse) { serializeBaseCollectionPaginationCountResponse(writer, operationCollectionResponse); writer.writeCollectionOfObjectValues("value", operationCollectionResponse.value, serializeOperation); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeRunningOperation(writer, runningOperation = {}) { if (runningOperation) { serializeOperation(writer, runningOperation); } } /** * Serializes information the current object * @param writer Serialization writer to use to serialize this model */ // @ts-ignore export function serializeUnbilledUsage(writer, unbilledUsage = {}) { if (unbilledUsage) { serializeEntity(writer, unbilledUsage); } } 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