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

/** The endpoint details. */
@Fluent
public final class Endpoint {
    /*
     * The URL of the endpoint.
     */
    @JsonProperty(value = "endpointUrl")
    private String endpointUrl;

    /*
     * The type of the endpoint.
     */
    @JsonProperty(value = "type", required = true)
    private VideoAnalyzerEndpointType type;

    /**
     * Get the endpointUrl property: The URL of the endpoint.
     *
     * @return the endpointUrl value.
     */
    public String endpointUrl() {
        return this.endpointUrl;
    }

    /**
     * Set the endpointUrl property: The URL of the endpoint.
     *
     * @param endpointUrl the endpointUrl value to set.
     * @return the Endpoint object itself.
     */
    public Endpoint withEndpointUrl(String endpointUrl) {
        this.endpointUrl = endpointUrl;
        return this;
    }

    /**
     * Get the type property: The type of the endpoint.
     *
     * @return the type value.
     */
    public VideoAnalyzerEndpointType type() {
        return this.type;
    }

    /**
     * Set the type property: The type of the endpoint.
     *
     * @param type the type value to set.
     * @return the Endpoint object itself.
     */
    public Endpoint withType(VideoAnalyzerEndpointType type) {
        this.type = type;
        return this;
    }

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

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