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

package com.azure.resourcemanager.videoanalyzer.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/** Describes a built-in preset for encoding the input content using the encoder processor. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@type")
@JsonTypeName("#Microsoft.VideoAnalyzer.EncoderSystemPreset")
@Fluent
public final class EncoderSystemPreset extends EncoderPresetBase {
    /*
     * Name of the built-in encoding preset.
     */
    @JsonProperty(value = "name", required = true)
    private EncoderSystemPresetType name;

    /**
     * Get the name property: Name of the built-in encoding preset.
     *
     * @return the name value.
     */
    public EncoderSystemPresetType name() {
        return this.name;
    }

    /**
     * Set the name property: Name of the built-in encoding preset.
     *
     * @param name the name value to set.
     * @return the EncoderSystemPreset object itself.
     */
    public EncoderSystemPreset withName(EncoderSystemPresetType name) {
        this.name = name;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (name() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property name in model EncoderSystemPreset"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(EncoderSystemPreset.class);
}
