UNPKG

@microsoft/msgraph-sdk-core

Version:
71 lines 3.02 kB
/** * ------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. * See License in the project root for license information. * ------------------------------------------------------------------------------------------- */ /** * @module BatchResponseContent */ import { BatchResponseBody, BatchResponse } from "./BatchRequestStep.js"; import { Parsable, ParsableFactory, ParseNodeFactoryRegistry } from "@microsoft/kiota-abstractions"; /** * @class * Class that handles BatchResponseContent */ export declare class BatchResponseContent { /** * To hold the responses */ private readonly responses; /** * @public * @constructor * Creates the BatchResponseContent instance * @param {BatchResponseBody} response - The response body returned for batch request from server * @returns An instance of a BatchResponseContent */ constructor(response: BatchResponseBody); /** * @private * Updates the Batch response content instance with given responses. * @param {BatchResponseBody} response - The response json representing batch response message * @returns Nothing */ private update; /** * @public * To get the response of a request for a given request id * @param {string} requestId - The request id value * @returns The Response object instance for the particular request */ getResponseById(requestId: string): BatchResponse | undefined; /** * Retrieves a parsable response by request ID. * @template T - The type of the parsable response. * @param {string} requestId - The request ID value. * @param parseNodeFactoryRegistry - The registry to create parse nodes. * @param {ParsableFactory<T>} factory - The factory to create the parsable response. * @returns {T | undefined} The parsable response object instance for the particular request, or undefined if not found. */ getParsableResponseById<T extends Parsable>(requestId: string, parseNodeFactoryRegistry: ParseNodeFactoryRegistry, factory: ParsableFactory<T>): T | undefined; /** * @public * To get all the responses of the batch request * @returns The Map object containing the response objects */ getResponses(): Map<string, BatchResponse>; /** * @public * To get the iterator for the responses * @returns The Iterable generator for the response objects */ getResponsesIterator(): IterableIterator<[string, BatchResponse]>; /** * Retrieves the status codes of all responses in the batch request. * @returns {Promise<Map<string, number>>} A promise that resolves to a map of request IDs to their status codes. * @throws {Error} If a status code is not found for a request ID. */ getResponsesStatusCodes(): Promise<Map<string, number>>; } //# sourceMappingURL=BatchResponseContent.d.ts.map