// 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;
import java.util.List;

/** Active event type of emerging issue. */
@Fluent
public final class StatusActiveEvent {
    /*
     * The active event title.
     */
    @JsonProperty(value = "title")
    private String title;

    /*
     * The details of active event.
     */
    @JsonProperty(value = "description")
    private String description;

    /*
     * The tracking id of this active event.
     */
    @JsonProperty(value = "trackingId")
    private String trackingId;

    /*
     * The impact start time on this active event.
     */
    @JsonProperty(value = "startTime")
    private OffsetDateTime startTime;

    /*
     * The cloud type of this active event.
     */
    @JsonProperty(value = "cloud")
    private String cloud;

    /*
     * The severity level of this active event.
     */
    @JsonProperty(value = "severity")
    private SeverityValues severity;

    /*
     * The stage of this active event.
     */
    @JsonProperty(value = "stage")
    private StageValues stage;

    /*
     * The boolean value of this active event if published or not.
     */
    @JsonProperty(value = "published")
    private Boolean published;

    /*
     * The last time modified on this banner.
     */
    @JsonProperty(value = "lastModifiedTime")
    private OffsetDateTime lastModifiedTime;

    /*
     * The list of emerging issues impacts.
     */
    @JsonProperty(value = "impacts")
    private List<EmergingIssueImpact> impacts;

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

    /**
     * Get the title property: The active event title.
     *
     * @return the title value.
     */
    public String title() {
        return this.title;
    }

    /**
     * Set the title property: The active event title.
     *
     * @param title the title value to set.
     * @return the StatusActiveEvent object itself.
     */
    public StatusActiveEvent withTitle(String title) {
        this.title = title;
        return this;
    }

    /**
     * Get the description property: The details of active event.
     *
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Set the description property: The details of active event.
     *
     * @param description the description value to set.
     * @return the StatusActiveEvent object itself.
     */
    public StatusActiveEvent withDescription(String description) {
        this.description = description;
        return this;
    }

    /**
     * Get the trackingId property: The tracking id of this active event.
     *
     * @return the trackingId value.
     */
    public String trackingId() {
        return this.trackingId;
    }

    /**
     * Set the trackingId property: The tracking id of this active event.
     *
     * @param trackingId the trackingId value to set.
     * @return the StatusActiveEvent object itself.
     */
    public StatusActiveEvent withTrackingId(String trackingId) {
        this.trackingId = trackingId;
        return this;
    }

    /**
     * Get the startTime property: The impact start time on this active event.
     *
     * @return the startTime value.
     */
    public OffsetDateTime startTime() {
        return this.startTime;
    }

    /**
     * Set the startTime property: The impact start time on this active event.
     *
     * @param startTime the startTime value to set.
     * @return the StatusActiveEvent object itself.
     */
    public StatusActiveEvent withStartTime(OffsetDateTime startTime) {
        this.startTime = startTime;
        return this;
    }

    /**
     * Get the cloud property: The cloud type of this active event.
     *
     * @return the cloud value.
     */
    public String cloud() {
        return this.cloud;
    }

    /**
     * Set the cloud property: The cloud type of this active event.
     *
     * @param cloud the cloud value to set.
     * @return the StatusActiveEvent object itself.
     */
    public StatusActiveEvent withCloud(String cloud) {
        this.cloud = cloud;
        return this;
    }

    /**
     * Get the severity property: The severity level of this active event.
     *
     * @return the severity value.
     */
    public SeverityValues severity() {
        return this.severity;
    }

    /**
     * Set the severity property: The severity level of this active event.
     *
     * @param severity the severity value to set.
     * @return the StatusActiveEvent object itself.
     */
    public StatusActiveEvent withSeverity(SeverityValues severity) {
        this.severity = severity;
        return this;
    }

    /**
     * Get the stage property: The stage of this active event.
     *
     * @return the stage value.
     */
    public StageValues stage() {
        return this.stage;
    }

    /**
     * Set the stage property: The stage of this active event.
     *
     * @param stage the stage value to set.
     * @return the StatusActiveEvent object itself.
     */
    public StatusActiveEvent withStage(StageValues stage) {
        this.stage = stage;
        return this;
    }

    /**
     * Get the published property: The boolean value of this active event if published or not.
     *
     * @return the published value.
     */
    public Boolean published() {
        return this.published;
    }

    /**
     * Set the published property: The boolean value of this active event if published or not.
     *
     * @param published the published value to set.
     * @return the StatusActiveEvent object itself.
     */
    public StatusActiveEvent withPublished(Boolean published) {
        this.published = published;
        return this;
    }

    /**
     * Get the lastModifiedTime property: The last time modified on this banner.
     *
     * @return the lastModifiedTime value.
     */
    public OffsetDateTime lastModifiedTime() {
        return this.lastModifiedTime;
    }

    /**
     * Set the lastModifiedTime property: The last time modified on this banner.
     *
     * @param lastModifiedTime the lastModifiedTime value to set.
     * @return the StatusActiveEvent object itself.
     */
    public StatusActiveEvent withLastModifiedTime(OffsetDateTime lastModifiedTime) {
        this.lastModifiedTime = lastModifiedTime;
        return this;
    }

    /**
     * Get the impacts property: The list of emerging issues impacts.
     *
     * @return the impacts value.
     */
    public List<EmergingIssueImpact> impacts() {
        return this.impacts;
    }

    /**
     * Set the impacts property: The list of emerging issues impacts.
     *
     * @param impacts the impacts value to set.
     * @return the StatusActiveEvent object itself.
     */
    public StatusActiveEvent withImpacts(List<EmergingIssueImpact> impacts) {
        this.impacts = impacts;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (impacts() != null) {
            impacts().forEach(e -> e.validate());
        }
    }
}
