/**
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 */

package com.microsoft.azure.cognitiveservices.language.luis.authoring.implementation;

import com.microsoft.azure.AzureClient;
import com.microsoft.azure.AzureServiceClient;
import com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps;
import com.microsoft.azure.cognitiveservices.language.luis.authoring.AzureAccounts;
import com.microsoft.azure.cognitiveservices.language.luis.authoring.Examples;
import com.microsoft.azure.cognitiveservices.language.luis.authoring.Features;
import com.microsoft.azure.cognitiveservices.language.luis.authoring.LUISAuthoringClient;
import com.microsoft.azure.cognitiveservices.language.luis.authoring.Models;
import com.microsoft.azure.cognitiveservices.language.luis.authoring.Patterns;
import com.microsoft.azure.cognitiveservices.language.luis.authoring.Settings;
import com.microsoft.azure.cognitiveservices.language.luis.authoring.Trains;
import com.microsoft.azure.cognitiveservices.language.luis.authoring.Versions;
import com.microsoft.rest.credentials.ServiceClientCredentials;
import com.microsoft.rest.RestClient;

/**
 * Initializes a new instance of the LUISAuthoringClientImpl class.
 */
public class LUISAuthoringClientImpl extends AzureServiceClient implements LUISAuthoringClient {
    /** the {@link AzureClient} used for long running operations. */
    private AzureClient azureClient;

    /**
     * Gets the {@link AzureClient} used for long running operations.
     * @return the azure client;
     */
    public AzureClient getAzureClient() {
        return this.azureClient;
    }

    /** Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). */
    private String endpoint;

    /**
     * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).
     *
     * @return the endpoint value.
     */
    public String endpoint() {
        return this.endpoint;
    }

    /**
     * Sets Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).
     *
     * @param endpoint the endpoint value.
     * @return the service client itself
     */
    public LUISAuthoringClientImpl withEndpoint(String endpoint) {
        this.endpoint = endpoint;
        return this;
    }

    /** Gets or sets the preferred language for the response. */
    private String acceptLanguage;

    /**
     * Gets Gets or sets the preferred language for the response.
     *
     * @return the acceptLanguage value.
     */
    public String acceptLanguage() {
        return this.acceptLanguage;
    }

    /**
     * Sets Gets or sets the preferred language for the response.
     *
     * @param acceptLanguage the acceptLanguage value.
     * @return the service client itself
     */
    public LUISAuthoringClientImpl withAcceptLanguage(String acceptLanguage) {
        this.acceptLanguage = acceptLanguage;
        return this;
    }

    /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */
    private int longRunningOperationRetryTimeout;

    /**
     * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
     *
     * @return the longRunningOperationRetryTimeout value.
     */
    public int longRunningOperationRetryTimeout() {
        return this.longRunningOperationRetryTimeout;
    }

    /**
     * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
     *
     * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value.
     * @return the service client itself
     */
    public LUISAuthoringClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) {
        this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout;
        return this;
    }

    /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */
    private boolean generateClientRequestId;

    /**
     * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
     *
     * @return the generateClientRequestId value.
     */
    public boolean generateClientRequestId() {
        return this.generateClientRequestId;
    }

    /**
     * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
     *
     * @param generateClientRequestId the generateClientRequestId value.
     * @return the service client itself
     */
    public LUISAuthoringClientImpl withGenerateClientRequestId(boolean generateClientRequestId) {
        this.generateClientRequestId = generateClientRequestId;
        return this;
    }

    /**
     * The Features object to access its operations.
     */
    private Features features;

    /**
     * Gets the Features object to access its operations.
     * @return the Features object.
     */
    public Features features() {
        return this.features;
    }

    /**
     * The Examples object to access its operations.
     */
    private Examples examples;

    /**
     * Gets the Examples object to access its operations.
     * @return the Examples object.
     */
    public Examples examples() {
        return this.examples;
    }

    /**
     * The Models object to access its operations.
     */
    private Models models;

    /**
     * Gets the Models object to access its operations.
     * @return the Models object.
     */
    public Models models() {
        return this.models;
    }

    /**
     * The Apps object to access its operations.
     */
    private Apps apps;

    /**
     * Gets the Apps object to access its operations.
     * @return the Apps object.
     */
    public Apps apps() {
        return this.apps;
    }

    /**
     * The Versions object to access its operations.
     */
    private Versions versions;

    /**
     * Gets the Versions object to access its operations.
     * @return the Versions object.
     */
    public Versions versions() {
        return this.versions;
    }

    /**
     * The Trains object to access its operations.
     */
    private Trains trains;

    /**
     * Gets the Trains object to access its operations.
     * @return the Trains object.
     */
    public Trains trains() {
        return this.trains;
    }

    /**
     * The Patterns object to access its operations.
     */
    private Patterns patterns;

    /**
     * Gets the Patterns object to access its operations.
     * @return the Patterns object.
     */
    public Patterns patterns() {
        return this.patterns;
    }

    /**
     * The Settings object to access its operations.
     */
    private Settings settings;

    /**
     * Gets the Settings object to access its operations.
     * @return the Settings object.
     */
    public Settings settings() {
        return this.settings;
    }

    /**
     * The AzureAccounts object to access its operations.
     */
    private AzureAccounts azureAccounts;

    /**
     * Gets the AzureAccounts object to access its operations.
     * @return the AzureAccounts object.
     */
    public AzureAccounts azureAccounts() {
        return this.azureAccounts;
    }

    /**
     * Initializes an instance of LUISAuthoringClient client.
     *
     * @param credentials the management credentials for Azure
     */
    public LUISAuthoringClientImpl(ServiceClientCredentials credentials) {
        this("https://{Endpoint}/luis/authoring/v3.0-preview", credentials);
    }

    /**
     * Initializes an instance of LUISAuthoringClient client.
     *
     * @param baseUrl the base URL of the host
     * @param credentials the management credentials for Azure
     */
    public LUISAuthoringClientImpl(String baseUrl, ServiceClientCredentials credentials) {
        super(baseUrl, credentials);
        initialize();
    }

    /**
     * Initializes an instance of LUISAuthoringClient client.
     *
     * @param restClient the REST client to connect to Azure.
     */
    public LUISAuthoringClientImpl(RestClient restClient) {
        super(restClient);
        initialize();
    }

    protected void initialize() {
        this.acceptLanguage = "en-US";
        this.longRunningOperationRetryTimeout = 30;
        this.generateClientRequestId = true;
        this.features = new FeaturesImpl(restClient().retrofit(), this);
        this.examples = new ExamplesImpl(restClient().retrofit(), this);
        this.models = new ModelsImpl(restClient().retrofit(), this);
        this.apps = new AppsImpl(restClient().retrofit(), this);
        this.versions = new VersionsImpl(restClient().retrofit(), this);
        this.trains = new TrainsImpl(restClient().retrofit(), this);
        this.patterns = new PatternsImpl(restClient().retrofit(), this);
        this.settings = new SettingsImpl(restClient().retrofit(), this);
        this.azureAccounts = new AzureAccountsImpl(restClient().retrofit(), this);
        this.azureClient = new AzureClient(this);
    }

    /**
     * Gets the User-Agent header for the client.
     *
     * @return the user agent string.
     */
    @Override
    public String userAgent() {
        return String.format("%s (%s, %s)", super.userAgent(), "LUISAuthoringClient", "3.0-preview");
    }
}
