Represents a response to a retrieve request within a batch request.

interface ReadResponse<DeSerializersT> {
    as: (<EntityT>(entityApi) => EntityT[]);
    body: Record<string, any>;
    httpCode: number;
    isError: (() => this is ErrorResponse);
    isReadResponse: (() => this is ReadResponse<DeSerializersT>);
    isSuccess: (() => this is ReadResponse<DeSerializersT> | WriteResponses<DeSerializersT>);
    isWriteResponses: (() => this is WriteResponses<DeSerializersT>);
    responseType: "ReadResponse";
    type: EntityApi<EntityBase, DeSerializersT>;
}

Type Parameters

  • DeSerializersT extends DeSerializers

    Type of the (de-)serializers.

Hierarchy

Properties

as: (<EntityT>(entityApi) => EntityT[])

Transform the raw data into an instance of an entity represented by the given entity API. Note, this method transforms the raw data to an array of entities, even if the original request was a GetByKeyRequestBuilder.

Type declaration

body: Record<string, any>

HTTP raw body.

httpCode: number

HTTP response status code.

isError: (() => this is ErrorResponse)

Type declaration

isReadResponse: (() => this is ReadResponse<DeSerializersT>)

Type declaration

isWriteResponses: (() => this is WriteResponses<DeSerializersT>)

Type declaration

responseType: "ReadResponse"

Tag for identifying the type of a batch response.

EntityApi of the response data. Can be undefined for function/action imports or not mappable entities.

Copyright Ⓒ 2024 SAP SE or an SAP affiliate company. All rights reserved.