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

package com.azure.resourcemanager.mediaservices.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.mediaservices.models.LiveEventHealthStatus;
import com.azure.resourcemanager.mediaservices.models.LiveEventIngestion;
import com.azure.resourcemanager.mediaservices.models.LiveEventState;
import com.azure.resourcemanager.mediaservices.models.LiveEventTrackStatus;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

/** The live event status. */
@Fluent
public final class LiveEventStatusInner {
    /*
     * Current state of the live event. See https://go.microsoft.com/fwlink/?linkid=2139012 for more information.
     */
    @JsonProperty(value = "state")
    private LiveEventState state;

    /*
     * Health status of last 20 seconds.
     */
    @JsonProperty(value = "healthStatus")
    private LiveEventHealthStatus healthStatus;

    /*
     * List of strings justifying the health status.
     */
    @JsonProperty(value = "healthDescriptions")
    private List<String> healthDescriptions;

    /*
     * Last updated UTC time of this status.
     */
    @JsonProperty(value = "lastUpdatedTime")
    private OffsetDateTime lastUpdatedTime;

    /*
     * Live event ingestion entry.
     */
    @JsonProperty(value = "ingestion")
    private LiveEventIngestion ingestion;

    /*
     * Track entry list.
     */
    @JsonProperty(value = "trackStatus")
    private List<LiveEventTrackStatus> trackStatus;

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

    /**
     * Get the state property: Current state of the live event. See https://go.microsoft.com/fwlink/?linkid=2139012 for
     * more information.
     *
     * @return the state value.
     */
    public LiveEventState state() {
        return this.state;
    }

    /**
     * Set the state property: Current state of the live event. See https://go.microsoft.com/fwlink/?linkid=2139012 for
     * more information.
     *
     * @param state the state value to set.
     * @return the LiveEventStatusInner object itself.
     */
    public LiveEventStatusInner withState(LiveEventState state) {
        this.state = state;
        return this;
    }

    /**
     * Get the healthStatus property: Health status of last 20 seconds.
     *
     * @return the healthStatus value.
     */
    public LiveEventHealthStatus healthStatus() {
        return this.healthStatus;
    }

    /**
     * Set the healthStatus property: Health status of last 20 seconds.
     *
     * @param healthStatus the healthStatus value to set.
     * @return the LiveEventStatusInner object itself.
     */
    public LiveEventStatusInner withHealthStatus(LiveEventHealthStatus healthStatus) {
        this.healthStatus = healthStatus;
        return this;
    }

    /**
     * Get the healthDescriptions property: List of strings justifying the health status.
     *
     * @return the healthDescriptions value.
     */
    public List<String> healthDescriptions() {
        return this.healthDescriptions;
    }

    /**
     * Set the healthDescriptions property: List of strings justifying the health status.
     *
     * @param healthDescriptions the healthDescriptions value to set.
     * @return the LiveEventStatusInner object itself.
     */
    public LiveEventStatusInner withHealthDescriptions(List<String> healthDescriptions) {
        this.healthDescriptions = healthDescriptions;
        return this;
    }

    /**
     * Get the lastUpdatedTime property: Last updated UTC time of this status.
     *
     * @return the lastUpdatedTime value.
     */
    public OffsetDateTime lastUpdatedTime() {
        return this.lastUpdatedTime;
    }

    /**
     * Set the lastUpdatedTime property: Last updated UTC time of this status.
     *
     * @param lastUpdatedTime the lastUpdatedTime value to set.
     * @return the LiveEventStatusInner object itself.
     */
    public LiveEventStatusInner withLastUpdatedTime(OffsetDateTime lastUpdatedTime) {
        this.lastUpdatedTime = lastUpdatedTime;
        return this;
    }

    /**
     * Get the ingestion property: Live event ingestion entry.
     *
     * @return the ingestion value.
     */
    public LiveEventIngestion ingestion() {
        return this.ingestion;
    }

    /**
     * Set the ingestion property: Live event ingestion entry.
     *
     * @param ingestion the ingestion value to set.
     * @return the LiveEventStatusInner object itself.
     */
    public LiveEventStatusInner withIngestion(LiveEventIngestion ingestion) {
        this.ingestion = ingestion;
        return this;
    }

    /**
     * Get the trackStatus property: Track entry list.
     *
     * @return the trackStatus value.
     */
    public List<LiveEventTrackStatus> trackStatus() {
        return this.trackStatus;
    }

    /**
     * Set the trackStatus property: Track entry list.
     *
     * @param trackStatus the trackStatus value to set.
     * @return the LiveEventStatusInner object itself.
     */
    public LiveEventStatusInner withTrackStatus(List<LiveEventTrackStatus> trackStatus) {
        this.trackStatus = trackStatus;
        return this;
    }

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