// 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.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/** Base class for endpoints. */
@JsonTypeInfo(
        use = JsonTypeInfo.Id.NAME,
        include = JsonTypeInfo.As.PROPERTY,
        property = "@type",
        defaultImpl = EndpointBase.class)
@JsonTypeName("EndpointBase")
@JsonSubTypes({
    @JsonSubTypes.Type(name = "#Microsoft.VideoAnalyzer.UnsecuredEndpoint", value = UnsecuredEndpoint.class),
    @JsonSubTypes.Type(name = "#Microsoft.VideoAnalyzer.TlsEndpoint", value = TlsEndpoint.class)
})
@Fluent
public class EndpointBase {
    /*
     * Credentials to be presented to the endpoint.
     */
    @JsonProperty(value = "credentials")
    private CredentialsBase credentials;

    /*
     * The endpoint URL for Video Analyzer to connect to.
     */
    @JsonProperty(value = "url", required = true)
    private String url;

    /**
     * Creates an instance of EndpointBase class.
     *
     * @param url the url value to set.
     */
    @JsonCreator
    public EndpointBase(@JsonProperty(value = "url", required = true) String url) {
        this.url = url;
    }

    /**
     * Get the credentials property: Credentials to be presented to the endpoint.
     *
     * @return the credentials value.
     */
    public CredentialsBase getCredentials() {
        return this.credentials;
    }

    /**
     * Set the credentials property: Credentials to be presented to the endpoint.
     *
     * @param credentials the credentials value to set.
     * @return the EndpointBase object itself.
     */
    public EndpointBase setCredentials(CredentialsBase credentials) {
        this.credentials = credentials;
        return this;
    }

    /**
     * Get the url property: The endpoint URL for Video Analyzer to connect to.
     *
     * @return the url value.
     */
    public String getUrl() {
        return this.url;
    }
}
