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

com.azure.resourcemanager.securityinsights.models.ActivityCustomEntityQuery 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-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 java.io.IOException;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;

/**
 * Represents Activity entity query.
 */
@Fluent
public final class ActivityCustomEntityQuery extends CustomEntityQuery {
    /*
     * the entity query kind
     */
    private CustomEntityQueryKind kind = CustomEntityQueryKind.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 ActivityCustomEntityQuery class.
     */
    public ActivityCustomEntityQuery() {
    }

    /**
     * Get the kind property: the entity query kind.
     * 
     * @return the kind value.
     */
    @Override
    public CustomEntityQueryKind 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 ActivityCustomEntityQuery 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 ActivityCustomEntityQuery object itself.
     */
    public ActivityCustomEntityQuery 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 ActivityCustomEntityQuery object itself.
     */
    public ActivityCustomEntityQuery 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 ActivityCustomEntityQuery object itself.
     */
    public ActivityCustomEntityQuery 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 ActivityCustomEntityQuery object itself.
     */
    public ActivityCustomEntityQuery
        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 ActivityCustomEntityQuery object itself.
     */
    public ActivityCustomEntityQuery 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 ActivityCustomEntityQuery object itself.
     */
    public ActivityCustomEntityQuery 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 ActivityCustomEntityQuery object itself.
     */
    public ActivityCustomEntityQuery 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 ActivityCustomEntityQuery object itself.
     */
    public ActivityCustomEntityQuery 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 ActivityCustomEntityQuery object itself.
     */
    public ActivityCustomEntityQuery 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 ActivityCustomEntityQuery from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of ActivityCustomEntityQuery 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 ActivityCustomEntityQuery.
     */
    public static ActivityCustomEntityQuery fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            ActivityCustomEntityQuery deserializedActivityCustomEntityQuery = new ActivityCustomEntityQuery();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("id".equals(fieldName)) {
                    deserializedActivityCustomEntityQuery.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedActivityCustomEntityQuery.name = reader.getString();
                } else if ("type".equals(fieldName)) {
                    deserializedActivityCustomEntityQuery.type = reader.getString();
                } else if ("etag".equals(fieldName)) {
                    deserializedActivityCustomEntityQuery.withEtag(reader.getString());
                } else if ("systemData".equals(fieldName)) {
                    deserializedActivityCustomEntityQuery.systemData = SystemData.fromJson(reader);
                } else if ("kind".equals(fieldName)) {
                    deserializedActivityCustomEntityQuery.kind = CustomEntityQueryKind.fromString(reader.getString());
                } else if ("properties".equals(fieldName)) {
                    deserializedActivityCustomEntityQuery.innerProperties
                        = ActivityEntityQueriesProperties.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedActivityCustomEntityQuery;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy