/* Ċ Ġ* ĠCopyright ĠOpen Search ĠContributors Ċ Ġ* ĠSPDX - License - Identifier : ĠApache - 2 . 0 Ċ Ġ*/ Ċ Ċ package Ġorg . opense arch . index management . rollup Ċ Ċ import Ġorg . opense arch . common . x content . To X Content Ċ import Ġorg . opense arch . common . x content . X Content Factory Ċ import Ġorg . opense arch . index . query . Term QueryBuilder Ċ import Ġorg . opense arch . index management . common . model . dimension . Date Histogram Ċ import Ġorg . opense arch . index management . common . model . dimension . Dimension Ċ import Ġorg . opense arch . index management . common . model . dimension . Histogram Ċ import Ġorg . opense arch . index management . common . model . dimension . Terms Ċ import Ġorg . opense arch . index management . opense arch api . string Ċ import Ġorg . opense arch . index management . random Instant Ċ import Ġorg . opense arch . index management . random Schedule Ċ import Ġorg . opense arch . index management . random User Ċ import Ġorg . opense arch . index management . rollup . action filter . IS M Field Capabilities Ċ import Ġorg . opense arch . index management . rollup . action filter . IS M Field Capabilities Index Response Ċ import Ġorg . opense arch . index management . rollup . action filter . IS M Field Capabilities Response Ċ import Ġorg . opense arch . index management . rollup . action filter . IS M Index Field Capabilities Ċ import Ġorg . opense arch . index management . rollup . model . Continuous Metadata Ċ import Ġorg . opense arch . index management . rollup . model . Explain Roll up Ċ import Ġorg . opense arch . index management . rollup . model . IS MR oll up Ċ import Ġorg . opense arch . index management . rollup . model . Roll up Ċ import Ġorg . opense arch . index management . rollup . model . Roll up Metadata Ċ import Ġorg . opense arch . index management . rollup . model . Roll up Metrics Ċ import Ġorg . opense arch . index management . rollup . model . Roll up Stats Ċ import Ġorg . opense arch . index management . rollup . model . metric . Average Ċ import Ġorg . opense arch . index management . rollup . model . metric . Max Ċ import Ġorg . opense arch . index management . rollup . model . metric . Metric Ċ import Ġorg . opense arch . index management . rollup . model . metric . Min Ċ import Ġorg . opense arch . index management . rollup . model . metric . Sum Ċ import Ġorg . opense arch . index management . rollup . model . metric . Value Count Ċ import Ġorg . opense arch . test . rest . Open Search Rest TestCase Ċ import Ġjava . util . Locale Ċ Ċ fun Ġrandom Interval (): ĠString Ġ= Ġif Ġ( Open Search Rest TestCase . random Boolean ()) Ġrandom Fixed Interval () Ġelse Ġrandom Calendar Interval () Ċ Ċ fun Ġrandom Calendar Interval (): ĠString Ġ= Ġ" 1 d " Ċ Ċ fun Ġrandom Fixed Interval (): ĠString Ġ= Ġ" 3 0 m " Ċ Ċ fun Ġrandom Fixed Date Histogram (): ĠDate Histogram Ġ= ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ). let Ġ{ ĊĠĠĠ ĠDate Histogram ( source Field Ġ= Ġit , Ġtarget Field Ġ= Ġit , Ġfixed Interval Ġ= Ġrandom Fixed Interval (), Ġcalendar Interval Ġ= Ġnull , Ġtimezone Ġ= ĠOpen Search Rest TestCase . random Zone ()) Ċ } Ċ fun Ġrandom Calendar Date Histogram (): ĠDate Histogram Ġ= ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ). let Ġ{ ĊĠĠĠ ĠDate Histogram ( source Field Ġ= Ġit , Ġtarget Field Ġ= Ġit , Ġfixed Interval Ġ= Ġnull , Ġcalendar Interval Ġ= Ġrandom Calendar Interval (), Ġtimezone Ġ= ĠOpen Search Rest TestCase . random Zone ()) Ċ } Ċ Ċ fun Ġrandom Date Histogram (): ĠDate Histogram Ġ= Ġif Ġ( Open Search Rest TestCase . random Boolean ()) Ġrandom Fixed Date Histogram () Ġelse Ġrandom Calendar Date Histogram () Ċ Ċ fun Ġrandom Histogram (): ĠHistogram Ġ= ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ). let Ġ{ ĊĠĠĠ ĠHistogram ( ĊĠĠĠĠĠĠĠ Ġsource Field Ġ= Ġit , ĊĠĠĠĠĠĠĠ Ġtarget Field Ġ= Ġit , ĊĠĠĠĠĠĠĠ Ġinterval Ġ= ĠOpen Search Rest TestCase . random Double Between ( 0 . 0 , ĠDouble . MAX _ VALUE , Ġfalse ) Ġ// Ġstart , Ġend , Ġlower Inclusive ĊĠĠĠ Ġ) Ċ } Ċ Ċ fun Ġrandom Terms (): ĠTerms Ġ= ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ). let Ġ{ ĠTerms ( source Field Ġ= Ġit , Ġtarget Field Ġ= Ġit ) Ġ} Ċ Ċ fun Ġrandom Average (): ĠAverage Ġ= ĠAverage () Ċ Ċ fun Ġrandom Max (): ĠMax Ġ= ĠMax () Ċ Ċ fun Ġrandom Min (): ĠMin Ġ= ĠMin () Ċ Ċ fun Ġrandom Sum (): ĠSum Ġ= ĠSum () Ċ Ċ fun Ġrandom Value Count (): ĠValue Count Ġ= ĠValue Count () Ċ Ċ val Ġmetrics Ġ= ĠlistOf ( random Average (), Ġrandom Max (), Ġrandom Min (), Ġrandom Sum (), Ġrandom Value Count ()) Ċ Ċ fun Ġrandom Metric (): ĠMetric Ġ= ĊĠĠĠ ĠOpen Search Rest TestCase . random Subset Of ( 1 , Ġmetrics ). first () Ċ Ċ fun Ġrandom Metrics (): ĠList < Metric > Ġ= ĊĠĠĠ ĠOpen Search Rest TestCase . random List ( 1 , Ġmetrics . size , Ġ:: random Metric ). distinct By Ġ{ Ġit . type Ġ} Ċ Ċ fun Ġrandom Roll up Metrics (): ĠRoll up Metrics Ġ= ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ). let Ġ{ ĊĠĠĠ ĠRoll up Metrics ( source Field Ġ= Ġit , Ġtarget Field Ġ= Ġit , Ġmetrics Ġ= Ġrandom Metrics ()) Ċ } Ċ Ċ fun Ġrandom Roll up Dimensions (): ĠList < Dimension > Ġ{ ĊĠĠĠ Ġval Ġdimensions Ġ= Ġmutable ListOf < Dimension >( random Date Histogram ()) ĊĠĠĠ Ġfor Ġ( i Ġin Ġ 0 .. Open Search Rest TestCase . random Int ( 1 0 )) Ġ{ ĊĠĠĠĠĠĠĠ Ġdimensions . add ( if Ġ( Open Search Rest TestCase . random Boolean ()) Ġrandom Terms () Ġelse Ġrandom Histogram ()) ĊĠĠĠ Ġ} ĊĠĠĠ Ġreturn Ġdimensions . toList () Ċ } Ċ Ċ fun Ġrandom Roll up (): ĠRoll up Ġ{ ĊĠĠĠ Ġval Ġenabled Ġ= ĠOpen Search Rest TestCase . random Boolean () ĊĠĠĠ Ġreturn ĠRoll up ( ĊĠĠĠĠĠĠĠ Ġid Ġ= ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ), ĊĠĠĠĠĠĠĠ Ġseq No Ġ= ĠOpen Search Rest TestCase . random Non Negative Long (), ĊĠĠĠĠĠĠĠ Ġprimary Term Ġ= ĠOpen Search Rest TestCase . random Non Negative Long (), ĊĠĠĠĠĠĠĠ Ġenabled Ġ= Ġenabled , ĊĠĠĠĠĠĠĠ Ġschema Version Ġ= ĠOpen Search Rest TestCase . random Long Between ( 1 , Ġ 1 0 0 0 ), ĊĠĠĠĠĠĠĠ Ġjob Schedule Ġ= Ġrandom Schedule (), ĊĠĠĠĠĠĠĠ Ġjob Last Updated Time Ġ= Ġrandom Instant (), ĊĠĠĠĠĠĠĠ Ġjob Enabled Time Ġ= Ġif Ġ( enabled ) Ġrandom Instant () Ġelse Ġnull , ĊĠĠĠĠĠĠĠ Ġdescription Ġ= ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ), ĊĠĠĠĠĠĠĠ Ġsource Index Ġ= ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ). toLowerCase ( Locale . ROOT ), ĊĠĠĠĠĠĠĠ Ġtarget Index Ġ= ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ). toLowerCase ( Locale . ROOT ), ĊĠĠĠĠĠĠĠ Ġmetadata ID Ġ= Ġif Ġ( Open Search Rest TestCase . random Boolean ()) Ġnull Ġelse ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ), ĊĠĠĠĠĠĠĠ Ġroles Ġ= ĠOpen Search Rest TestCase . random List ( 1 0 ) Ġ{ ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ) Ġ}, ĊĠĠĠĠĠĠĠ ĠpageSize Ġ= ĠOpen Search Rest TestCase . random Int Between ( 1 , Ġ 1 0 0 0 0 ), ĊĠĠĠĠĠĠĠ Ġdelay Ġ= Ġ 0 , ĊĠĠĠĠĠĠĠ Ġcontinuous Ġ= ĠOpen Search Rest TestCase . random Boolean (), ĊĠĠĠĠĠĠĠ Ġdimensions Ġ= Ġrandom Roll up Dimensions (), ĊĠĠĠĠĠĠĠ Ġmetrics Ġ= ĠOpen Search Rest TestCase . random List ( 2 0 , Ġ:: random Roll up Metrics ). distinct By Ġ{ Ġit . target Field Ġ}, ĊĠĠĠĠĠĠĠ Ġuser Ġ= Ġrandom User () ĊĠĠĠ Ġ) Ċ } Ċ Ċ fun Ġrandom Roll up Stats (): ĠRoll up Stats Ġ{ ĊĠĠĠ Ġreturn ĠRoll up Stats ( ĊĠĠĠĠĠĠĠ Ġpages Processed Ġ= ĠOpen Search Rest TestCase . random Non Negative Long (), ĊĠĠĠĠĠĠĠ Ġdocuments Processed Ġ= ĠOpen Search Rest TestCase . random Non Negative Long (), ĊĠĠĠĠĠĠĠ Ġroll ups Indexed Ġ= ĠOpen Search Rest TestCase . random Non Negative Long (), ĊĠĠĠĠĠĠĠ Ġindex TimeIn Millis Ġ= ĠOpen Search Rest TestCase . random Non Negative Long (), ĊĠĠĠĠĠĠĠ Ġsearch TimeIn Millis Ġ= ĠOpen Search Rest TestCase . random Non Negative Long () ĊĠĠĠ Ġ) Ċ } Ċ Ċ fun Ġrandom Roll up Metadata Status (): ĠRoll up Metadata . Status Ġ{ ĊĠĠĠ Ġreturn ĠOpen Search Rest TestCase . random From ( Roll up Metadata . Status . values (). toList ()) Ċ } Ċ Ċ fun Ġrandom Continuous Metadata (): ĠContinuous Metadata Ġ{ ĊĠĠĠ Ġval Ġone Ġ= Ġrandom Instant () ĊĠĠĠ Ġval Ġtwo Ġ= Ġrandom Instant () ĊĠĠĠ Ġreturn ĠContinuous Metadata ( ĊĠĠĠĠĠĠĠ Ġnext Window EndTime Ġ= Ġif Ġ( one . is After ( two )) Ġone Ġelse Ġtwo , ĊĠĠĠĠĠĠĠ Ġnext Window StartTime Ġ= Ġif Ġ( one . is After ( two )) Ġtwo Ġelse Ġone ĊĠĠĠ Ġ) Ċ } Ċ Ċ fun Ġrandom After Key (): ĠMap < String , ĠAny >? Ġ{ ĊĠĠĠ Ġreturn Ġif Ġ( Open Search Rest TestCase . random Boolean ()) Ġ{ ĊĠĠĠĠĠĠĠ Ġnull ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠ Ġmap Of (" test " Ġto Ġ 1 7 ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ fun Ġrandom Roll up Metadata (): ĠRoll up Metadata Ġ{ ĊĠĠĠ Ġval Ġstatus Ġ= Ġrandom Roll up Metadata Status () ĊĠĠĠ Ġreturn ĠRoll up Metadata ( ĊĠĠĠĠĠĠĠ Ġid Ġ= ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ), ĊĠĠĠĠĠĠĠ Ġseq No Ġ= ĠOpen Search Rest TestCase . random Non Negative Long (), ĊĠĠĠĠĠĠĠ Ġprimary Term Ġ= ĠOpen Search Rest TestCase . random Non Negative Long (), ĊĠĠĠĠĠĠĠ Ġroll up ID Ġ= ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ), ĊĠĠĠĠĠĠĠ Ġafter Key Ġ= Ġrandom After Key (), ĊĠĠĠĠĠĠĠ Ġlast Updated Time Ġ= Ġrandom Instant (), ĊĠĠĠĠĠĠĠ Ġcontinuous Ġ= Ġrandom Continuous Metadata (), ĊĠĠĠĠĠĠĠ Ġstatus Ġ= Ġstatus , ĊĠĠĠĠĠĠĠ Ġfailure Reason Ġ= Ġif Ġ( status Ġ== ĠRoll up Metadata . Status . FAILED ) ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ) Ġelse Ġnull , ĊĠĠĠĠĠĠĠ Ġstats Ġ= Ġrandom Roll up Stats () ĊĠĠĠ Ġ) Ċ } Ċ Ċ fun Ġrandom Explain Roll up (): ĠEx plain Roll up Ġ{ ĊĠĠĠ Ġval Ġmetadata Ġ= Ġrandom Roll up Metadata () ĊĠĠĠ Ġreturn ĠEx plain Roll up ( metadata ID Ġ= Ġmetadata . id , Ġmetadata Ġ= Ġmetadata ) Ċ } Ċ Ċ fun Ġrandom IS MR oll up (): ĠIS MR oll up Ġ{ ĊĠĠĠ Ġreturn ĠIS MR oll up ( ĊĠĠĠĠĠĠĠ Ġdescription Ġ= ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ), ĊĠĠĠĠĠĠĠ Ġtarget Index Ġ= ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ). toLowerCase ( Locale . ROOT ), ĊĠĠĠĠĠĠĠ ĠpageSize Ġ= ĠOpen Search Rest TestCase . random Int Between ( 1 , Ġ 1 0 0 0 0 ), ĊĠĠĠĠĠĠĠ Ġdimensions Ġ= Ġrandom Roll up Dimensions (), ĊĠĠĠĠĠĠĠ Ġmetrics Ġ= ĠOpen Search Rest TestCase . random List ( 2 0 , Ġ:: random Roll up Metrics ). distinct By Ġ{ Ġit . target Field Ġ} ĊĠĠĠ Ġ) Ċ } Ċ Ċ fun Ġrandom IS M Field Capabilities (): ĠIS M Field Capabilities Ġ{ ĊĠĠĠ Ġreturn ĠIS M Field Capabilities ( ĊĠĠĠĠĠĠĠ Ġname Ġ= ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ), ĊĠĠĠĠĠĠĠ Ġtype Ġ= ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ), ĊĠĠĠĠĠĠĠ Ġis Search able Ġ= ĠOpen Search Rest TestCase . random Boolean (), ĊĠĠĠĠĠĠĠ Ġis Ag greg atable Ġ= ĠOpen Search Rest TestCase . random Boolean (), ĊĠĠĠĠĠĠĠ Ġindices Ġ= ĠOpen Search Rest TestCase . generate Random String Array ( 1 0 , Ġ 1 0 , Ġtrue , Ġtrue ), ĊĠĠĠĠĠĠĠ Ġnon Search able Indices Ġ= ĠOpen Search Rest TestCase . generate Random String Array ( 1 0 , Ġ 1 0 , Ġtrue , Ġtrue ), ĊĠĠĠĠĠĠĠ Ġnon Ag greg atable Indices Ġ= ĠOpen Search Rest TestCase . generate Random String Array ( 1 0 , Ġ 1 0 , Ġtrue , Ġtrue ), ĊĠĠĠĠĠĠĠ Ġmeta Ġ= Ġmap Of ( Open Search Rest TestCase . random Alpha Of Length ( 1 0 ) Ġto Ġset Of ( Open Search Rest TestCase . random Alpha Of Length ( 1 0 ))) ĊĠĠĠ Ġ) Ċ } Ċ Ċ fun Ġrandom IS M Index Field Capabilities (): ĠIS M Index Field Capabilities Ġ{ ĊĠĠĠ Ġreturn ĠIS M Index Field Capabilities ( ĊĠĠĠĠĠĠĠ Ġname Ġ= ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ), ĊĠĠĠĠĠĠĠ Ġtype Ġ= ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ), ĊĠĠĠĠĠĠĠ Ġis Search able Ġ= ĠOpen Search Rest TestCase . random Boolean (), ĊĠĠĠĠĠĠĠ Ġis Ag greg atable Ġ= ĠOpen Search Rest TestCase . random Boolean (), ĊĠĠĠĠĠĠĠ Ġmeta Ġ= Ġmap Of ( Open Search Rest TestCase . random Alpha Of Length ( 1 0 ) Ġto ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 )) ĊĠĠĠ Ġ) Ċ } Ċ Ċ fun Ġrandom IS M Field Capabilities Index Response (): ĠIS M Field Capabilities Index Response Ġ{ ĊĠĠĠ Ġreturn ĠIS M Field Capabilities Index Response ( ĊĠĠĠĠĠĠĠ Ġindex Name Ġ= ĠOpen Search Rest TestCase . random Alpha Of Length ( 1 0 ), ĊĠĠĠĠĠĠĠ Ġresponse Map Ġ= Ġmap Of ( Open Search Rest TestCase . random Alpha Of Length ( 1 0 ) Ġto Ġrandom IS M Index Field Capabilities ()), ĊĠĠĠĠĠĠĠ Ġcan Match Ġ= ĠOpen Search Rest TestCase . random Boolean () ĊĠĠĠ Ġ) Ċ } Ċ Ċ fun Ġrandom IS M Field Caps (): ĠIS M Field Capabilities Response Ġ{ ĊĠĠĠ Ġreturn ĠIS M Field Capabilities Response ( ĊĠĠĠĠĠĠĠ Ġindices Ġ= ĠOpen Search Rest TestCase . generate Random String Array ( 1 0 , Ġ 1 0 , Ġfalse ), ĊĠĠĠĠĠĠĠ Ġresponse Map Ġ= Ġmap Of ( Open Search Rest TestCase . random Alpha Of Length ( 1 0 ) Ġto Ġmap Of ( Open Search Rest TestCase . random Alpha Of Length ( 1 0 ) Ġto Ġrandom IS M Field Capabilities ())), ĊĠĠĠĠĠĠĠ Ġindex Responses Ġ= ĠOpen Search Rest TestCase . random List ( 4 , Ġ:: random IS M Field Capabilities Index Response ) ĊĠĠĠ Ġ) Ċ } Ċ Ċ fun Ġrandom Dimension (): ĠDimension Ġ{ ĊĠĠĠ Ġval Ġdimensions Ġ= ĠlistOf ( random Terms (), Ġrandom Histogram (), Ġrandom Date Histogram ()) ĊĠĠĠ Ġreturn ĠOpen Search Rest TestCase . random Subset Of ( 1 , Ġdimensions ). first () Ċ } Ċ Ċ fun Ġrandom Term Query (): ĠTerm QueryBuilder Ġ{ Ġreturn ĠTerm QueryBuilder ( Open Search Rest TestCase . random Alpha Of Length ( 5 ), ĠOpen Search Rest TestCase . random Alpha Of Length ( 5 )) Ġ} Ċ Ċ fun ĠDate Histogram . toJson String (): ĠString Ġ= Ġthis . to X Content ( X Content Factory . json Builder (), ĠTo X Content . EMPTY _ PARAMS ). string () Ċ Ċ fun ĠHistogram . toJson String (): ĠString Ġ= Ġthis . to X Content ( X Content Factory . json Builder (), ĠTo X Content . EMPTY _ PARAMS ). string () Ċ Ċ fun ĠTerms . toJson String (): ĠString Ġ= Ġthis . to X Content ( X Content Factory . json Builder (), ĠTo X Content . EMPTY _ PARAMS ). string () Ċ Ċ fun ĠAverage . toJson String (): ĠString Ġ= Ġthis . to X Content ( X Content Factory . json Builder (), ĠTo X Content . EMPTY _ PARAMS ). string () Ċ Ċ fun ĠMax . toJson String (): ĠString Ġ= Ġthis . to X Content ( X Content Factory . json Builder (), ĠTo X Content . EMPTY _ PARAMS ). string () Ċ Ċ fun ĠMin . toJson String (): ĠString Ġ= Ġthis . to X Content ( X Content Factory . json Builder (), ĠTo X Content . EMPTY _ PARAMS ). string () Ċ Ċ fun ĠSum . toJson String (): ĠString Ġ= Ġthis . to X Content ( X Content Factory . json Builder (), ĠTo X Content . EMPTY _ PARAMS ). string () Ċ Ċ fun ĠValue Count . toJson String (): ĠString Ġ= Ġthis . to X Content ( X Content Factory . json Builder (), ĠTo X Content . EMPTY _ PARAMS ). string () Ċ Ċ fun ĠRoll up Metrics . toJson String (): ĠString Ġ= Ġthis . to X Content ( X Content Factory . json Builder (), ĠTo X Content . EMPTY _ PARAMS ). string () Ċ Ċ fun ĠRoll up . toJson String ( params : ĠTo X Content . Params Ġ= ĠTo X Content . EMPTY _ PARAMS ): ĠString Ġ= Ġthis . to X Content ( X Content Factory . json Builder (), Ġparams ). string () Ċ Ċ fun ĠRoll up Metadata . toJson String ( params : ĠTo X Content . Params Ġ= ĠTo X Content . EMPTY _ PARAMS ): ĠString Ġ= Ġthis . to X Content ( X Content Factory . json Builder (), Ġparams ). string () Ċ Ċ fun ĠIS MR oll up . toJson String ( params : ĠTo X Content . Params Ġ= ĠTo X Content . EMPTY _ PARAMS ): ĠString Ġ= Ġthis . to X Content ( X Content Factory . json Builder (), Ġparams ). string () Ċ