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

package com.azure.media.videoanalyzer.edge.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/** Enables a pipeline topology to record media to an Azure Media Services asset for subsequent playback. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@type")
@JsonTypeName("#Microsoft.VideoAnalyzer.AssetSink")
@Fluent
public final class AssetSink extends SinkNodeBase {
    /*
     * An Azure Storage SAS Url which points to container, such as the one
     * created for an Azure Media Services asset.
     */
    @JsonProperty(value = "assetContainerSasUrl", required = true)
    private String assetContainerSasUrl;

    /*
     * When writing media to an asset, wait until at least this duration of
     * media has been accumulated on the Edge. Expressed in increments of 30
     * seconds, with a minimum of 30 seconds and a recommended maximum of 5
     * minutes.
     */
    @JsonProperty(value = "segmentLength")
    private String segmentLength;

    /*
     * Path to a local file system directory for temporary caching of media
     * before writing to an Asset. Used when the Edge device is temporarily
     * disconnected from Azure.
     */
    @JsonProperty(value = "localMediaCachePath", required = true)
    private String localMediaCachePath;

    /*
     * Maximum amount of disk space that can be used for temporary caching of
     * media.
     */
    @JsonProperty(value = "localMediaCacheMaximumSizeMiB", required = true)
    private String localMediaCacheMaximumSizeMiB;

    /**
     * Creates an instance of AssetSink class.
     *
     * @param name the name value to set.
     * @param inputs the inputs value to set.
     * @param assetContainerSasUrl the assetContainerSasUrl value to set.
     * @param localMediaCachePath the localMediaCachePath value to set.
     * @param localMediaCacheMaximumSizeMiB the localMediaCacheMaximumSizeMiB value to set.
     */
    @JsonCreator
    public AssetSink(
            @JsonProperty(value = "name", required = true) String name,
            @JsonProperty(value = "inputs", required = true) List<NodeInput> inputs,
            @JsonProperty(value = "assetContainerSasUrl", required = true) String assetContainerSasUrl,
            @JsonProperty(value = "localMediaCachePath", required = true) String localMediaCachePath,
            @JsonProperty(value = "localMediaCacheMaximumSizeMiB", required = true)
                    String localMediaCacheMaximumSizeMiB) {
        super(name, inputs);
        this.assetContainerSasUrl = assetContainerSasUrl;
        this.localMediaCachePath = localMediaCachePath;
        this.localMediaCacheMaximumSizeMiB = localMediaCacheMaximumSizeMiB;
    }

    /**
     * Get the assetContainerSasUrl property: An Azure Storage SAS Url which points to container, such as the one
     * created for an Azure Media Services asset.
     *
     * @return the assetContainerSasUrl value.
     */
    public String getAssetContainerSasUrl() {
        return this.assetContainerSasUrl;
    }

    /**
     * Get the segmentLength property: When writing media to an asset, wait until at least this duration of media has
     * been accumulated on the Edge. Expressed in increments of 30 seconds, with a minimum of 30 seconds and a
     * recommended maximum of 5 minutes.
     *
     * @return the segmentLength value.
     */
    public String getSegmentLength() {
        return this.segmentLength;
    }

    /**
     * Set the segmentLength property: When writing media to an asset, wait until at least this duration of media has
     * been accumulated on the Edge. Expressed in increments of 30 seconds, with a minimum of 30 seconds and a
     * recommended maximum of 5 minutes.
     *
     * @param segmentLength the segmentLength value to set.
     * @return the AssetSink object itself.
     */
    public AssetSink setSegmentLength(String segmentLength) {
        this.segmentLength = segmentLength;
        return this;
    }

    /**
     * Get the localMediaCachePath property: Path to a local file system directory for temporary caching of media before
     * writing to an Asset. Used when the Edge device is temporarily disconnected from Azure.
     *
     * @return the localMediaCachePath value.
     */
    public String getLocalMediaCachePath() {
        return this.localMediaCachePath;
    }

    /**
     * Get the localMediaCacheMaximumSizeMiB property: Maximum amount of disk space that can be used for temporary
     * caching of media.
     *
     * @return the localMediaCacheMaximumSizeMiB value.
     */
    public String getLocalMediaCacheMaximumSizeMiB() {
        return this.localMediaCacheMaximumSizeMiB;
    }
}
