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

/**
 * Motion detection processor allows for motion detection on the video stream. It generates motion events whenever
 * motion is present on the video.
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@type")
@JsonTypeName("#Microsoft.VideoAnalyzer.MotionDetectionProcessor")
@Fluent
public final class MotionDetectionProcessor extends ProcessorNodeBase {
    /*
     * Motion detection sensitivity: low, medium, high.
     */
    @JsonProperty(value = "sensitivity")
    private MotionDetectionSensitivity sensitivity;

    /*
     * Indicates whether the processor should detect and output the regions
     * within the video frame where motion was detected. Default is true.
     */
    @JsonProperty(value = "outputMotionRegion")
    private Boolean outputMotionRegion;

    /*
     * Time window duration on which events are aggregated before being
     * emitted. Value must be specified in ISO8601 duration format (i.e. "PT2S"
     * equals 2 seconds). Use 0 seconds for no aggregation. Default is 1
     * second.
     */
    @JsonProperty(value = "eventAggregationWindow")
    private String eventAggregationWindow;

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

    /**
     * Get the sensitivity property: Motion detection sensitivity: low, medium, high.
     *
     * @return the sensitivity value.
     */
    public MotionDetectionSensitivity getSensitivity() {
        return this.sensitivity;
    }

    /**
     * Set the sensitivity property: Motion detection sensitivity: low, medium, high.
     *
     * @param sensitivity the sensitivity value to set.
     * @return the MotionDetectionProcessor object itself.
     */
    public MotionDetectionProcessor setSensitivity(MotionDetectionSensitivity sensitivity) {
        this.sensitivity = sensitivity;
        return this;
    }

    /**
     * Get the outputMotionRegion property: Indicates whether the processor should detect and output the regions within
     * the video frame where motion was detected. Default is true.
     *
     * @return the outputMotionRegion value.
     */
    public Boolean isOutputMotionRegion() {
        return this.outputMotionRegion;
    }

    /**
     * Set the outputMotionRegion property: Indicates whether the processor should detect and output the regions within
     * the video frame where motion was detected. Default is true.
     *
     * @param outputMotionRegion the outputMotionRegion value to set.
     * @return the MotionDetectionProcessor object itself.
     */
    public MotionDetectionProcessor setOutputMotionRegion(Boolean outputMotionRegion) {
        this.outputMotionRegion = outputMotionRegion;
        return this;
    }

    /**
     * Get the eventAggregationWindow property: Time window duration on which events are aggregated before being
     * emitted. Value must be specified in ISO8601 duration format (i.e. "PT2S" equals 2 seconds). Use 0 seconds for no
     * aggregation. Default is 1 second.
     *
     * @return the eventAggregationWindow value.
     */
    public String getEventAggregationWindow() {
        return this.eventAggregationWindow;
    }

    /**
     * Set the eventAggregationWindow property: Time window duration on which events are aggregated before being
     * emitted. Value must be specified in ISO8601 duration format (i.e. "PT2S" equals 2 seconds). Use 0 seconds for no
     * aggregation. Default is 1 second.
     *
     * @param eventAggregationWindow the eventAggregationWindow value to set.
     * @return the MotionDetectionProcessor object itself.
     */
    public MotionDetectionProcessor setEventAggregationWindow(String eventAggregationWindow) {
        this.eventAggregationWindow = eventAggregationWindow;
        return this;
    }
}
