2121/** Query for selecting logs analyzed by the historical job. */
2222@ JsonPropertyOrder ({
2323 HistoricalJobQuery .JSON_PROPERTY_AGGREGATION ,
24+ HistoricalJobQuery .JSON_PROPERTY_DATA_SOURCE ,
2425 HistoricalJobQuery .JSON_PROPERTY_DISTINCT_FIELDS ,
2526 HistoricalJobQuery .JSON_PROPERTY_GROUP_BY_FIELDS ,
2627 HistoricalJobQuery .JSON_PROPERTY_HAS_OPTIONAL_GROUP_BY_FIELDS ,
@@ -35,6 +36,10 @@ public class HistoricalJobQuery {
3536 public static final String JSON_PROPERTY_AGGREGATION = "aggregation" ;
3637 private SecurityMonitoringRuleQueryAggregation aggregation ;
3738
39+ public static final String JSON_PROPERTY_DATA_SOURCE = "dataSource" ;
40+ private SecurityMonitoringStandardDataSource dataSource =
41+ SecurityMonitoringStandardDataSource .LOGS ;
42+
3843 public static final String JSON_PROPERTY_DISTINCT_FIELDS = "distinctFields" ;
3944 private List <String > distinctFields = null ;
4045
@@ -79,6 +84,31 @@ public void setAggregation(SecurityMonitoringRuleQueryAggregation aggregation) {
7984 this .aggregation = aggregation ;
8085 }
8186
87+ public HistoricalJobQuery dataSource (SecurityMonitoringStandardDataSource dataSource ) {
88+ this .dataSource = dataSource ;
89+ this .unparsed |= !dataSource .isValid ();
90+ return this ;
91+ }
92+
93+ /**
94+ * Source of events, either logs or audit trail.
95+ *
96+ * @return dataSource
97+ */
98+ @ jakarta .annotation .Nullable
99+ @ JsonProperty (JSON_PROPERTY_DATA_SOURCE )
100+ @ JsonInclude (value = JsonInclude .Include .USE_DEFAULTS )
101+ public SecurityMonitoringStandardDataSource getDataSource () {
102+ return dataSource ;
103+ }
104+
105+ public void setDataSource (SecurityMonitoringStandardDataSource dataSource ) {
106+ if (!dataSource .isValid ()) {
107+ this .unparsed = true ;
108+ }
109+ this .dataSource = dataSource ;
110+ }
111+
82112 public HistoricalJobQuery distinctFields (List <String > distinctFields ) {
83113 this .distinctFields = distinctFields ;
84114 return this ;
@@ -280,6 +310,7 @@ public boolean equals(Object o) {
280310 }
281311 HistoricalJobQuery historicalJobQuery = (HistoricalJobQuery ) o ;
282312 return Objects .equals (this .aggregation , historicalJobQuery .aggregation )
313+ && Objects .equals (this .dataSource , historicalJobQuery .dataSource )
283314 && Objects .equals (this .distinctFields , historicalJobQuery .distinctFields )
284315 && Objects .equals (this .groupByFields , historicalJobQuery .groupByFields )
285316 && Objects .equals (
@@ -294,6 +325,7 @@ public boolean equals(Object o) {
294325 public int hashCode () {
295326 return Objects .hash (
296327 aggregation ,
328+ dataSource ,
297329 distinctFields ,
298330 groupByFields ,
299331 hasOptionalGroupByFields ,
@@ -308,6 +340,7 @@ public String toString() {
308340 StringBuilder sb = new StringBuilder ();
309341 sb .append ("class HistoricalJobQuery {\n " );
310342 sb .append (" aggregation: " ).append (toIndentedString (aggregation )).append ("\n " );
343+ sb .append (" dataSource: " ).append (toIndentedString (dataSource )).append ("\n " );
311344 sb .append (" distinctFields: " ).append (toIndentedString (distinctFields )).append ("\n " );
312345 sb .append (" groupByFields: " ).append (toIndentedString (groupByFields )).append ("\n " );
313346 sb .append (" hasOptionalGroupByFields: " )
0 commit comments