// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.resourcehealth.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Lists the service impacting events that may be affecting the health of the resource. */
@Fluent
public final class ServiceImpactingEvent {
    /*
     * Timestamp for when the event started.
     */
    @JsonProperty(value = "eventStartTime")
    private OffsetDateTime eventStartTime;

    /*
     * Timestamp for when event was submitted/detected.
     */
    @JsonProperty(value = "eventStatusLastModifiedTime")
    private OffsetDateTime eventStatusLastModifiedTime;

    /*
     * Correlation id for the event
     */
    @JsonProperty(value = "correlationId")
    private String correlationId;

    /*
     * Status of the service impacting event.
     */
    @JsonProperty(value = "status")
    private ServiceImpactingEventStatus status;

    /*
     * Properties of the service impacting event.
     */
    @JsonProperty(value = "incidentProperties")
    private ServiceImpactingEventIncidentProperties incidentProperties;

    /** Creates an instance of ServiceImpactingEvent class. */
    public ServiceImpactingEvent() {
    }

    /**
     * Get the eventStartTime property: Timestamp for when the event started.
     *
     * @return the eventStartTime value.
     */
    public OffsetDateTime eventStartTime() {
        return this.eventStartTime;
    }

    /**
     * Set the eventStartTime property: Timestamp for when the event started.
     *
     * @param eventStartTime the eventStartTime value to set.
     * @return the ServiceImpactingEvent object itself.
     */
    public ServiceImpactingEvent withEventStartTime(OffsetDateTime eventStartTime) {
        this.eventStartTime = eventStartTime;
        return this;
    }

    /**
     * Get the eventStatusLastModifiedTime property: Timestamp for when event was submitted/detected.
     *
     * @return the eventStatusLastModifiedTime value.
     */
    public OffsetDateTime eventStatusLastModifiedTime() {
        return this.eventStatusLastModifiedTime;
    }

    /**
     * Set the eventStatusLastModifiedTime property: Timestamp for when event was submitted/detected.
     *
     * @param eventStatusLastModifiedTime the eventStatusLastModifiedTime value to set.
     * @return the ServiceImpactingEvent object itself.
     */
    public ServiceImpactingEvent withEventStatusLastModifiedTime(OffsetDateTime eventStatusLastModifiedTime) {
        this.eventStatusLastModifiedTime = eventStatusLastModifiedTime;
        return this;
    }

    /**
     * Get the correlationId property: Correlation id for the event.
     *
     * @return the correlationId value.
     */
    public String correlationId() {
        return this.correlationId;
    }

    /**
     * Set the correlationId property: Correlation id for the event.
     *
     * @param correlationId the correlationId value to set.
     * @return the ServiceImpactingEvent object itself.
     */
    public ServiceImpactingEvent withCorrelationId(String correlationId) {
        this.correlationId = correlationId;
        return this;
    }

    /**
     * Get the status property: Status of the service impacting event.
     *
     * @return the status value.
     */
    public ServiceImpactingEventStatus status() {
        return this.status;
    }

    /**
     * Set the status property: Status of the service impacting event.
     *
     * @param status the status value to set.
     * @return the ServiceImpactingEvent object itself.
     */
    public ServiceImpactingEvent withStatus(ServiceImpactingEventStatus status) {
        this.status = status;
        return this;
    }

    /**
     * Get the incidentProperties property: Properties of the service impacting event.
     *
     * @return the incidentProperties value.
     */
    public ServiceImpactingEventIncidentProperties incidentProperties() {
        return this.incidentProperties;
    }

    /**
     * Set the incidentProperties property: Properties of the service impacting event.
     *
     * @param incidentProperties the incidentProperties value to set.
     * @return the ServiceImpactingEvent object itself.
     */
    public ServiceImpactingEvent withIncidentProperties(ServiceImpactingEventIncidentProperties incidentProperties) {
        this.incidentProperties = incidentProperties;
        return this;
    }

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