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

package com.azure.resourcemanager.digitaltwins.models;

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

/** Properties related to ServiceBus. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType")
@JsonTypeName("ServiceBus")
@Fluent
public final class ServiceBus extends DigitalTwinsEndpointResourceProperties {
    /*
     * PrimaryConnectionString of the endpoint for key-based authentication. Will be obfuscated during read.
     */
    @JsonProperty(value = "primaryConnectionString")
    private String primaryConnectionString;

    /*
     * SecondaryConnectionString of the endpoint for key-based authentication. Will be obfuscated during read.
     */
    @JsonProperty(value = "secondaryConnectionString")
    private String secondaryConnectionString;

    /*
     * The URL of the ServiceBus namespace for identity-based authentication. It must include the protocol 'sb://'.
     */
    @JsonProperty(value = "endpointUri")
    private String endpointUri;

    /*
     * The ServiceBus Topic name for identity-based authentication.
     */
    @JsonProperty(value = "entityPath")
    private String entityPath;

    /** Creates an instance of ServiceBus class. */
    public ServiceBus() {
    }

    /**
     * Get the primaryConnectionString property: PrimaryConnectionString of the endpoint for key-based authentication.
     * Will be obfuscated during read.
     *
     * @return the primaryConnectionString value.
     */
    public String primaryConnectionString() {
        return this.primaryConnectionString;
    }

    /**
     * Set the primaryConnectionString property: PrimaryConnectionString of the endpoint for key-based authentication.
     * Will be obfuscated during read.
     *
     * @param primaryConnectionString the primaryConnectionString value to set.
     * @return the ServiceBus object itself.
     */
    public ServiceBus withPrimaryConnectionString(String primaryConnectionString) {
        this.primaryConnectionString = primaryConnectionString;
        return this;
    }

    /**
     * Get the secondaryConnectionString property: SecondaryConnectionString of the endpoint for key-based
     * authentication. Will be obfuscated during read.
     *
     * @return the secondaryConnectionString value.
     */
    public String secondaryConnectionString() {
        return this.secondaryConnectionString;
    }

    /**
     * Set the secondaryConnectionString property: SecondaryConnectionString of the endpoint for key-based
     * authentication. Will be obfuscated during read.
     *
     * @param secondaryConnectionString the secondaryConnectionString value to set.
     * @return the ServiceBus object itself.
     */
    public ServiceBus withSecondaryConnectionString(String secondaryConnectionString) {
        this.secondaryConnectionString = secondaryConnectionString;
        return this;
    }

    /**
     * Get the endpointUri property: The URL of the ServiceBus namespace for identity-based authentication. It must
     * include the protocol 'sb://'.
     *
     * @return the endpointUri value.
     */
    public String endpointUri() {
        return this.endpointUri;
    }

    /**
     * Set the endpointUri property: The URL of the ServiceBus namespace for identity-based authentication. It must
     * include the protocol 'sb://'.
     *
     * @param endpointUri the endpointUri value to set.
     * @return the ServiceBus object itself.
     */
    public ServiceBus withEndpointUri(String endpointUri) {
        this.endpointUri = endpointUri;
        return this;
    }

    /**
     * Get the entityPath property: The ServiceBus Topic name for identity-based authentication.
     *
     * @return the entityPath value.
     */
    public String entityPath() {
        return this.entityPath;
    }

    /**
     * Set the entityPath property: The ServiceBus Topic name for identity-based authentication.
     *
     * @param entityPath the entityPath value to set.
     * @return the ServiceBus object itself.
     */
    public ServiceBus withEntityPath(String entityPath) {
        this.entityPath = entityPath;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ServiceBus withAuthenticationType(AuthenticationType authenticationType) {
        super.withAuthenticationType(authenticationType);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ServiceBus withDeadLetterSecret(String deadLetterSecret) {
        super.withDeadLetterSecret(deadLetterSecret);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ServiceBus withDeadLetterUri(String deadLetterUri) {
        super.withDeadLetterUri(deadLetterUri);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ServiceBus withIdentity(ManagedIdentityReference identity) {
        super.withIdentity(identity);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
    }
}
