// 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;

/** Data type for Microsoft Threat Intelligence Platforms data connector. */
@Fluent
public final class MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed extends DataConnectorDataTypeCommon {
    /*
     * lookback period
     */
    @JsonProperty(value = "lookbackPeriod", required = true)
    private String lookbackPeriod;

    /**
     * Get the lookbackPeriod property: lookback period.
     *
     * @return the lookbackPeriod value.
     */
    public String lookbackPeriod() {
        return this.lookbackPeriod;
    }

    /**
     * Set the lookbackPeriod property: lookback period.
     *
     * @param lookbackPeriod the lookbackPeriod value to set.
     * @return the MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed object itself.
     */
    public MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed withLookbackPeriod(String lookbackPeriod) {
        this.lookbackPeriod = lookbackPeriod;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed withState(DataTypeState state) {
        super.withState(state);
        return this;
    }

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

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