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

package com.azure.resourcemanager.streamanalytics.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.streamanalytics.fluent.models.ServiceBusQueueOutputDataSourceProperties;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/** Describes a Service Bus Queue output data source. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeName("Microsoft.ServiceBus/Queue")
@Fluent
public final class ServiceBusQueueOutputDataSource extends OutputDataSource {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceBusQueueOutputDataSource.class);

    /*
     * The properties that are associated with a Service Bus Queue output.
     * Required on PUT (CreateOrReplace) requests.
     */
    @JsonProperty(value = "properties")
    private ServiceBusQueueOutputDataSourceProperties innerProperties;

    /**
     * Get the innerProperties property: The properties that are associated with a Service Bus Queue output. Required on
     * PUT (CreateOrReplace) requests.
     *
     * @return the innerProperties value.
     */
    private ServiceBusQueueOutputDataSourceProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the queueName property: The name of the Service Bus Queue. Required on PUT (CreateOrReplace) requests.
     *
     * @return the queueName value.
     */
    public String queueName() {
        return this.innerProperties() == null ? null : this.innerProperties().queueName();
    }

    /**
     * Set the queueName property: The name of the Service Bus Queue. Required on PUT (CreateOrReplace) requests.
     *
     * @param queueName the queueName value to set.
     * @return the ServiceBusQueueOutputDataSource object itself.
     */
    public ServiceBusQueueOutputDataSource withQueueName(String queueName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ServiceBusQueueOutputDataSourceProperties();
        }
        this.innerProperties().withQueueName(queueName);
        return this;
    }

    /**
     * Get the propertyColumns property: A string array of the names of output columns to be attached to Service Bus
     * messages as custom properties.
     *
     * @return the propertyColumns value.
     */
    public List<String> propertyColumns() {
        return this.innerProperties() == null ? null : this.innerProperties().propertyColumns();
    }

    /**
     * Set the propertyColumns property: A string array of the names of output columns to be attached to Service Bus
     * messages as custom properties.
     *
     * @param propertyColumns the propertyColumns value to set.
     * @return the ServiceBusQueueOutputDataSource object itself.
     */
    public ServiceBusQueueOutputDataSource withPropertyColumns(List<String> propertyColumns) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ServiceBusQueueOutputDataSourceProperties();
        }
        this.innerProperties().withPropertyColumns(propertyColumns);
        return this;
    }

    /**
     * Get the systemPropertyColumns property: The system properties associated with the Service Bus Queue. The
     * following system properties are supported: ReplyToSessionId, ContentType, To, Subject, CorrelationId, TimeToLive,
     * PartitionKey, SessionId, ScheduledEnqueueTime, MessageId, ReplyTo, Label, ScheduledEnqueueTimeUtc.
     *
     * @return the systemPropertyColumns value.
     */
    public Object systemPropertyColumns() {
        return this.innerProperties() == null ? null : this.innerProperties().systemPropertyColumns();
    }

    /**
     * Set the systemPropertyColumns property: The system properties associated with the Service Bus Queue. The
     * following system properties are supported: ReplyToSessionId, ContentType, To, Subject, CorrelationId, TimeToLive,
     * PartitionKey, SessionId, ScheduledEnqueueTime, MessageId, ReplyTo, Label, ScheduledEnqueueTimeUtc.
     *
     * @param systemPropertyColumns the systemPropertyColumns value to set.
     * @return the ServiceBusQueueOutputDataSource object itself.
     */
    public ServiceBusQueueOutputDataSource withSystemPropertyColumns(Object systemPropertyColumns) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ServiceBusQueueOutputDataSourceProperties();
        }
        this.innerProperties().withSystemPropertyColumns(systemPropertyColumns);
        return this;
    }

    /**
     * Get the serviceBusNamespace property: The namespace that is associated with the desired Event Hub, Service Bus
     * Queue, Service Bus Topic, etc. Required on PUT (CreateOrReplace) requests.
     *
     * @return the serviceBusNamespace value.
     */
    public String serviceBusNamespace() {
        return this.innerProperties() == null ? null : this.innerProperties().serviceBusNamespace();
    }

    /**
     * Set the serviceBusNamespace property: The namespace that is associated with the desired Event Hub, Service Bus
     * Queue, Service Bus Topic, etc. Required on PUT (CreateOrReplace) requests.
     *
     * @param serviceBusNamespace the serviceBusNamespace value to set.
     * @return the ServiceBusQueueOutputDataSource object itself.
     */
    public ServiceBusQueueOutputDataSource withServiceBusNamespace(String serviceBusNamespace) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ServiceBusQueueOutputDataSourceProperties();
        }
        this.innerProperties().withServiceBusNamespace(serviceBusNamespace);
        return this;
    }

    /**
     * Get the sharedAccessPolicyName property: The shared access policy name for the Event Hub, Service Bus Queue,
     * Service Bus Topic, etc. Required on PUT (CreateOrReplace) requests.
     *
     * @return the sharedAccessPolicyName value.
     */
    public String sharedAccessPolicyName() {
        return this.innerProperties() == null ? null : this.innerProperties().sharedAccessPolicyName();
    }

    /**
     * Set the sharedAccessPolicyName property: The shared access policy name for the Event Hub, Service Bus Queue,
     * Service Bus Topic, etc. Required on PUT (CreateOrReplace) requests.
     *
     * @param sharedAccessPolicyName the sharedAccessPolicyName value to set.
     * @return the ServiceBusQueueOutputDataSource object itself.
     */
    public ServiceBusQueueOutputDataSource withSharedAccessPolicyName(String sharedAccessPolicyName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ServiceBusQueueOutputDataSourceProperties();
        }
        this.innerProperties().withSharedAccessPolicyName(sharedAccessPolicyName);
        return this;
    }

    /**
     * Get the sharedAccessPolicyKey property: The shared access policy key for the specified shared access policy.
     * Required on PUT (CreateOrReplace) requests.
     *
     * @return the sharedAccessPolicyKey value.
     */
    public String sharedAccessPolicyKey() {
        return this.innerProperties() == null ? null : this.innerProperties().sharedAccessPolicyKey();
    }

    /**
     * Set the sharedAccessPolicyKey property: The shared access policy key for the specified shared access policy.
     * Required on PUT (CreateOrReplace) requests.
     *
     * @param sharedAccessPolicyKey the sharedAccessPolicyKey value to set.
     * @return the ServiceBusQueueOutputDataSource object itself.
     */
    public ServiceBusQueueOutputDataSource withSharedAccessPolicyKey(String sharedAccessPolicyKey) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ServiceBusQueueOutputDataSourceProperties();
        }
        this.innerProperties().withSharedAccessPolicyKey(sharedAccessPolicyKey);
        return this;
    }

    /**
     * Get the authenticationMode property: Authentication Mode.
     *
     * @return the authenticationMode value.
     */
    public AuthenticationMode authenticationMode() {
        return this.innerProperties() == null ? null : this.innerProperties().authenticationMode();
    }

    /**
     * Set the authenticationMode property: Authentication Mode.
     *
     * @param authenticationMode the authenticationMode value to set.
     * @return the ServiceBusQueueOutputDataSource object itself.
     */
    public ServiceBusQueueOutputDataSource withAuthenticationMode(AuthenticationMode authenticationMode) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ServiceBusQueueOutputDataSourceProperties();
        }
        this.innerProperties().withAuthenticationMode(authenticationMode);
        return this;
    }

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