// 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.FilterTrackSelection;
import com.azure.resourcemanager.mediaservices.models.FirstQuality;
import com.azure.resourcemanager.mediaservices.models.PresentationTimeRange;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The Media Filter properties. */
@Fluent
public final class MediaFilterProperties {
    /*
     * The presentation time range.
     */
    @JsonProperty(value = "presentationTimeRange")
    private PresentationTimeRange presentationTimeRange;

    /*
     * The first quality.
     */
    @JsonProperty(value = "firstQuality")
    private FirstQuality firstQuality;

    /*
     * The tracks selection conditions.
     */
    @JsonProperty(value = "tracks")
    private List<FilterTrackSelection> tracks;

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

    /**
     * Get the presentationTimeRange property: The presentation time range.
     *
     * @return the presentationTimeRange value.
     */
    public PresentationTimeRange presentationTimeRange() {
        return this.presentationTimeRange;
    }

    /**
     * Set the presentationTimeRange property: The presentation time range.
     *
     * @param presentationTimeRange the presentationTimeRange value to set.
     * @return the MediaFilterProperties object itself.
     */
    public MediaFilterProperties withPresentationTimeRange(PresentationTimeRange presentationTimeRange) {
        this.presentationTimeRange = presentationTimeRange;
        return this;
    }

    /**
     * Get the firstQuality property: The first quality.
     *
     * @return the firstQuality value.
     */
    public FirstQuality firstQuality() {
        return this.firstQuality;
    }

    /**
     * Set the firstQuality property: The first quality.
     *
     * @param firstQuality the firstQuality value to set.
     * @return the MediaFilterProperties object itself.
     */
    public MediaFilterProperties withFirstQuality(FirstQuality firstQuality) {
        this.firstQuality = firstQuality;
        return this;
    }

    /**
     * Get the tracks property: The tracks selection conditions.
     *
     * @return the tracks value.
     */
    public List<FilterTrackSelection> tracks() {
        return this.tracks;
    }

    /**
     * Set the tracks property: The tracks selection conditions.
     *
     * @param tracks the tracks value to set.
     * @return the MediaFilterProperties object itself.
     */
    public MediaFilterProperties withTracks(List<FilterTrackSelection> tracks) {
        this.tracks = tracks;
        return this;
    }

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