import { IndustryInsightFilter , IndustryInsightMetric } from '..' ; import IndustryInsightQueries , { IndustryInsightQuery , IndustryInsightValue } from './IndustryInsightQueries' ; export class IndustryInsightsQueryBuilder { private queryObj : IndustryInsightQuery ; constructor ( private queries , query ? ) { this . queryObj = query || { metric : '' } ; } public metric ( metric ) { return this . extendQuery_ ( { metric } ) ; } public industry ( industry ) { return this . extendQuery_ ( { industry } ) ; } public subIndustry ( subIndustry ) { return this . extendQuery_ ( { subindustry : subIndustry } ) ; } public filter ( name , value ) { return this . extendQuery_ ( { [ name ] : value } ) ; } public extendQuery_ ( extensions ) { return new IndustryInsightsQueryBuilder ( this . queries , { ... this . queryObj , ... extensions } ) ; } public query ( ) { return this . queries . metric ( this . queryObj ) ; } public queryObject ( ) { return this . queryObj ; } }