SearchIndexRestClientImpl.java

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

package com.azure.search.documents.implementation;
import com.azure.core.util.serializer.JacksonAdapter;
import com.azure.core.util.serializer.SerializerAdapter;

import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.policy.CookiePolicy;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;

/**
 * Initializes a new instance of the SearchIndexRestClient type.
 */
public final class SearchIndexRestClientImpl {
    /**
     * Client Api Version.
     */
    private String apiVersion;

    /**
     * Gets Client Api Version.
     *
     * @return the apiVersion value.
     */
    public String getApiVersion() {
        return this.apiVersion;
    }

    /**
     * Sets Client Api Version.
     *
     * @param apiVersion the apiVersion value.
     */
    SearchIndexRestClientImpl setApiVersion(String apiVersion) {
        this.apiVersion = apiVersion;
        return this;
    }

    /**
     * The endpoint URL of the search service.
     */
    private String endpoint;

    /**
     * Gets The endpoint URL of the search service.
     *
     * @return the endpoint value.
     */
    public String getEndpoint() {
        return this.endpoint;
    }

    /**
     * Sets The endpoint URL of the search service.
     *
     * @param endpoint the endpoint value.
     */
    SearchIndexRestClientImpl setEndpoint(String endpoint) {
        this.endpoint = endpoint;
        return this;
    }

    /**
     * The name of the index.
     */
    private String indexName;

    /**
     * Gets The name of the index.
     *
     * @return the indexName value.
     */
    public String getIndexName() {
        return this.indexName;
    }

    /**
     * Sets The name of the index.
     *
     * @param indexName the indexName value.
     */
    SearchIndexRestClientImpl setIndexName(String indexName) {
        this.indexName = indexName;
        return this;
    }

    /**
     * The HTTP pipeline to send requests through.
     */
    private HttpPipeline httpPipeline;

    /**
     * Gets The HTTP pipeline to send requests through.
     *
     * @return the httpPipeline value.
     */
    public HttpPipeline getHttpPipeline() {
        return this.httpPipeline;
    }

    /**
     * The DocumentsImpl object to access its operations.
     */
    private DocumentsImpl documents;

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

    /**
     * Initializes an instance of SearchIndexRestClient client.
     */
    public SearchIndexRestClientImpl() {
        this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()).build(), new JacksonAdapter());
    }

    /**
     * Initializes an instance of SearchIndexRestClient client.
     *
     * @param httpPipeline The HTTP pipeline to send requests through.
     * @param serializer the serializer to be used for service client requests.
     */
    public SearchIndexRestClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializer) {
        this.httpPipeline = httpPipeline;
        this.documents = new DocumentsImpl(this, serializer);
    }
}