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

/** Describes an Azure Data Lake Store output data source. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeName("Microsoft.DataLake/Accounts")
@Fluent
public final class AzureDataLakeStoreOutputDataSource extends OutputDataSource {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureDataLakeStoreOutputDataSource.class);

    /*
     * The properties that are associated with an Azure Data Lake Store output.
     * Required on PUT (CreateOrReplace) requests.
     */
    @JsonProperty(value = "properties")
    private AzureDataLakeStoreOutputDataSourceProperties innerProperties;

    /**
     * Get the innerProperties property: The properties that are associated with an Azure Data Lake Store output.
     * Required on PUT (CreateOrReplace) requests.
     *
     * @return the innerProperties value.
     */
    private AzureDataLakeStoreOutputDataSourceProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the accountName property: The name of the Azure Data Lake Store account. Required on PUT (CreateOrReplace)
     * requests.
     *
     * @return the accountName value.
     */
    public String accountName() {
        return this.innerProperties() == null ? null : this.innerProperties().accountName();
    }

    /**
     * Set the accountName property: The name of the Azure Data Lake Store account. Required on PUT (CreateOrReplace)
     * requests.
     *
     * @param accountName the accountName value to set.
     * @return the AzureDataLakeStoreOutputDataSource object itself.
     */
    public AzureDataLakeStoreOutputDataSource withAccountName(String accountName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AzureDataLakeStoreOutputDataSourceProperties();
        }
        this.innerProperties().withAccountName(accountName);
        return this;
    }

    /**
     * Get the tenantId property: The tenant id of the user used to obtain the refresh token. Required on PUT
     * (CreateOrReplace) requests.
     *
     * @return the tenantId value.
     */
    public String tenantId() {
        return this.innerProperties() == null ? null : this.innerProperties().tenantId();
    }

    /**
     * Set the tenantId property: The tenant id of the user used to obtain the refresh token. Required on PUT
     * (CreateOrReplace) requests.
     *
     * @param tenantId the tenantId value to set.
     * @return the AzureDataLakeStoreOutputDataSource object itself.
     */
    public AzureDataLakeStoreOutputDataSource withTenantId(String tenantId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AzureDataLakeStoreOutputDataSourceProperties();
        }
        this.innerProperties().withTenantId(tenantId);
        return this;
    }

    /**
     * Get the filePathPrefix property: The location of the file to which the output should be written to. Required on
     * PUT (CreateOrReplace) requests.
     *
     * @return the filePathPrefix value.
     */
    public String filePathPrefix() {
        return this.innerProperties() == null ? null : this.innerProperties().filePathPrefix();
    }

    /**
     * Set the filePathPrefix property: The location of the file to which the output should be written to. Required on
     * PUT (CreateOrReplace) requests.
     *
     * @param filePathPrefix the filePathPrefix value to set.
     * @return the AzureDataLakeStoreOutputDataSource object itself.
     */
    public AzureDataLakeStoreOutputDataSource withFilePathPrefix(String filePathPrefix) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AzureDataLakeStoreOutputDataSourceProperties();
        }
        this.innerProperties().withFilePathPrefix(filePathPrefix);
        return this;
    }

    /**
     * Get the dateFormat property: The date format. Wherever {date} appears in filePathPrefix, the value of this
     * property is used as the date format instead.
     *
     * @return the dateFormat value.
     */
    public String dateFormat() {
        return this.innerProperties() == null ? null : this.innerProperties().dateFormat();
    }

    /**
     * Set the dateFormat property: The date format. Wherever {date} appears in filePathPrefix, the value of this
     * property is used as the date format instead.
     *
     * @param dateFormat the dateFormat value to set.
     * @return the AzureDataLakeStoreOutputDataSource object itself.
     */
    public AzureDataLakeStoreOutputDataSource withDateFormat(String dateFormat) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AzureDataLakeStoreOutputDataSourceProperties();
        }
        this.innerProperties().withDateFormat(dateFormat);
        return this;
    }

    /**
     * Get the timeFormat property: The time format. Wherever {time} appears in filePathPrefix, the value of this
     * property is used as the time format instead.
     *
     * @return the timeFormat value.
     */
    public String timeFormat() {
        return this.innerProperties() == null ? null : this.innerProperties().timeFormat();
    }

    /**
     * Set the timeFormat property: The time format. Wherever {time} appears in filePathPrefix, the value of this
     * property is used as the time format instead.
     *
     * @param timeFormat the timeFormat value to set.
     * @return the AzureDataLakeStoreOutputDataSource object itself.
     */
    public AzureDataLakeStoreOutputDataSource withTimeFormat(String timeFormat) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AzureDataLakeStoreOutputDataSourceProperties();
        }
        this.innerProperties().withTimeFormat(timeFormat);
        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 AzureDataLakeStoreOutputDataSource object itself.
     */
    public AzureDataLakeStoreOutputDataSource withAuthenticationMode(AuthenticationMode authenticationMode) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AzureDataLakeStoreOutputDataSourceProperties();
        }
        this.innerProperties().withAuthenticationMode(authenticationMode);
        return this;
    }

    /**
     * Get the refreshToken property: A refresh token that can be used to obtain a valid access token that can then be
     * used to authenticate with the data source. A valid refresh token is currently only obtainable via the Azure
     * Portal. It is recommended to put a dummy string value here when creating the data source and then going to the
     * Azure Portal to authenticate the data source which will update this property with a valid refresh token. Required
     * on PUT (CreateOrReplace) requests.
     *
     * @return the refreshToken value.
     */
    public String refreshToken() {
        return this.innerProperties() == null ? null : this.innerProperties().refreshToken();
    }

    /**
     * Set the refreshToken property: A refresh token that can be used to obtain a valid access token that can then be
     * used to authenticate with the data source. A valid refresh token is currently only obtainable via the Azure
     * Portal. It is recommended to put a dummy string value here when creating the data source and then going to the
     * Azure Portal to authenticate the data source which will update this property with a valid refresh token. Required
     * on PUT (CreateOrReplace) requests.
     *
     * @param refreshToken the refreshToken value to set.
     * @return the AzureDataLakeStoreOutputDataSource object itself.
     */
    public AzureDataLakeStoreOutputDataSource withRefreshToken(String refreshToken) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AzureDataLakeStoreOutputDataSourceProperties();
        }
        this.innerProperties().withRefreshToken(refreshToken);
        return this;
    }

    /**
     * Get the tokenUserPrincipalName property: The user principal name (UPN) of the user that was used to obtain the
     * refresh token. Use this property to help remember which user was used to obtain the refresh token.
     *
     * @return the tokenUserPrincipalName value.
     */
    public String tokenUserPrincipalName() {
        return this.innerProperties() == null ? null : this.innerProperties().tokenUserPrincipalName();
    }

    /**
     * Set the tokenUserPrincipalName property: The user principal name (UPN) of the user that was used to obtain the
     * refresh token. Use this property to help remember which user was used to obtain the refresh token.
     *
     * @param tokenUserPrincipalName the tokenUserPrincipalName value to set.
     * @return the AzureDataLakeStoreOutputDataSource object itself.
     */
    public AzureDataLakeStoreOutputDataSource withTokenUserPrincipalName(String tokenUserPrincipalName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AzureDataLakeStoreOutputDataSourceProperties();
        }
        this.innerProperties().withTokenUserPrincipalName(tokenUserPrincipalName);
        return this;
    }

    /**
     * Get the tokenUserDisplayName property: The user display name of the user that was used to obtain the refresh
     * token. Use this property to help remember which user was used to obtain the refresh token.
     *
     * @return the tokenUserDisplayName value.
     */
    public String tokenUserDisplayName() {
        return this.innerProperties() == null ? null : this.innerProperties().tokenUserDisplayName();
    }

    /**
     * Set the tokenUserDisplayName property: The user display name of the user that was used to obtain the refresh
     * token. Use this property to help remember which user was used to obtain the refresh token.
     *
     * @param tokenUserDisplayName the tokenUserDisplayName value to set.
     * @return the AzureDataLakeStoreOutputDataSource object itself.
     */
    public AzureDataLakeStoreOutputDataSource withTokenUserDisplayName(String tokenUserDisplayName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AzureDataLakeStoreOutputDataSourceProperties();
        }
        this.innerProperties().withTokenUserDisplayName(tokenUserDisplayName);
        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();
        }
    }
}
