IntegrationRuntimesClient.java

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

package com.azure.analytics.synapse.artifacts;

import com.azure.analytics.synapse.artifacts.implementation.IntegrationRuntimesImpl;
import com.azure.analytics.synapse.artifacts.models.ErrorContractException;
import com.azure.analytics.synapse.artifacts.models.IntegrationRuntimeListResponse;
import com.azure.analytics.synapse.artifacts.models.IntegrationRuntimeResource;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;

/** Initializes a new instance of the synchronous ArtifactsClient type. */
@ServiceClient(builder = ArtifactsClientBuilder.class)
public final class IntegrationRuntimesClient {
    private final IntegrationRuntimesImpl serviceClient;

    /**
     * Initializes an instance of IntegrationRuntimes client.
     *
     * @param serviceClient the service client implementation.
     */
    IntegrationRuntimesClient(IntegrationRuntimesImpl serviceClient) {
        this.serviceClient = serviceClient;
    }

    /**
     * List Integration Runtimes.
     *
     * @throws ErrorContractException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of integration runtime resources.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public IntegrationRuntimeListResponse list() {
        return this.serviceClient.list();
    }

    /**
     * List Integration Runtimes.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorContractException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of integration runtime resources.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<IntegrationRuntimeListResponse> listWithResponse(Context context) {
        return this.serviceClient.listWithResponse(context);
    }

    /**
     * Get Integration Runtime.
     *
     * @param integrationRuntimeName The Integration Runtime name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorContractException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return integration Runtime.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public IntegrationRuntimeResource get(String integrationRuntimeName) {
        return this.serviceClient.get(integrationRuntimeName);
    }

    /**
     * Get Integration Runtime.
     *
     * @param integrationRuntimeName The Integration Runtime name.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorContractException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return integration Runtime.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<IntegrationRuntimeResource> getWithResponse(String integrationRuntimeName, Context context) {
        return this.serviceClient.getWithResponse(integrationRuntimeName, context);
    }
}