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

interface ReadResponse<DeSerializersT extends DeSerializers> {
    as: <EntityT extends EntityBase>(
        entityApi: EntityApi<EntityT, DeSerializersT>,
    ) => 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 extends EntityBase>(
    entityApi: EntityApi<EntityT, DeSerializersT>,
) => 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.

body: Record<string, any>

HTTP raw body.

httpCode: number

HTTP response status code.

isError: () => this is ErrorResponse
isReadResponse: () => this is ReadResponse<DeSerializersT>
isWriteResponses: () => this is WriteResponses<DeSerializersT>
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.