// 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.ResourceWithEtag;
import com.azure.resourcemanager.securityinsights.models.UserInfo;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.Map;

/** Represents a Watchlist item in Azure Security Insights. */
@Fluent
public final class WatchlistItemInner extends ResourceWithEtag {
    /*
     * Watchlist Item properties
     */
    @JsonProperty(value = "properties")
    private WatchlistItemProperties innerProperties;

    /**
     * Get the innerProperties property: Watchlist Item properties.
     *
     * @return the innerProperties value.
     */
    private WatchlistItemProperties innerProperties() {
        return this.innerProperties;
    }

    /** {@inheritDoc} */
    @Override
    public WatchlistItemInner withEtag(String etag) {
        super.withEtag(etag);
        return this;
    }

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

    /**
     * Set the watchlistItemType property: The type of the watchlist item.
     *
     * @param watchlistItemType the watchlistItemType value to set.
     * @return the WatchlistItemInner object itself.
     */
    public WatchlistItemInner withWatchlistItemType(String watchlistItemType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WatchlistItemProperties();
        }
        this.innerProperties().withWatchlistItemType(watchlistItemType);
        return this;
    }

    /**
     * Get the watchlistItemId property: The id (a Guid) of the watchlist item.
     *
     * @return the watchlistItemId value.
     */
    public String watchlistItemId() {
        return this.innerProperties() == null ? null : this.innerProperties().watchlistItemId();
    }

    /**
     * Set the watchlistItemId property: The id (a Guid) of the watchlist item.
     *
     * @param watchlistItemId the watchlistItemId value to set.
     * @return the WatchlistItemInner object itself.
     */
    public WatchlistItemInner withWatchlistItemId(String watchlistItemId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WatchlistItemProperties();
        }
        this.innerProperties().withWatchlistItemId(watchlistItemId);
        return this;
    }

    /**
     * Get the tenantId property: The tenantId to which the watchlist item belongs to.
     *
     * @return the tenantId value.
     */
    public String tenantId() {
        return this.innerProperties() == null ? null : this.innerProperties().tenantId();
    }

    /**
     * Set the tenantId property: The tenantId to which the watchlist item belongs to.
     *
     * @param tenantId the tenantId value to set.
     * @return the WatchlistItemInner object itself.
     */
    public WatchlistItemInner withTenantId(String tenantId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WatchlistItemProperties();
        }
        this.innerProperties().withTenantId(tenantId);
        return this;
    }

    /**
     * Get the isDeleted property: A flag that indicates if the watchlist item is deleted or not.
     *
     * @return the isDeleted value.
     */
    public Boolean isDeleted() {
        return this.innerProperties() == null ? null : this.innerProperties().isDeleted();
    }

    /**
     * Set the isDeleted property: A flag that indicates if the watchlist item is deleted or not.
     *
     * @param isDeleted the isDeleted value to set.
     * @return the WatchlistItemInner object itself.
     */
    public WatchlistItemInner withIsDeleted(Boolean isDeleted) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WatchlistItemProperties();
        }
        this.innerProperties().withIsDeleted(isDeleted);
        return this;
    }

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

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

    /**
     * Get the updated property: The last time the watchlist item 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 watchlist item was updated.
     *
     * @param updated the updated value to set.
     * @return the WatchlistItemInner object itself.
     */
    public WatchlistItemInner withUpdated(OffsetDateTime updated) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WatchlistItemProperties();
        }
        this.innerProperties().withUpdated(updated);
        return this;
    }

    /**
     * Get the createdBy property: Describes a user that created the watchlist item.
     *
     * @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 watchlist item.
     *
     * @param createdBy the createdBy value to set.
     * @return the WatchlistItemInner object itself.
     */
    public WatchlistItemInner withCreatedBy(UserInfo createdBy) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WatchlistItemProperties();
        }
        this.innerProperties().withCreatedBy(createdBy);
        return this;
    }

    /**
     * Get the updatedBy property: Describes a user that updated the watchlist item.
     *
     * @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 watchlist item.
     *
     * @param updatedBy the updatedBy value to set.
     * @return the WatchlistItemInner object itself.
     */
    public WatchlistItemInner withUpdatedBy(UserInfo updatedBy) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WatchlistItemProperties();
        }
        this.innerProperties().withUpdatedBy(updatedBy);
        return this;
    }

    /**
     * Get the itemsKeyValue property: key-value pairs for a watchlist item.
     *
     * @return the itemsKeyValue value.
     */
    public Map<String, Object> itemsKeyValue() {
        return this.innerProperties() == null ? null : this.innerProperties().itemsKeyValue();
    }

    /**
     * Set the itemsKeyValue property: key-value pairs for a watchlist item.
     *
     * @param itemsKeyValue the itemsKeyValue value to set.
     * @return the WatchlistItemInner object itself.
     */
    public WatchlistItemInner withItemsKeyValue(Map<String, Object> itemsKeyValue) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WatchlistItemProperties();
        }
        this.innerProperties().withItemsKeyValue(itemsKeyValue);
        return this;
    }

    /**
     * Get the entityMapping property: key-value pairs for a watchlist item entity mapping.
     *
     * @return the entityMapping value.
     */
    public Map<String, Object> entityMapping() {
        return this.innerProperties() == null ? null : this.innerProperties().entityMapping();
    }

    /**
     * Set the entityMapping property: key-value pairs for a watchlist item entity mapping.
     *
     * @param entityMapping the entityMapping value to set.
     * @return the WatchlistItemInner object itself.
     */
    public WatchlistItemInner withEntityMapping(Map<String, Object> entityMapping) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WatchlistItemProperties();
        }
        this.innerProperties().withEntityMapping(entityMapping);
        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();
        }
    }
}
