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

com.azure.resourcemanager.securityinsights.fluent.models.BookmarkInner 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.fluent.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.models.AttackTactic;
import com.azure.resourcemanager.securityinsights.models.BookmarkEntityMappings;
import com.azure.resourcemanager.securityinsights.models.IncidentInfo;
import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag;
import com.azure.resourcemanager.securityinsights.models.UserInfo;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.List;

/**
 * Represents a bookmark in Azure Security Insights.
 */
@Fluent
public final class BookmarkInner extends ResourceWithEtag {
    /*
     * Bookmark properties
     */
    private BookmarkProperties 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 BookmarkInner class.
     */
    public BookmarkInner() {
    }

    /**
     * Get the innerProperties property: Bookmark properties.
     * 
     * @return the innerProperties value.
     */
    private BookmarkProperties 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 BookmarkInner withEtag(String etag) {
        super.withEtag(etag);
        return this;
    }

    /**
     * Get the created property: The time the bookmark was created.
     * 
     * @return the created value.
     */
    public OffsetDateTime created() {
        return this.innerProperties() == null ? null : this.innerProperties().created();
    }

    /**
     * Set the created property: The time the bookmark was created.
     * 
     * @param created the created value to set.
     * @return the BookmarkInner object itself.
     */
    public BookmarkInner withCreated(OffsetDateTime created) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BookmarkProperties();
        }
        this.innerProperties().withCreated(created);
        return this;
    }

    /**
     * Get the createdBy property: Describes a user that created the bookmark.
     * 
     * @return the createdBy value.
     */
    public UserInfo createdBy() {
        return this.innerProperties() == null ? null : this.innerProperties().createdBy();
    }

    /**
     * Set the createdBy property: Describes a user that created the bookmark.
     * 
     * @param createdBy the createdBy value to set.
     * @return the BookmarkInner object itself.
     */
    public BookmarkInner withCreatedBy(UserInfo createdBy) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BookmarkProperties();
        }
        this.innerProperties().withCreatedBy(createdBy);
        return this;
    }

    /**
     * Get the displayName property: The display name of the bookmark.
     * 
     * @return the displayName value.
     */
    public String displayName() {
        return this.innerProperties() == null ? null : this.innerProperties().displayName();
    }

    /**
     * Set the displayName property: The display name of the bookmark.
     * 
     * @param displayName the displayName value to set.
     * @return the BookmarkInner object itself.
     */
    public BookmarkInner withDisplayName(String displayName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BookmarkProperties();
        }
        this.innerProperties().withDisplayName(displayName);
        return this;
    }

    /**
     * Get the labels property: List of labels relevant to this bookmark.
     * 
     * @return the labels value.
     */
    public List labels() {
        return this.innerProperties() == null ? null : this.innerProperties().labels();
    }

    /**
     * Set the labels property: List of labels relevant to this bookmark.
     * 
     * @param labels the labels value to set.
     * @return the BookmarkInner object itself.
     */
    public BookmarkInner withLabels(List labels) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BookmarkProperties();
        }
        this.innerProperties().withLabels(labels);
        return this;
    }

    /**
     * Get the notes property: The notes of the bookmark.
     * 
     * @return the notes value.
     */
    public String notes() {
        return this.innerProperties() == null ? null : this.innerProperties().notes();
    }

    /**
     * Set the notes property: The notes of the bookmark.
     * 
     * @param notes the notes value to set.
     * @return the BookmarkInner object itself.
     */
    public BookmarkInner withNotes(String notes) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BookmarkProperties();
        }
        this.innerProperties().withNotes(notes);
        return this;
    }

    /**
     * Get the query property: The query of the bookmark.
     * 
     * @return the query value.
     */
    public String query() {
        return this.innerProperties() == null ? null : this.innerProperties().query();
    }

    /**
     * Set the query property: The query of the bookmark.
     * 
     * @param query the query value to set.
     * @return the BookmarkInner object itself.
     */
    public BookmarkInner withQuery(String query) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BookmarkProperties();
        }
        this.innerProperties().withQuery(query);
        return this;
    }

    /**
     * Get the queryResult property: The query result of the bookmark.
     * 
     * @return the queryResult value.
     */
    public String queryResult() {
        return this.innerProperties() == null ? null : this.innerProperties().queryResult();
    }

    /**
     * Set the queryResult property: The query result of the bookmark.
     * 
     * @param queryResult the queryResult value to set.
     * @return the BookmarkInner object itself.
     */
    public BookmarkInner withQueryResult(String queryResult) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BookmarkProperties();
        }
        this.innerProperties().withQueryResult(queryResult);
        return this;
    }

    /**
     * Get the updated property: The last time the bookmark was updated.
     * 
     * @return the updated value.
     */
    public OffsetDateTime updated() {
        return this.innerProperties() == null ? null : this.innerProperties().updated();
    }

    /**
     * Set the updated property: The last time the bookmark was updated.
     * 
     * @param updated the updated value to set.
     * @return the BookmarkInner object itself.
     */
    public BookmarkInner withUpdated(OffsetDateTime updated) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BookmarkProperties();
        }
        this.innerProperties().withUpdated(updated);
        return this;
    }

    /**
     * Get the updatedBy property: Describes a user that updated the bookmark.
     * 
     * @return the updatedBy value.
     */
    public UserInfo updatedBy() {
        return this.innerProperties() == null ? null : this.innerProperties().updatedBy();
    }

    /**
     * Set the updatedBy property: Describes a user that updated the bookmark.
     * 
     * @param updatedBy the updatedBy value to set.
     * @return the BookmarkInner object itself.
     */
    public BookmarkInner withUpdatedBy(UserInfo updatedBy) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BookmarkProperties();
        }
        this.innerProperties().withUpdatedBy(updatedBy);
        return this;
    }

    /**
     * Get the eventTime property: The bookmark event time.
     * 
     * @return the eventTime value.
     */
    public OffsetDateTime eventTime() {
        return this.innerProperties() == null ? null : this.innerProperties().eventTime();
    }

    /**
     * Set the eventTime property: The bookmark event time.
     * 
     * @param eventTime the eventTime value to set.
     * @return the BookmarkInner object itself.
     */
    public BookmarkInner withEventTime(OffsetDateTime eventTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BookmarkProperties();
        }
        this.innerProperties().withEventTime(eventTime);
        return this;
    }

    /**
     * Get the queryStartTime property: The start time for the query.
     * 
     * @return the queryStartTime value.
     */
    public OffsetDateTime queryStartTime() {
        return this.innerProperties() == null ? null : this.innerProperties().queryStartTime();
    }

    /**
     * Set the queryStartTime property: The start time for the query.
     * 
     * @param queryStartTime the queryStartTime value to set.
     * @return the BookmarkInner object itself.
     */
    public BookmarkInner withQueryStartTime(OffsetDateTime queryStartTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BookmarkProperties();
        }
        this.innerProperties().withQueryStartTime(queryStartTime);
        return this;
    }

    /**
     * Get the queryEndTime property: The end time for the query.
     * 
     * @return the queryEndTime value.
     */
    public OffsetDateTime queryEndTime() {
        return this.innerProperties() == null ? null : this.innerProperties().queryEndTime();
    }

    /**
     * Set the queryEndTime property: The end time for the query.
     * 
     * @param queryEndTime the queryEndTime value to set.
     * @return the BookmarkInner object itself.
     */
    public BookmarkInner withQueryEndTime(OffsetDateTime queryEndTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BookmarkProperties();
        }
        this.innerProperties().withQueryEndTime(queryEndTime);
        return this;
    }

    /**
     * Get the incidentInfo property: Describes an incident that relates to bookmark.
     * 
     * @return the incidentInfo value.
     */
    public IncidentInfo incidentInfo() {
        return this.innerProperties() == null ? null : this.innerProperties().incidentInfo();
    }

    /**
     * Set the incidentInfo property: Describes an incident that relates to bookmark.
     * 
     * @param incidentInfo the incidentInfo value to set.
     * @return the BookmarkInner object itself.
     */
    public BookmarkInner withIncidentInfo(IncidentInfo incidentInfo) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BookmarkProperties();
        }
        this.innerProperties().withIncidentInfo(incidentInfo);
        return this;
    }

    /**
     * Get the entityMappings property: Describes the entity mappings of the bookmark.
     * 
     * @return the entityMappings value.
     */
    public List entityMappings() {
        return this.innerProperties() == null ? null : this.innerProperties().entityMappings();
    }

    /**
     * Set the entityMappings property: Describes the entity mappings of the bookmark.
     * 
     * @param entityMappings the entityMappings value to set.
     * @return the BookmarkInner object itself.
     */
    public BookmarkInner withEntityMappings(List entityMappings) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BookmarkProperties();
        }
        this.innerProperties().withEntityMappings(entityMappings);
        return this;
    }

    /**
     * Get the tactics property: A list of relevant mitre attacks.
     * 
     * @return the tactics value.
     */
    public List tactics() {
        return this.innerProperties() == null ? null : this.innerProperties().tactics();
    }

    /**
     * Set the tactics property: A list of relevant mitre attacks.
     * 
     * @param tactics the tactics value to set.
     * @return the BookmarkInner object itself.
     */
    public BookmarkInner withTactics(List tactics) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BookmarkProperties();
        }
        this.innerProperties().withTactics(tactics);
        return this;
    }

    /**
     * Get the techniques property: A list of relevant mitre techniques.
     * 
     * @return the techniques value.
     */
    public List techniques() {
        return this.innerProperties() == null ? null : this.innerProperties().techniques();
    }

    /**
     * Set the techniques property: A list of relevant mitre techniques.
     * 
     * @param techniques the techniques value to set.
     * @return the BookmarkInner object itself.
     */
    public BookmarkInner withTechniques(List techniques) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BookmarkProperties();
        }
        this.innerProperties().withTechniques(techniques);
        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("etag", etag());
        jsonWriter.writeJsonField("properties", this.innerProperties);
        return jsonWriter.writeEndObject();
    }

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

                if ("id".equals(fieldName)) {
                    deserializedBookmarkInner.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedBookmarkInner.name = reader.getString();
                } else if ("type".equals(fieldName)) {
                    deserializedBookmarkInner.type = reader.getString();
                } else if ("etag".equals(fieldName)) {
                    deserializedBookmarkInner.withEtag(reader.getString());
                } else if ("systemData".equals(fieldName)) {
                    deserializedBookmarkInner.systemData = SystemData.fromJson(reader);
                } else if ("properties".equals(fieldName)) {
                    deserializedBookmarkInner.innerProperties = BookmarkProperties.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedBookmarkInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy