com.azure.resourcemanager.securityinsights.models.ActivityEntityQuery Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-securityinsights Show documentation
Show all versions of azure-resourcemanager-securityinsights Show documentation
This package contains Microsoft Azure SDK for SecurityInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2022-09.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.securityinsights.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.management.SystemData;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.securityinsights.fluent.models.ActivityEntityQueriesProperties;
import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;
/**
* Represents Activity entity query.
*/
@Fluent
public final class ActivityEntityQuery extends EntityQueryInner {
/*
* the entity query kind
*/
private EntityQueryKind kind = EntityQueryKind.ACTIVITY;
/*
* Activity entity query properties
*/
private ActivityEntityQueriesProperties innerProperties;
/*
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
*/
private SystemData systemData;
/*
* The type of the resource.
*/
private String type;
/*
* The name of the resource.
*/
private String name;
/*
* Fully qualified resource Id for the resource.
*/
private String id;
/**
* Creates an instance of ActivityEntityQuery class.
*/
public ActivityEntityQuery() {
}
/**
* Get the kind property: the entity query kind.
*
* @return the kind value.
*/
@Override
public EntityQueryKind kind() {
return this.kind;
}
/**
* Get the innerProperties property: Activity entity query properties.
*
* @return the innerProperties value.
*/
private ActivityEntityQueriesProperties innerProperties() {
return this.innerProperties;
}
/**
* Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
* @return the systemData value.
*/
@Override
public SystemData systemData() {
return this.systemData;
}
/**
* Get the type property: The type of the resource.
*
* @return the type value.
*/
@Override
public String type() {
return this.type;
}
/**
* Get the name property: The name of the resource.
*
* @return the name value.
*/
@Override
public String name() {
return this.name;
}
/**
* Get the id property: Fully qualified resource Id for the resource.
*
* @return the id value.
*/
@Override
public String id() {
return this.id;
}
/**
* {@inheritDoc}
*/
@Override
public ActivityEntityQuery withEtag(String etag) {
super.withEtag(etag);
return this;
}
/**
* Get the title property: The entity query title.
*
* @return the title value.
*/
public String title() {
return this.innerProperties() == null ? null : this.innerProperties().title();
}
/**
* Set the title property: The entity query title.
*
* @param title the title value to set.
* @return the ActivityEntityQuery object itself.
*/
public ActivityEntityQuery withTitle(String title) {
if (this.innerProperties() == null) {
this.innerProperties = new ActivityEntityQueriesProperties();
}
this.innerProperties().withTitle(title);
return this;
}
/**
* Get the content property: The entity query content to display in timeline.
*
* @return the content value.
*/
public String content() {
return this.innerProperties() == null ? null : this.innerProperties().content();
}
/**
* Set the content property: The entity query content to display in timeline.
*
* @param content the content value to set.
* @return the ActivityEntityQuery object itself.
*/
public ActivityEntityQuery withContent(String content) {
if (this.innerProperties() == null) {
this.innerProperties = new ActivityEntityQueriesProperties();
}
this.innerProperties().withContent(content);
return this;
}
/**
* Get the description property: The entity query description.
*
* @return the description value.
*/
public String description() {
return this.innerProperties() == null ? null : this.innerProperties().description();
}
/**
* Set the description property: The entity query description.
*
* @param description the description value to set.
* @return the ActivityEntityQuery object itself.
*/
public ActivityEntityQuery withDescription(String description) {
if (this.innerProperties() == null) {
this.innerProperties = new ActivityEntityQueriesProperties();
}
this.innerProperties().withDescription(description);
return this;
}
/**
* Get the queryDefinitions property: The Activity query definitions.
*
* @return the queryDefinitions value.
*/
public ActivityEntityQueriesPropertiesQueryDefinitions queryDefinitions() {
return this.innerProperties() == null ? null : this.innerProperties().queryDefinitions();
}
/**
* Set the queryDefinitions property: The Activity query definitions.
*
* @param queryDefinitions the queryDefinitions value to set.
* @return the ActivityEntityQuery object itself.
*/
public ActivityEntityQuery withQueryDefinitions(ActivityEntityQueriesPropertiesQueryDefinitions queryDefinitions) {
if (this.innerProperties() == null) {
this.innerProperties = new ActivityEntityQueriesProperties();
}
this.innerProperties().withQueryDefinitions(queryDefinitions);
return this;
}
/**
* Get the inputEntityType property: The type of the query's source entity.
*
* @return the inputEntityType value.
*/
public EntityType inputEntityType() {
return this.innerProperties() == null ? null : this.innerProperties().inputEntityType();
}
/**
* Set the inputEntityType property: The type of the query's source entity.
*
* @param inputEntityType the inputEntityType value to set.
* @return the ActivityEntityQuery object itself.
*/
public ActivityEntityQuery withInputEntityType(EntityType inputEntityType) {
if (this.innerProperties() == null) {
this.innerProperties = new ActivityEntityQueriesProperties();
}
this.innerProperties().withInputEntityType(inputEntityType);
return this;
}
/**
* Get the requiredInputFieldsSets property: List of the fields of the source entity that are required to run the
* query.
*
* @return the requiredInputFieldsSets value.
*/
public List> requiredInputFieldsSets() {
return this.innerProperties() == null ? null : this.innerProperties().requiredInputFieldsSets();
}
/**
* Set the requiredInputFieldsSets property: List of the fields of the source entity that are required to run the
* query.
*
* @param requiredInputFieldsSets the requiredInputFieldsSets value to set.
* @return the ActivityEntityQuery object itself.
*/
public ActivityEntityQuery withRequiredInputFieldsSets(List> requiredInputFieldsSets) {
if (this.innerProperties() == null) {
this.innerProperties = new ActivityEntityQueriesProperties();
}
this.innerProperties().withRequiredInputFieldsSets(requiredInputFieldsSets);
return this;
}
/**
* Get the entitiesFilter property: The query applied only to entities matching to all filters.
*
* @return the entitiesFilter value.
*/
public Map> entitiesFilter() {
return this.innerProperties() == null ? null : this.innerProperties().entitiesFilter();
}
/**
* Set the entitiesFilter property: The query applied only to entities matching to all filters.
*
* @param entitiesFilter the entitiesFilter value to set.
* @return the ActivityEntityQuery object itself.
*/
public ActivityEntityQuery withEntitiesFilter(Map> entitiesFilter) {
if (this.innerProperties() == null) {
this.innerProperties = new ActivityEntityQueriesProperties();
}
this.innerProperties().withEntitiesFilter(entitiesFilter);
return this;
}
/**
* Get the templateName property: The template id this activity was created from.
*
* @return the templateName value.
*/
public String templateName() {
return this.innerProperties() == null ? null : this.innerProperties().templateName();
}
/**
* Set the templateName property: The template id this activity was created from.
*
* @param templateName the templateName value to set.
* @return the ActivityEntityQuery object itself.
*/
public ActivityEntityQuery withTemplateName(String templateName) {
if (this.innerProperties() == null) {
this.innerProperties = new ActivityEntityQueriesProperties();
}
this.innerProperties().withTemplateName(templateName);
return this;
}
/**
* Get the enabled property: Determines whether this activity is enabled or disabled.
*
* @return the enabled value.
*/
public Boolean enabled() {
return this.innerProperties() == null ? null : this.innerProperties().enabled();
}
/**
* Set the enabled property: Determines whether this activity is enabled or disabled.
*
* @param enabled the enabled value to set.
* @return the ActivityEntityQuery object itself.
*/
public ActivityEntityQuery withEnabled(Boolean enabled) {
if (this.innerProperties() == null) {
this.innerProperties = new ActivityEntityQueriesProperties();
}
this.innerProperties().withEnabled(enabled);
return this;
}
/**
* Get the createdTimeUtc property: The time the activity was created.
*
* @return the createdTimeUtc value.
*/
public OffsetDateTime createdTimeUtc() {
return this.innerProperties() == null ? null : this.innerProperties().createdTimeUtc();
}
/**
* Get the lastModifiedTimeUtc property: The last time the activity was updated.
*
* @return the lastModifiedTimeUtc value.
*/
public OffsetDateTime lastModifiedTimeUtc() {
return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTimeUtc();
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
@Override
public void validate() {
if (innerProperties() != null) {
innerProperties().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("etag", etag());
jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString());
jsonWriter.writeJsonField("properties", this.innerProperties);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ActivityEntityQuery from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ActivityEntityQuery if the JsonReader was pointing to an instance of it, or null if it was
* pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
* @throws IOException If an error occurs while reading the ActivityEntityQuery.
*/
public static ActivityEntityQuery fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ActivityEntityQuery deserializedActivityEntityQuery = new ActivityEntityQuery();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
deserializedActivityEntityQuery.id = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedActivityEntityQuery.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedActivityEntityQuery.type = reader.getString();
} else if ("etag".equals(fieldName)) {
deserializedActivityEntityQuery.withEtag(reader.getString());
} else if ("systemData".equals(fieldName)) {
deserializedActivityEntityQuery.systemData = SystemData.fromJson(reader);
} else if ("kind".equals(fieldName)) {
deserializedActivityEntityQuery.kind = EntityQueryKind.fromString(reader.getString());
} else if ("properties".equals(fieldName)) {
deserializedActivityEntityQuery.innerProperties = ActivityEntityQueriesProperties.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedActivityEntityQuery;
});
}
}