import { Contracts } from '../../contracts' ; import { IDeliveryClientConfig } from '../../config' ; import { Filters , IContentItem , IItemQueryConfig , IDeliveryNetworkResponse , Responses , Parameters } from '../../models' ; import { QueryService } from '../../services' ; import { BaseListingQuery } from '../common/base-listing-query.class' ; export class MultipleItemsQuery < TContentItem extends IContentItem = IContentItem > extends BaseListingQuery < Responses . IListContentItemsResponse < TContentItem > , Responses . IListContentItemsAllResponse < TContentItem > , IItemQueryConfig , Contracts . IListContentItemsContract > { constructor ( protected config , protected queryService ) { super ( config , queryService ) ; } /**
     * Adds information about the total number of content items matching your query.
     * When set to true, the pagination object returned in the API response contains
     * an additional total_count property.
     */ includeTotalCountParameter ( ) { this . parameters . push ( new Parameters . IncludeTotalCountParameter ( ) ) ; return this ; } param type type ( type ) { this . parameters . push ( new Filters . TypeFilter ( type ) ) ; return this ; } param types types ( types ) { this . parameters . push ( new Filters . TypeFilter ( types ) ) ; return this ; } param collection collection ( collection ) { this . parameters . push ( new Filters . CollectionFilter ( collection ) ) ; return this ; } param collections collections ( collections ) { this . parameters . push ( new Filters . CollectionFilter ( collections ) ) ; return this ; } param depth depthParameter ( depth ) { this . parameters . push ( new Parameters . DepthParameter ( depth ) ) ; return this ; } param languageCodename languageParameter ( languageCodename ) { this . parameters . push ( new Parameters . LanguageParameter ( languageCodename ) ) ; return this ; } param elementCodenames elementsParameter ( elementCodenames ) { this . parameters . push ( new Parameters . ElementsParameter ( elementCodenames ) ) ; return this ; } toPromise ( ) { return this . queryService . getMultipleItems ( this . getUrl ( ) , this . _queryConfig ?? { } ) ; } getUrl ( ) { const action = '/items' ; this . processDefaultLanguageParameter ( ) ; return super . resolveUrlInternal ( action ) ; } map ( json ) { return this . queryService . mappingService . listContentItemsResponse ( json ) ; } protected allResponseFactory ( items , responses ) { return { items : items , responses : responses } ; } }