All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.securityinsights.models.ActivityEntityQueryTemplate Maven / Gradle / Ivy

Go to download

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-2021-09.

There is a newer version: 1.0.0
Show 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.ActivityEntityQueryTemplateProperties;
import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryTemplateInner;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * Represents Activity entity query.
 */
@Fluent
public final class ActivityEntityQueryTemplate extends EntityQueryTemplateInner {
    /*
     * the entity query template kind
     */
    private EntityQueryTemplateKind kind = EntityQueryTemplateKind.ACTIVITY;

    /*
     * Activity entity query properties
     */
    private ActivityEntityQueryTemplateProperties 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 ActivityEntityQueryTemplate class.
     */
    public ActivityEntityQueryTemplate() {
    }

    /**
     * Get the kind property: the entity query template kind.
     * 
     * @return the kind value.
     */
    @Override
    public EntityQueryTemplateKind kind() {
        return this.kind;
    }

    /**
     * Get the innerProperties property: Activity entity query properties.
     * 
     * @return the innerProperties value.
     */
    private ActivityEntityQueryTemplateProperties 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;
    }

    /**
     * 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 ActivityEntityQueryTemplate object itself.
     */
    public ActivityEntityQueryTemplate withTitle(String title) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ActivityEntityQueryTemplateProperties();
        }
        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 ActivityEntityQueryTemplate object itself.
     */
    public ActivityEntityQueryTemplate withContent(String content) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ActivityEntityQueryTemplateProperties();
        }
        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 ActivityEntityQueryTemplate object itself.
     */
    public ActivityEntityQueryTemplate withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ActivityEntityQueryTemplateProperties();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the queryDefinitions property: The Activity query definitions.
     * 
     * @return the queryDefinitions value.
     */
    public ActivityEntityQueryTemplatePropertiesQueryDefinitions 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 ActivityEntityQueryTemplate object itself.
     */
    public ActivityEntityQueryTemplate
        withQueryDefinitions(ActivityEntityQueryTemplatePropertiesQueryDefinitions queryDefinitions) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ActivityEntityQueryTemplateProperties();
        }
        this.innerProperties().withQueryDefinitions(queryDefinitions);
        return this;
    }

    /**
     * Get the dataTypes property: List of required data types for the given entity query template.
     * 
     * @return the dataTypes value.
     */
    public List dataTypes() {
        return this.innerProperties() == null ? null : this.innerProperties().dataTypes();
    }

    /**
     * Set the dataTypes property: List of required data types for the given entity query template.
     * 
     * @param dataTypes the dataTypes value to set.
     * @return the ActivityEntityQueryTemplate object itself.
     */
    public ActivityEntityQueryTemplate withDataTypes(List dataTypes) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ActivityEntityQueryTemplateProperties();
        }
        this.innerProperties().withDataTypes(dataTypes);
        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 ActivityEntityQueryTemplate object itself.
     */
    public ActivityEntityQueryTemplate withInputEntityType(EntityType inputEntityType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ActivityEntityQueryTemplateProperties();
        }
        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 ActivityEntityQueryTemplate object itself.
     */
    public ActivityEntityQueryTemplate withRequiredInputFieldsSets(List> requiredInputFieldsSets) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ActivityEntityQueryTemplateProperties();
        }
        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 ActivityEntityQueryTemplate object itself.
     */
    public ActivityEntityQueryTemplate withEntitiesFilter(Map> entitiesFilter) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ActivityEntityQueryTemplateProperties();
        }
        this.innerProperties().withEntitiesFilter(entitiesFilter);
        return this;
    }

    /**
     * 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("kind", this.kind == null ? null : this.kind.toString());
        jsonWriter.writeJsonField("properties", this.innerProperties);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of ActivityEntityQueryTemplate from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of ActivityEntityQueryTemplate 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 ActivityEntityQueryTemplate.
     */
    public static ActivityEntityQueryTemplate fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            ActivityEntityQueryTemplate deserializedActivityEntityQueryTemplate = new ActivityEntityQueryTemplate();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("id".equals(fieldName)) {
                    deserializedActivityEntityQueryTemplate.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedActivityEntityQueryTemplate.name = reader.getString();
                } else if ("type".equals(fieldName)) {
                    deserializedActivityEntityQueryTemplate.type = reader.getString();
                } else if ("systemData".equals(fieldName)) {
                    deserializedActivityEntityQueryTemplate.systemData = SystemData.fromJson(reader);
                } else if ("kind".equals(fieldName)) {
                    deserializedActivityEntityQueryTemplate.kind
                        = EntityQueryTemplateKind.fromString(reader.getString());
                } else if ("properties".equals(fieldName)) {
                    deserializedActivityEntityQueryTemplate.innerProperties
                        = ActivityEntityQueryTemplateProperties.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedActivityEntityQueryTemplate;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy