import { ErrorWithCause } from '@sap-cloud-sdk/util' ; import { Destination , DestinationFetchOptions } from '@sap-cloud-sdk/connectivity' ; import { HttpResponse } from '@sap-cloud-sdk/http-client' ; import { EntityApi , EntityBase , EntityIdentifiable } from '../entity-base' ; import { ODataUri } from '../uri-conversion' ; import { ODataDeleteRequestConfig } from '../request' ; import { DeSerializers } from '../de-serializers' ; import { MethodRequestBuilder } from './request-builder-base' ; typeparam internal export abstract class DeleteRequestBuilderBase < EntityT extends EntityBase , DeSerializersT extends DeSerializers > extends MethodRequestBuilder < ODataDeleteRequestConfig < EntityT , DeSerializersT > > implements EntityIdentifiable < EntityT , DeSerializersT > { readonly _entity : EntityT ; readonly _deSerializers : DeSerializersT ; param _entityApi param oDataUri param keysOrEntity constructor ( readonly _entityApi , oDataUri , keysOrEntity ) { super ( new ODataDeleteRequestConfig ( _entityApi , oDataUri ) ) ; if ( keysOrEntity instanceof EntityBase ) { this . requestConfig . keys = oDataUri . getEntityKeys ( keysOrEntity , _entityApi ) ; this . setVersionIdentifier ( keysOrEntity . versionIdentifier ) ; } else { this . requestConfig . keys = keysOrEntity ; } } returns ignoreVersionIdentifier ( ) { this . requestConfig . versionIdentifierIgnored = true ; return this ; } param destination returns async execute ( destination ) { return ( this . executeRaw ( destination ) . then ( ( ) => Promise . resolve ( ) ) . catch ( error => { throw new ErrorWithCause ( 'OData delete request failed!' , error ) ; } ) ) ; } param destination returns async executeRaw ( destination ) { return this . build ( destination ) . then ( request => request . execute ( ) ) ; } abstract setVersionIdentifier ( eTag ) ; }