// 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.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 com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

/** Represents a bookmark in Azure Security Insights. */
@Fluent
public final class BookmarkInner extends ResourceWithEtag {
    /*
     * Bookmark properties
     */
    @JsonProperty(value = "properties")
    private BookmarkProperties innerProperties;

    /**
     * Get the innerProperties property: Bookmark properties.
     *
     * @return the innerProperties value.
     */
    private BookmarkProperties innerProperties() {
        return this.innerProperties;
    }

    /** {@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<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 BookmarkInner object itself.
     */
    public BookmarkInner withLabels(List<String> 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<BookmarkEntityMappings> 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<BookmarkEntityMappings> 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<AttackTactic> 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<AttackTactic> 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<String> 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<String> 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() {
        super.validate();
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}
