// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.resourcehealth.models.EventLevelValues;
import com.azure.resourcemanager.resourcehealth.models.EventPropertiesAdditionalInformation;
import com.azure.resourcemanager.resourcehealth.models.EventPropertiesArticle;
import com.azure.resourcemanager.resourcehealth.models.EventPropertiesRecommendedActions;
import com.azure.resourcemanager.resourcehealth.models.EventSourceValues;
import com.azure.resourcemanager.resourcehealth.models.EventStatusValues;
import com.azure.resourcemanager.resourcehealth.models.EventTypeValues;
import com.azure.resourcemanager.resourcehealth.models.Faq;
import com.azure.resourcemanager.resourcehealth.models.Impact;
import com.azure.resourcemanager.resourcehealth.models.LevelValues;
import com.azure.resourcemanager.resourcehealth.models.Link;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

/** Properties of event. */
@Fluent
public final class EventProperties {
    /*
     * Type of event.
     */
    @JsonProperty(value = "eventType")
    private EventTypeValues eventType;

    /*
     * Source of event.
     */
    @JsonProperty(value = "eventSource")
    private EventSourceValues eventSource;

    /*
     * Current status of event.
     */
    @JsonProperty(value = "status")
    private EventStatusValues status;

    /*
     * Title text of event.
     */
    @JsonProperty(value = "title")
    private String title;

    /*
     * Summary text of event.
     */
    @JsonProperty(value = "summary")
    private String summary;

    /*
     * Header text of event.
     */
    @JsonProperty(value = "header")
    private String headerProperty;

    /*
     * Level of insight.
     */
    @JsonProperty(value = "level")
    private LevelValues level;

    /*
     * Level of event.
     */
    @JsonProperty(value = "eventLevel")
    private EventLevelValues eventLevel;

    /*
     * The id of the Incident
     */
    @JsonProperty(value = "externalIncidentId")
    private String externalIncidentId;

    /*
     * The reason for the Incident
     */
    @JsonProperty(value = "reason")
    private String reason;

    /*
     * Article of event.
     */
    @JsonProperty(value = "article")
    private EventPropertiesArticle article;

    /*
     * Useful links of event.
     */
    @JsonProperty(value = "links")
    private List<Link> links;

    /*
     * It provides the Timestamp for when the health impacting event started.
     */
    @JsonProperty(value = "impactStartTime")
    private OffsetDateTime impactStartTime;

    /*
     * It provides the Timestamp for when the health impacting event resolved.
     */
    @JsonProperty(value = "impactMitigationTime")
    private OffsetDateTime impactMitigationTime;

    /*
     * List services impacted by the service health event.
     */
    @JsonProperty(value = "impact")
    private List<Impact> impact;

    /*
     * Recommended actions of event.
     */
    @JsonProperty(value = "recommendedActions")
    private EventPropertiesRecommendedActions recommendedActions;

    /*
     * Frequently asked questions for the service health event.
     */
    @JsonProperty(value = "faqs")
    private List<Faq> faqs;

    /*
     * It provides information if the event is High incident rate event or not.
     */
    @JsonProperty(value = "isHIR")
    private Boolean isHir;

    /*
     * Tells if we want to enable or disable Microsoft Support for this event.
     */
    @JsonProperty(value = "enableMicrosoftSupport")
    private Boolean enableMicrosoftSupport;

    /*
     * Contains the communication message for the event, that could include summary, root cause and other details.
     */
    @JsonProperty(value = "description")
    private String description;

    /*
     * Is true if the event is platform initiated.
     */
    @JsonProperty(value = "platformInitiated")
    private Boolean platformInitiated;

    /*
     * Tells if we want to enable or disable Microsoft Support for this event.
     */
    @JsonProperty(value = "enableChatWithUs")
    private Boolean enableChatWithUs;

    /*
     * Priority level of the event. Has value from 0 to 23. 0 is the highest priority. Service issue events have higher
     * priority followed by planned maintenance and health advisory. Critical events have higher priority followed by
     * error, warning and informational. Furthermore, active events have higher priority than resolved.
     */
    @JsonProperty(value = "priority")
    private Integer priority;

    /*
     * It provides the Timestamp for when the health impacting event was last updated.
     */
    @JsonProperty(value = "lastUpdateTime")
    private OffsetDateTime lastUpdateTime;

    /*
     * Stage for HIR Document
     */
    @JsonProperty(value = "hirStage")
    private String hirStage;

    /*
     * Additional information
     */
    @JsonProperty(value = "additionalInformation")
    private EventPropertiesAdditionalInformation additionalInformation;

    /*
     * duration in seconds
     */
    @JsonProperty(value = "duration")
    private Integer duration;

    /*
     * The type of the impact
     */
    @JsonProperty(value = "impactType")
    private String impactType;

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

    /**
     * Get the eventType property: Type of event.
     *
     * @return the eventType value.
     */
    public EventTypeValues eventType() {
        return this.eventType;
    }

    /**
     * Set the eventType property: Type of event.
     *
     * @param eventType the eventType value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withEventType(EventTypeValues eventType) {
        this.eventType = eventType;
        return this;
    }

    /**
     * Get the eventSource property: Source of event.
     *
     * @return the eventSource value.
     */
    public EventSourceValues eventSource() {
        return this.eventSource;
    }

    /**
     * Set the eventSource property: Source of event.
     *
     * @param eventSource the eventSource value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withEventSource(EventSourceValues eventSource) {
        this.eventSource = eventSource;
        return this;
    }

    /**
     * Get the status property: Current status of event.
     *
     * @return the status value.
     */
    public EventStatusValues status() {
        return this.status;
    }

    /**
     * Set the status property: Current status of event.
     *
     * @param status the status value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withStatus(EventStatusValues status) {
        this.status = status;
        return this;
    }

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

    /**
     * Set the title property: Title text of event.
     *
     * @param title the title value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withTitle(String title) {
        this.title = title;
        return this;
    }

    /**
     * Get the summary property: Summary text of event.
     *
     * @return the summary value.
     */
    public String summary() {
        return this.summary;
    }

    /**
     * Set the summary property: Summary text of event.
     *
     * @param summary the summary value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withSummary(String summary) {
        this.summary = summary;
        return this;
    }

    /**
     * Get the headerProperty property: Header text of event.
     *
     * @return the headerProperty value.
     */
    public String headerProperty() {
        return this.headerProperty;
    }

    /**
     * Set the headerProperty property: Header text of event.
     *
     * @param headerProperty the headerProperty value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withHeaderProperty(String headerProperty) {
        this.headerProperty = headerProperty;
        return this;
    }

    /**
     * Get the level property: Level of insight.
     *
     * @return the level value.
     */
    public LevelValues level() {
        return this.level;
    }

    /**
     * Set the level property: Level of insight.
     *
     * @param level the level value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withLevel(LevelValues level) {
        this.level = level;
        return this;
    }

    /**
     * Get the eventLevel property: Level of event.
     *
     * @return the eventLevel value.
     */
    public EventLevelValues eventLevel() {
        return this.eventLevel;
    }

    /**
     * Set the eventLevel property: Level of event.
     *
     * @param eventLevel the eventLevel value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withEventLevel(EventLevelValues eventLevel) {
        this.eventLevel = eventLevel;
        return this;
    }

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

    /**
     * Set the externalIncidentId property: The id of the Incident.
     *
     * @param externalIncidentId the externalIncidentId value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withExternalIncidentId(String externalIncidentId) {
        this.externalIncidentId = externalIncidentId;
        return this;
    }

    /**
     * Get the reason property: The reason for the Incident.
     *
     * @return the reason value.
     */
    public String reason() {
        return this.reason;
    }

    /**
     * Set the reason property: The reason for the Incident.
     *
     * @param reason the reason value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withReason(String reason) {
        this.reason = reason;
        return this;
    }

    /**
     * Get the article property: Article of event.
     *
     * @return the article value.
     */
    public EventPropertiesArticle article() {
        return this.article;
    }

    /**
     * Set the article property: Article of event.
     *
     * @param article the article value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withArticle(EventPropertiesArticle article) {
        this.article = article;
        return this;
    }

    /**
     * Get the links property: Useful links of event.
     *
     * @return the links value.
     */
    public List<Link> links() {
        return this.links;
    }

    /**
     * Set the links property: Useful links of event.
     *
     * @param links the links value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withLinks(List<Link> links) {
        this.links = links;
        return this;
    }

    /**
     * Get the impactStartTime property: It provides the Timestamp for when the health impacting event started.
     *
     * @return the impactStartTime value.
     */
    public OffsetDateTime impactStartTime() {
        return this.impactStartTime;
    }

    /**
     * Set the impactStartTime property: It provides the Timestamp for when the health impacting event started.
     *
     * @param impactStartTime the impactStartTime value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withImpactStartTime(OffsetDateTime impactStartTime) {
        this.impactStartTime = impactStartTime;
        return this;
    }

    /**
     * Get the impactMitigationTime property: It provides the Timestamp for when the health impacting event resolved.
     *
     * @return the impactMitigationTime value.
     */
    public OffsetDateTime impactMitigationTime() {
        return this.impactMitigationTime;
    }

    /**
     * Set the impactMitigationTime property: It provides the Timestamp for when the health impacting event resolved.
     *
     * @param impactMitigationTime the impactMitigationTime value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withImpactMitigationTime(OffsetDateTime impactMitigationTime) {
        this.impactMitigationTime = impactMitigationTime;
        return this;
    }

    /**
     * Get the impact property: List services impacted by the service health event.
     *
     * @return the impact value.
     */
    public List<Impact> impact() {
        return this.impact;
    }

    /**
     * Set the impact property: List services impacted by the service health event.
     *
     * @param impact the impact value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withImpact(List<Impact> impact) {
        this.impact = impact;
        return this;
    }

    /**
     * Get the recommendedActions property: Recommended actions of event.
     *
     * @return the recommendedActions value.
     */
    public EventPropertiesRecommendedActions recommendedActions() {
        return this.recommendedActions;
    }

    /**
     * Set the recommendedActions property: Recommended actions of event.
     *
     * @param recommendedActions the recommendedActions value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withRecommendedActions(EventPropertiesRecommendedActions recommendedActions) {
        this.recommendedActions = recommendedActions;
        return this;
    }

    /**
     * Get the faqs property: Frequently asked questions for the service health event.
     *
     * @return the faqs value.
     */
    public List<Faq> faqs() {
        return this.faqs;
    }

    /**
     * Set the faqs property: Frequently asked questions for the service health event.
     *
     * @param faqs the faqs value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withFaqs(List<Faq> faqs) {
        this.faqs = faqs;
        return this;
    }

    /**
     * Get the isHir property: It provides information if the event is High incident rate event or not.
     *
     * @return the isHir value.
     */
    public Boolean isHir() {
        return this.isHir;
    }

    /**
     * Set the isHir property: It provides information if the event is High incident rate event or not.
     *
     * @param isHir the isHir value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withIsHir(Boolean isHir) {
        this.isHir = isHir;
        return this;
    }

    /**
     * Get the enableMicrosoftSupport property: Tells if we want to enable or disable Microsoft Support for this event.
     *
     * @return the enableMicrosoftSupport value.
     */
    public Boolean enableMicrosoftSupport() {
        return this.enableMicrosoftSupport;
    }

    /**
     * Set the enableMicrosoftSupport property: Tells if we want to enable or disable Microsoft Support for this event.
     *
     * @param enableMicrosoftSupport the enableMicrosoftSupport value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withEnableMicrosoftSupport(Boolean enableMicrosoftSupport) {
        this.enableMicrosoftSupport = enableMicrosoftSupport;
        return this;
    }

    /**
     * Get the description property: Contains the communication message for the event, that could include summary, root
     * cause and other details.
     *
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Set the description property: Contains the communication message for the event, that could include summary, root
     * cause and other details.
     *
     * @param description the description value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withDescription(String description) {
        this.description = description;
        return this;
    }

    /**
     * Get the platformInitiated property: Is true if the event is platform initiated.
     *
     * @return the platformInitiated value.
     */
    public Boolean platformInitiated() {
        return this.platformInitiated;
    }

    /**
     * Set the platformInitiated property: Is true if the event is platform initiated.
     *
     * @param platformInitiated the platformInitiated value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withPlatformInitiated(Boolean platformInitiated) {
        this.platformInitiated = platformInitiated;
        return this;
    }

    /**
     * Get the enableChatWithUs property: Tells if we want to enable or disable Microsoft Support for this event.
     *
     * @return the enableChatWithUs value.
     */
    public Boolean enableChatWithUs() {
        return this.enableChatWithUs;
    }

    /**
     * Set the enableChatWithUs property: Tells if we want to enable or disable Microsoft Support for this event.
     *
     * @param enableChatWithUs the enableChatWithUs value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withEnableChatWithUs(Boolean enableChatWithUs) {
        this.enableChatWithUs = enableChatWithUs;
        return this;
    }

    /**
     * Get the priority property: Priority level of the event. Has value from 0 to 23. 0 is the highest priority.
     * Service issue events have higher priority followed by planned maintenance and health advisory. Critical events
     * have higher priority followed by error, warning and informational. Furthermore, active events have higher
     * priority than resolved.
     *
     * @return the priority value.
     */
    public Integer priority() {
        return this.priority;
    }

    /**
     * Set the priority property: Priority level of the event. Has value from 0 to 23. 0 is the highest priority.
     * Service issue events have higher priority followed by planned maintenance and health advisory. Critical events
     * have higher priority followed by error, warning and informational. Furthermore, active events have higher
     * priority than resolved.
     *
     * @param priority the priority value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withPriority(Integer priority) {
        this.priority = priority;
        return this;
    }

    /**
     * Get the lastUpdateTime property: It provides the Timestamp for when the health impacting event was last updated.
     *
     * @return the lastUpdateTime value.
     */
    public OffsetDateTime lastUpdateTime() {
        return this.lastUpdateTime;
    }

    /**
     * Set the lastUpdateTime property: It provides the Timestamp for when the health impacting event was last updated.
     *
     * @param lastUpdateTime the lastUpdateTime value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withLastUpdateTime(OffsetDateTime lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
        return this;
    }

    /**
     * Get the hirStage property: Stage for HIR Document.
     *
     * @return the hirStage value.
     */
    public String hirStage() {
        return this.hirStage;
    }

    /**
     * Set the hirStage property: Stage for HIR Document.
     *
     * @param hirStage the hirStage value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withHirStage(String hirStage) {
        this.hirStage = hirStage;
        return this;
    }

    /**
     * Get the additionalInformation property: Additional information.
     *
     * @return the additionalInformation value.
     */
    public EventPropertiesAdditionalInformation additionalInformation() {
        return this.additionalInformation;
    }

    /**
     * Set the additionalInformation property: Additional information.
     *
     * @param additionalInformation the additionalInformation value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withAdditionalInformation(EventPropertiesAdditionalInformation additionalInformation) {
        this.additionalInformation = additionalInformation;
        return this;
    }

    /**
     * Get the duration property: duration in seconds.
     *
     * @return the duration value.
     */
    public Integer duration() {
        return this.duration;
    }

    /**
     * Set the duration property: duration in seconds.
     *
     * @param duration the duration value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withDuration(Integer duration) {
        this.duration = duration;
        return this;
    }

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

    /**
     * Set the impactType property: The type of the impact.
     *
     * @param impactType the impactType value to set.
     * @return the EventProperties object itself.
     */
    public EventProperties withImpactType(String impactType) {
        this.impactType = impactType;
        return this;
    }

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