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

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

/** The live event ingestion telemetry data. */
@Fluent
public final class LiveEventIngestion {
    /*
     * Ingestion stream name.
     */
    @JsonProperty(value = "streamName")
    private String streamName;

    /*
     * Ingestion begin time in UTC.
     */
    @JsonProperty(value = "begin")
    private OffsetDateTime begin;

    /*
     * Ingestion end time in UTC. Empty if it's not stopped yet.
     */
    @JsonProperty(value = "end")
    private OffsetDateTime end;

    /*
     * Reason why ingestion stops. Empty if it's not stopped yet. E.g) Service Stopped. No Ingestion.
     */
    @JsonProperty(value = "endReason")
    private String endReason;

    /*
     * IngestInterruption entry list.
     */
    @JsonProperty(value = "ingestInterruptions")
    private List<LiveEventIngestInterruption> ingestInterruptions;

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

    /**
     * Get the streamName property: Ingestion stream name.
     *
     * @return the streamName value.
     */
    public String streamName() {
        return this.streamName;
    }

    /**
     * Set the streamName property: Ingestion stream name.
     *
     * @param streamName the streamName value to set.
     * @return the LiveEventIngestion object itself.
     */
    public LiveEventIngestion withStreamName(String streamName) {
        this.streamName = streamName;
        return this;
    }

    /**
     * Get the begin property: Ingestion begin time in UTC.
     *
     * @return the begin value.
     */
    public OffsetDateTime begin() {
        return this.begin;
    }

    /**
     * Set the begin property: Ingestion begin time in UTC.
     *
     * @param begin the begin value to set.
     * @return the LiveEventIngestion object itself.
     */
    public LiveEventIngestion withBegin(OffsetDateTime begin) {
        this.begin = begin;
        return this;
    }

    /**
     * Get the end property: Ingestion end time in UTC. Empty if it's not stopped yet.
     *
     * @return the end value.
     */
    public OffsetDateTime end() {
        return this.end;
    }

    /**
     * Set the end property: Ingestion end time in UTC. Empty if it's not stopped yet.
     *
     * @param end the end value to set.
     * @return the LiveEventIngestion object itself.
     */
    public LiveEventIngestion withEnd(OffsetDateTime end) {
        this.end = end;
        return this;
    }

    /**
     * Get the endReason property: Reason why ingestion stops. Empty if it's not stopped yet. E.g) Service Stopped. No
     * Ingestion.
     *
     * @return the endReason value.
     */
    public String endReason() {
        return this.endReason;
    }

    /**
     * Set the endReason property: Reason why ingestion stops. Empty if it's not stopped yet. E.g) Service Stopped. No
     * Ingestion.
     *
     * @param endReason the endReason value to set.
     * @return the LiveEventIngestion object itself.
     */
    public LiveEventIngestion withEndReason(String endReason) {
        this.endReason = endReason;
        return this;
    }

    /**
     * Get the ingestInterruptions property: IngestInterruption entry list.
     *
     * @return the ingestInterruptions value.
     */
    public List<LiveEventIngestInterruption> ingestInterruptions() {
        return this.ingestInterruptions;
    }

    /**
     * Set the ingestInterruptions property: IngestInterruption entry list.
     *
     * @param ingestInterruptions the ingestInterruptions value to set.
     * @return the LiveEventIngestion object itself.
     */
    public LiveEventIngestion withIngestInterruptions(List<LiveEventIngestInterruption> ingestInterruptions) {
        this.ingestInterruptions = ingestInterruptions;
        return this;
    }

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