// 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.util.logging.ClientLogger;
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;

/** Represents bookmark timeline item. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind")
@JsonTypeName("Bookmark")
@Fluent
public final class BookmarkTimelineItem extends EntityTimelineItem {
    /*
     * The bookmark azure resource id.
     */
    @JsonProperty(value = "azureResourceId", required = true)
    private String azureResourceId;

    /*
     * The bookmark display name.
     */
    @JsonProperty(value = "displayName")
    private String displayName;

    /*
     * The notes of the bookmark
     */
    @JsonProperty(value = "notes")
    private String notes;

    /*
     * The bookmark end time.
     */
    @JsonProperty(value = "endTimeUtc")
    private OffsetDateTime endTimeUtc;

    /*
     * The bookmark start time.
     */
    @JsonProperty(value = "startTimeUtc")
    private OffsetDateTime startTimeUtc;

    /*
     * The bookmark event time.
     */
    @JsonProperty(value = "eventTime")
    private OffsetDateTime eventTime;

    /*
     * Describes a user that created the bookmark
     */
    @JsonProperty(value = "createdBy")
    private UserInfo createdBy;

    /*
     * List of labels relevant to this bookmark
     */
    @JsonProperty(value = "labels")
    private List<String> labels;

    /**
     * Get the azureResourceId property: The bookmark azure resource id.
     *
     * @return the azureResourceId value.
     */
    public String azureResourceId() {
        return this.azureResourceId;
    }

    /**
     * Set the azureResourceId property: The bookmark azure resource id.
     *
     * @param azureResourceId the azureResourceId value to set.
     * @return the BookmarkTimelineItem object itself.
     */
    public BookmarkTimelineItem withAzureResourceId(String azureResourceId) {
        this.azureResourceId = azureResourceId;
        return this;
    }

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

    /**
     * Set the displayName property: The bookmark display name.
     *
     * @param displayName the displayName value to set.
     * @return the BookmarkTimelineItem object itself.
     */
    public BookmarkTimelineItem withDisplayName(String displayName) {
        this.displayName = displayName;
        return this;
    }

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

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

    /**
     * Get the endTimeUtc property: The bookmark end time.
     *
     * @return the endTimeUtc value.
     */
    public OffsetDateTime endTimeUtc() {
        return this.endTimeUtc;
    }

    /**
     * Set the endTimeUtc property: The bookmark end time.
     *
     * @param endTimeUtc the endTimeUtc value to set.
     * @return the BookmarkTimelineItem object itself.
     */
    public BookmarkTimelineItem withEndTimeUtc(OffsetDateTime endTimeUtc) {
        this.endTimeUtc = endTimeUtc;
        return this;
    }

    /**
     * Get the startTimeUtc property: The bookmark start time.
     *
     * @return the startTimeUtc value.
     */
    public OffsetDateTime startTimeUtc() {
        return this.startTimeUtc;
    }

    /**
     * Set the startTimeUtc property: The bookmark start time.
     *
     * @param startTimeUtc the startTimeUtc value to set.
     * @return the BookmarkTimelineItem object itself.
     */
    public BookmarkTimelineItem withStartTimeUtc(OffsetDateTime startTimeUtc) {
        this.startTimeUtc = startTimeUtc;
        return this;
    }

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

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

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

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

    /**
     * Get the labels property: List of labels relevant to this bookmark.
     *
     * @return the labels value.
     */
    public List<String> labels() {
        return this.labels;
    }

    /**
     * Set the labels property: List of labels relevant to this bookmark.
     *
     * @param labels the labels value to set.
     * @return the BookmarkTimelineItem object itself.
     */
    public BookmarkTimelineItem withLabels(List<String> labels) {
        this.labels = labels;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (azureResourceId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property azureResourceId in model BookmarkTimelineItem"));
        }
        if (createdBy() != null) {
            createdBy().validate();
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(BookmarkTimelineItem.class);
}
