// 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.resourcemanager.securityinsights.fluent.models.EntityInner;
import com.azure.resourcemanager.securityinsights.fluent.models.HuntingBookmarkProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;

/** Represents a Hunting bookmark entity. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind")
@JsonTypeName("Bookmark")
@Fluent
public final class HuntingBookmark extends EntityInner {
    /*
     * HuntingBookmark entity properties
     */
    @JsonProperty(value = "properties")
    private HuntingBookmarkProperties innerProperties;

    /**
     * Get the innerProperties property: HuntingBookmark entity properties.
     *
     * @return the innerProperties value.
     */
    private HuntingBookmarkProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * 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 HuntingBookmark object itself.
     */
    public HuntingBookmark withCreated(OffsetDateTime created) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HuntingBookmarkProperties();
        }
        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 HuntingBookmark object itself.
     */
    public HuntingBookmark withCreatedBy(UserInfo createdBy) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HuntingBookmarkProperties();
        }
        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 HuntingBookmark object itself.
     */
    public HuntingBookmark withDisplayName(String displayName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HuntingBookmarkProperties();
        }
        this.innerProperties().withDisplayName(displayName);
        return this;
    }

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

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

    /**
     * Get the labels property: List of labels relevant to this bookmark.
     *
     * @return the labels value.
     */
    public List<String> 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 HuntingBookmark object itself.
     */
    public HuntingBookmark withLabels(List<String> labels) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HuntingBookmarkProperties();
        }
        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 HuntingBookmark object itself.
     */
    public HuntingBookmark withNotes(String notes) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HuntingBookmarkProperties();
        }
        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 HuntingBookmark object itself.
     */
    public HuntingBookmark withQuery(String query) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HuntingBookmarkProperties();
        }
        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 HuntingBookmark object itself.
     */
    public HuntingBookmark withQueryResult(String queryResult) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HuntingBookmarkProperties();
        }
        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 HuntingBookmark object itself.
     */
    public HuntingBookmark withUpdated(OffsetDateTime updated) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HuntingBookmarkProperties();
        }
        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 HuntingBookmark object itself.
     */
    public HuntingBookmark withUpdatedBy(UserInfo updatedBy) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HuntingBookmarkProperties();
        }
        this.innerProperties().withUpdatedBy(updatedBy);
        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 HuntingBookmark object itself.
     */
    public HuntingBookmark withIncidentInfo(IncidentInfo incidentInfo) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HuntingBookmarkProperties();
        }
        this.innerProperties().withIncidentInfo(incidentInfo);
        return this;
    }

    /**
     * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented
     * to the user.
     *
     * @return the additionalData value.
     */
    public Map<String, Object> additionalData() {
        return this.innerProperties() == null ? null : this.innerProperties().additionalData();
    }

    /**
     * Get the friendlyName property: The graph item display name which is a short humanly readable description of the
     * graph item instance. This property is optional and might be system generated.
     *
     * @return the friendlyName value.
     */
    public String friendlyName() {
        return this.innerProperties() == null ? null : this.innerProperties().friendlyName();
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}
