import { Contracts } from '../../contracts' ; import { IDeliveryClientConfig } from '../../config' ; import { continuationTokenHeaderName , IDeliveryNetworkResponse , ILanguagesQueryConfig , Parameters , Responses } from '../../models' ; import { QueryService } from '../../services' ; import { BaseListingQuery } from '../common/base-listing-query.class' ; export class LanguagesQuery extends BaseListingQuery < Responses . IListLanguagesResponse , Responses . IListLanguagesAllResponse , ILanguagesQueryConfig , Contracts . IListLanguagesContract > { /**
     * Endpoint
     */ protected readonly endpoint : string = 'languages' ; constructor ( protected config , protected queryService ) { super ( config , queryService ) ; } param limit limitParameter ( limit ) { this . parameters . push ( new Parameters . LimitParameter ( limit ) ) ; return this ; } param skip skipParameter ( skip ) { this . parameters . push ( new Parameters . SkipParameter ( skip ) ) ; return this ; } /**
     * Sets continuation token header
     */ withContinuationToken ( token ) { this . withHeaders ( [ { header : continuationTokenHeaderName , value : token } ] ) ; return this ; } toPromise ( ) { return this . queryService . getLanguages ( this . getUrl ( ) , this . _queryConfig ?? { } ) ; } getUrl ( ) { const action = '/' + this . endpoint ; return super . resolveUrlInternal ( action ) ; } param queryConfig queryConfig ( queryConfig ) { this . _queryConfig = queryConfig ; return this ; } map ( json ) { return this . queryService . mappingService . listLanguagesResponse ( json ) ; } protected allResponseFactory ( items , responses ) { return { items : items , responses : responses } ; } }