import { EntityApi , EntityBase } from '../entity-base' ; import { Selectable } from '../selectable' ; import { Filterable } from '../filter' ; import { Expandable } from '../expandable' ; import { Orderable } from '../order' ; import { ODataUri } from '../uri-conversion' ; import { DeSerializers } from '../de-serializers' ; import { ODataRequestConfig } from './odata-request-config' ; import { WithGetAllRestrictions } from './odata-request-traits' ; typeparam internal export class ODataGetAllRequestConfig < EntityT extends EntityBase , DeSerializersT extends DeSerializers > extends ODataRequestConfig implements WithGetAllRestrictions < EntityT , DeSerializersT > { top : number ; skip : number ; filter : Filterable < EntityT , DeSerializersT > ; orderBy : Orderable < EntityT > [ ] ; selects : Selectable < EntityT , DeSerializersT > [ ] ; expands : Expandable < EntityT , DeSerializersT > [ ] ; param entityApi param oDataUri constructor ( readonly entityApi , private oDataUri ) { super ( 'get' , entityApi . entityConstructor . _defaultServicePath ) ; } resourcePath ( ) { return this . entityApi . entityConstructor . _entityName ; } queryParameters ( ) { const params = { format : 'json' , ... this . oDataUri . getSelect ( this . selects ) , ... this . oDataUri . getExpand ( this . selects , this . expands , this . entityApi ) , ... this . oDataUri . getFilter ( this . filter , this . entityApi ) , ... this . oDataUri . getOrderBy ( this . orderBy ) } ; if ( typeof this . top !== 'undefined' ) { params . top = this . top ; } if ( typeof this . skip !== 'undefined' ) { params . skip = this . skip ; } return this . prependDollarToQueryParameters ( params ) ; } }