All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.clinia.api.DatacatalogClient Maven / Gradle / Ivy

// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost
// - read more on https://github.com/clinia/api-clients-generation. DO NOT EDIT.

package com.clinia.api;

import com.clinia.ApiClient;
import com.clinia.config.*;
import com.clinia.config.ClientOptions;
import com.clinia.exceptions.*;
import com.clinia.model.common.*;
import com.clinia.model.datacatalog.*;
import com.clinia.utils.*;
import com.fasterxml.jackson.core.type.TypeReference;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import javax.annotation.Nonnull;

public class DatacatalogClient extends ApiClient {

  public DatacatalogClient(String workspaceId, String apiKey) {
    this(workspaceId, apiKey, null);
  }

  public DatacatalogClient(String workspaceId, String apiKey, ClientOptions options) {
    super(workspaceId, apiKey, "Datacatalog", options, getDefaultHosts(workspaceId));
  }

  private static List getDefaultHosts(String workspaceId) {
    List hosts = new ArrayList<>();
    hosts.add(new Host("api." + workspaceId + ".clinia.cloud", EnumSet.of(CallType.READ)));
    hosts.add(new Host("api." + workspaceId + ".clinia.cloud", EnumSet.of(CallType.WRITE)));

    return hosts;
  }

  /**
   * Create a Connection for a data source.
   *
   * @param sourceKey The key of the source. (required)
   * @param v1Connection (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public V1Connection createConnection(@Nonnull String sourceKey, @Nonnull V1Connection v1Connection, RequestOptions requestOptions)
    throws CliniaRuntimeException {
    return LaunderThrowable.await(createConnectionAsync(sourceKey, v1Connection, requestOptions));
  }

  /**
   * Create a Connection for a data source.
   *
   * @param sourceKey The key of the source. (required)
   * @param v1Connection (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public V1Connection createConnection(@Nonnull String sourceKey, @Nonnull V1Connection v1Connection) throws CliniaRuntimeException {
    return this.createConnection(sourceKey, v1Connection, null);
  }

  /**
   * (asynchronously) Create a Connection for a data source.
   *
   * @param sourceKey The key of the source. (required)
   * @param v1Connection (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture createConnectionAsync(
    @Nonnull String sourceKey,
    @Nonnull V1Connection v1Connection,
    RequestOptions requestOptions
  ) throws CliniaRuntimeException {
    Parameters.requireNonNull(sourceKey, "Parameter `sourceKey` is required when calling `createConnection`.");

    Parameters.requireNonNull(v1Connection, "Parameter `v1Connection` is required when calling `createConnection`.");

    HttpRequest request = HttpRequest
      .builder()
      .setPath("/catalog/v1/sources/{sourceKey}/connections", sourceKey)
      .setMethod("POST")
      .setBody(v1Connection)
      .build();
    return executeAsync(request, requestOptions, new TypeReference() {});
  }

  /**
   * (asynchronously) Create a Connection for a data source.
   *
   * @param sourceKey The key of the source. (required)
   * @param v1Connection (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture createConnectionAsync(@Nonnull String sourceKey, @Nonnull V1Connection v1Connection)
    throws CliniaRuntimeException {
    return this.createConnectionAsync(sourceKey, v1Connection, null);
  }

  /**
   * Create a data partition.
   *
   * @param key Key of the data partition. It must follow pattern: `^[a-zA-Z0-9-][\\w-]{0,61}$`.
   *     (required)
   * @param v1DataPartition (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public V1DataPartition createDataPartition(@Nonnull String key, @Nonnull V1DataPartition v1DataPartition, RequestOptions requestOptions)
    throws CliniaRuntimeException {
    return LaunderThrowable.await(createDataPartitionAsync(key, v1DataPartition, requestOptions));
  }

  /**
   * Create a data partition.
   *
   * @param key Key of the data partition. It must follow pattern: `^[a-zA-Z0-9-][\\w-]{0,61}$`.
   *     (required)
   * @param v1DataPartition (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public V1DataPartition createDataPartition(@Nonnull String key, @Nonnull V1DataPartition v1DataPartition) throws CliniaRuntimeException {
    return this.createDataPartition(key, v1DataPartition, null);
  }

  /**
   * (asynchronously) Create a data partition.
   *
   * @param key Key of the data partition. It must follow pattern: `^[a-zA-Z0-9-][\\w-]{0,61}$`.
   *     (required)
   * @param v1DataPartition (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture createDataPartitionAsync(
    @Nonnull String key,
    @Nonnull V1DataPartition v1DataPartition,
    RequestOptions requestOptions
  ) throws CliniaRuntimeException {
    Parameters.requireNonNull(key, "Parameter `key` is required when calling `createDataPartition`.");

    Parameters.requireNonNull(v1DataPartition, "Parameter `v1DataPartition` is required when calling `createDataPartition`.");

    HttpRequest request = HttpRequest
      .builder()
      .setPath("/catalog/v1/partitions/{key}", key)
      .setMethod("PUT")
      .setBody(v1DataPartition)
      .build();
    return executeAsync(request, requestOptions, new TypeReference() {});
  }

  /**
   * (asynchronously) Create a data partition.
   *
   * @param key Key of the data partition. It must follow pattern: `^[a-zA-Z0-9-][\\w-]{0,61}$`.
   *     (required)
   * @param v1DataPartition (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture createDataPartitionAsync(@Nonnull String key, @Nonnull V1DataPartition v1DataPartition)
    throws CliniaRuntimeException {
    return this.createDataPartitionAsync(key, v1DataPartition, null);
  }

  /**
   * Create a data source.
   *
   * @param key Key of the data source. It must follow pattern: `^[a-zA-Z0-9-][\\w-]{0,61}$`.
   *     (required)
   * @param v1DataSource (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public V1DataSource createDataSource(@Nonnull String key, @Nonnull V1DataSource v1DataSource, RequestOptions requestOptions)
    throws CliniaRuntimeException {
    return LaunderThrowable.await(createDataSourceAsync(key, v1DataSource, requestOptions));
  }

  /**
   * Create a data source.
   *
   * @param key Key of the data source. It must follow pattern: `^[a-zA-Z0-9-][\\w-]{0,61}$`.
   *     (required)
   * @param v1DataSource (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public V1DataSource createDataSource(@Nonnull String key, @Nonnull V1DataSource v1DataSource) throws CliniaRuntimeException {
    return this.createDataSource(key, v1DataSource, null);
  }

  /**
   * (asynchronously) Create a data source.
   *
   * @param key Key of the data source. It must follow pattern: `^[a-zA-Z0-9-][\\w-]{0,61}$`.
   *     (required)
   * @param v1DataSource (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture createDataSourceAsync(
    @Nonnull String key,
    @Nonnull V1DataSource v1DataSource,
    RequestOptions requestOptions
  ) throws CliniaRuntimeException {
    Parameters.requireNonNull(key, "Parameter `key` is required when calling `createDataSource`.");

    Parameters.requireNonNull(v1DataSource, "Parameter `v1DataSource` is required when calling `createDataSource`.");

    HttpRequest request = HttpRequest.builder().setPath("/catalog/v1/sources/{key}", key).setMethod("PUT").setBody(v1DataSource).build();
    return executeAsync(request, requestOptions, new TypeReference() {});
  }

  /**
   * (asynchronously) Create a data source.
   *
   * @param key Key of the data source. It must follow pattern: `^[a-zA-Z0-9-][\\w-]{0,61}$`.
   *     (required)
   * @param v1DataSource (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture createDataSourceAsync(@Nonnull String key, @Nonnull V1DataSource v1DataSource)
    throws CliniaRuntimeException {
    return this.createDataSourceAsync(key, v1DataSource, null);
  }

  /**
   * Delete a Connection.
   *
   * @param sourceKey The key of the source. (required)
   * @param key Key of the connection. (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public void deleteConnection(@Nonnull String sourceKey, @Nonnull String key, RequestOptions requestOptions)
    throws CliniaRuntimeException {
    LaunderThrowable.await(deleteConnectionAsync(sourceKey, key, requestOptions));
    return;
  }

  /**
   * Delete a Connection.
   *
   * @param sourceKey The key of the source. (required)
   * @param key Key of the connection. (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public void deleteConnection(@Nonnull String sourceKey, @Nonnull String key) throws CliniaRuntimeException {
    this.deleteConnection(sourceKey, key, null);
  }

  /**
   * (asynchronously) Delete a Connection.
   *
   * @param sourceKey The key of the source. (required)
   * @param key Key of the connection. (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture deleteConnectionAsync(@Nonnull String sourceKey, @Nonnull String key, RequestOptions requestOptions)
    throws CliniaRuntimeException {
    Parameters.requireNonNull(sourceKey, "Parameter `sourceKey` is required when calling `deleteConnection`.");

    Parameters.requireNonNull(key, "Parameter `key` is required when calling `deleteConnection`.");

    HttpRequest request = HttpRequest
      .builder()
      .setPath("/catalog/v1/sources/{sourceKey}/connections/{key}", sourceKey, key)
      .setMethod("DELETE")
      .build();
    return executeAsync(request, requestOptions, null);
  }

  /**
   * (asynchronously) Delete a Connection.
   *
   * @param sourceKey The key of the source. (required)
   * @param key Key of the connection. (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture deleteConnectionAsync(@Nonnull String sourceKey, @Nonnull String key) throws CliniaRuntimeException {
    return this.deleteConnectionAsync(sourceKey, key, null);
  }

  /**
   * Delete a data partition.
   *
   * @param key (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public void deleteDataPartition(@Nonnull String key, RequestOptions requestOptions) throws CliniaRuntimeException {
    LaunderThrowable.await(deleteDataPartitionAsync(key, requestOptions));
    return;
  }

  /**
   * Delete a data partition.
   *
   * @param key (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public void deleteDataPartition(@Nonnull String key) throws CliniaRuntimeException {
    this.deleteDataPartition(key, null);
  }

  /**
   * (asynchronously) Delete a data partition.
   *
   * @param key (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture deleteDataPartitionAsync(@Nonnull String key, RequestOptions requestOptions)
    throws CliniaRuntimeException {
    Parameters.requireNonNull(key, "Parameter `key` is required when calling `deleteDataPartition`.");

    HttpRequest request = HttpRequest.builder().setPath("/catalog/v1/partitions/{key}", key).setMethod("DELETE").build();
    return executeAsync(request, requestOptions, null);
  }

  /**
   * (asynchronously) Delete a data partition.
   *
   * @param key (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture deleteDataPartitionAsync(@Nonnull String key) throws CliniaRuntimeException {
    return this.deleteDataPartitionAsync(key, null);
  }

  /**
   * Delete a data source.
   *
   * @param key Key of the data source. (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public void deleteDataSource(@Nonnull String key, RequestOptions requestOptions) throws CliniaRuntimeException {
    LaunderThrowable.await(deleteDataSourceAsync(key, requestOptions));
    return;
  }

  /**
   * Delete a data source.
   *
   * @param key Key of the data source. (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public void deleteDataSource(@Nonnull String key) throws CliniaRuntimeException {
    this.deleteDataSource(key, null);
  }

  /**
   * (asynchronously) Delete a data source.
   *
   * @param key Key of the data source. (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture deleteDataSourceAsync(@Nonnull String key, RequestOptions requestOptions) throws CliniaRuntimeException {
    Parameters.requireNonNull(key, "Parameter `key` is required when calling `deleteDataSource`.");

    HttpRequest request = HttpRequest.builder().setPath("/catalog/v1/sources/{key}", key).setMethod("DELETE").build();

    return executeAsync(request, requestOptions, null);
  }

  /**
   * (asynchronously) Delete a data source.
   *
   * @param key Key of the data source. (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture deleteDataSourceAsync(@Nonnull String key) throws CliniaRuntimeException {
    return this.deleteDataSourceAsync(key, null);
  }

  /**
   * Get a Connection.
   *
   * @param sourceKey The key of the source. (required)
   * @param key Key of the connection. (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public V1Connection getConnection(@Nonnull String sourceKey, @Nonnull String key, RequestOptions requestOptions)
    throws CliniaRuntimeException {
    return LaunderThrowable.await(getConnectionAsync(sourceKey, key, requestOptions));
  }

  /**
   * Get a Connection.
   *
   * @param sourceKey The key of the source. (required)
   * @param key Key of the connection. (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public V1Connection getConnection(@Nonnull String sourceKey, @Nonnull String key) throws CliniaRuntimeException {
    return this.getConnection(sourceKey, key, null);
  }

  /**
   * (asynchronously) Get a Connection.
   *
   * @param sourceKey The key of the source. (required)
   * @param key Key of the connection. (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture getConnectionAsync(@Nonnull String sourceKey, @Nonnull String key, RequestOptions requestOptions)
    throws CliniaRuntimeException {
    Parameters.requireNonNull(sourceKey, "Parameter `sourceKey` is required when calling `getConnection`.");

    Parameters.requireNonNull(key, "Parameter `key` is required when calling `getConnection`.");

    HttpRequest request = HttpRequest
      .builder()
      .setPath("/catalog/v1/sources/{sourceKey}/connections/{key}", sourceKey, key)
      .setMethod("GET")
      .build();
    return executeAsync(request, requestOptions, new TypeReference() {});
  }

  /**
   * (asynchronously) Get a Connection.
   *
   * @param sourceKey The key of the source. (required)
   * @param key Key of the connection. (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture getConnectionAsync(@Nonnull String sourceKey, @Nonnull String key) throws CliniaRuntimeException {
    return this.getConnectionAsync(sourceKey, key, null);
  }

  /**
   * Get a data partition.
   *
   * @param key (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public V1DataPartition getDataPartition(@Nonnull String key, RequestOptions requestOptions) throws CliniaRuntimeException {
    return LaunderThrowable.await(getDataPartitionAsync(key, requestOptions));
  }

  /**
   * Get a data partition.
   *
   * @param key (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public V1DataPartition getDataPartition(@Nonnull String key) throws CliniaRuntimeException {
    return this.getDataPartition(key, null);
  }

  /**
   * (asynchronously) Get a data partition.
   *
   * @param key (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture getDataPartitionAsync(@Nonnull String key, RequestOptions requestOptions)
    throws CliniaRuntimeException {
    Parameters.requireNonNull(key, "Parameter `key` is required when calling `getDataPartition`.");

    HttpRequest request = HttpRequest.builder().setPath("/catalog/v1/partitions/{key}", key).setMethod("GET").build();

    return executeAsync(request, requestOptions, new TypeReference() {});
  }

  /**
   * (asynchronously) Get a data partition.
   *
   * @param key (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture getDataPartitionAsync(@Nonnull String key) throws CliniaRuntimeException {
    return this.getDataPartitionAsync(key, null);
  }

  /**
   * Get the data source with the given key.
   *
   * @param key Key of the data source. (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public V1DataSource getDataSource(@Nonnull String key, RequestOptions requestOptions) throws CliniaRuntimeException {
    return LaunderThrowable.await(getDataSourceAsync(key, requestOptions));
  }

  /**
   * Get the data source with the given key.
   *
   * @param key Key of the data source. (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public V1DataSource getDataSource(@Nonnull String key) throws CliniaRuntimeException {
    return this.getDataSource(key, null);
  }

  /**
   * (asynchronously) Get the data source with the given key.
   *
   * @param key Key of the data source. (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture getDataSourceAsync(@Nonnull String key, RequestOptions requestOptions)
    throws CliniaRuntimeException {
    Parameters.requireNonNull(key, "Parameter `key` is required when calling `getDataSource`.");

    HttpRequest request = HttpRequest.builder().setPath("/catalog/v1/sources/{key}", key).setMethod("GET").build();

    return executeAsync(request, requestOptions, new TypeReference() {});
  }

  /**
   * (asynchronously) Get the data source with the given key.
   *
   * @param key Key of the data source. (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture getDataSourceAsync(@Nonnull String key) throws CliniaRuntimeException {
    return this.getDataSourceAsync(key, null);
  }

  /**
   * List the Connections for a data source.
   *
   * @param sourceKey The key of the source. (required)
   * @param page (optional)
   * @param perPage (optional)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public ListConnections200Response listConnections(
    @Nonnull String sourceKey,
    Integer page,
    Integer perPage,
    RequestOptions requestOptions
  ) throws CliniaRuntimeException {
    return LaunderThrowable.await(listConnectionsAsync(sourceKey, page, perPage, requestOptions));
  }

  /**
   * List the Connections for a data source.
   *
   * @param sourceKey The key of the source. (required)
   * @param page (optional)
   * @param perPage (optional)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public ListConnections200Response listConnections(@Nonnull String sourceKey, Integer page, Integer perPage)
    throws CliniaRuntimeException {
    return this.listConnections(sourceKey, page, perPage, null);
  }

  /**
   * List the Connections for a data source.
   *
   * @param sourceKey The key of the source. (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public ListConnections200Response listConnections(@Nonnull String sourceKey, RequestOptions requestOptions)
    throws CliniaRuntimeException {
    return this.listConnections(sourceKey, null, null, requestOptions);
  }

  /**
   * List the Connections for a data source.
   *
   * @param sourceKey The key of the source. (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public ListConnections200Response listConnections(@Nonnull String sourceKey) throws CliniaRuntimeException {
    return this.listConnections(sourceKey, null, null, null);
  }

  /**
   * (asynchronously) List the Connections for a data source.
   *
   * @param sourceKey The key of the source. (required)
   * @param page (optional)
   * @param perPage (optional)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture listConnectionsAsync(
    @Nonnull String sourceKey,
    Integer page,
    Integer perPage,
    RequestOptions requestOptions
  ) throws CliniaRuntimeException {
    Parameters.requireNonNull(sourceKey, "Parameter `sourceKey` is required when calling `listConnections`.");

    HttpRequest request = HttpRequest
      .builder()
      .setPath("/catalog/v1/sources/{sourceKey}/connections", sourceKey)
      .setMethod("GET")
      .addQueryParameter("page", page)
      .addQueryParameter("perPage", perPage)
      .build();
    return executeAsync(request, requestOptions, new TypeReference() {});
  }

  /**
   * (asynchronously) List the Connections for a data source.
   *
   * @param sourceKey The key of the source. (required)
   * @param page (optional)
   * @param perPage (optional)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture listConnectionsAsync(@Nonnull String sourceKey, Integer page, Integer perPage)
    throws CliniaRuntimeException {
    return this.listConnectionsAsync(sourceKey, page, perPage, null);
  }

  /**
   * (asynchronously) List the Connections for a data source.
   *
   * @param sourceKey The key of the source. (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture listConnectionsAsync(@Nonnull String sourceKey, RequestOptions requestOptions)
    throws CliniaRuntimeException {
    return this.listConnectionsAsync(sourceKey, null, null, requestOptions);
  }

  /**
   * (asynchronously) List the Connections for a data source.
   *
   * @param sourceKey The key of the source. (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture listConnectionsAsync(@Nonnull String sourceKey) throws CliniaRuntimeException {
    return this.listConnectionsAsync(sourceKey, null, null, null);
  }

  /**
   * Lists the data partitions.
   *
   * @param page (optional)
   * @param perPage (optional)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public ListDataPartitions200Response listDataPartitions(Integer page, Integer perPage, RequestOptions requestOptions)
    throws CliniaRuntimeException {
    return LaunderThrowable.await(listDataPartitionsAsync(page, perPage, requestOptions));
  }

  /**
   * Lists the data partitions.
   *
   * @param page (optional)
   * @param perPage (optional)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public ListDataPartitions200Response listDataPartitions(Integer page, Integer perPage) throws CliniaRuntimeException {
    return this.listDataPartitions(page, perPage, null);
  }

  /**
   * Lists the data partitions.
   *
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public ListDataPartitions200Response listDataPartitions(RequestOptions requestOptions) throws CliniaRuntimeException {
    return this.listDataPartitions(null, null, requestOptions);
  }

  /**
   * Lists the data partitions.
   *
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public ListDataPartitions200Response listDataPartitions() throws CliniaRuntimeException {
    return this.listDataPartitions(null, null, null);
  }

  /**
   * (asynchronously) Lists the data partitions.
   *
   * @param page (optional)
   * @param perPage (optional)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture listDataPartitionsAsync(
    Integer page,
    Integer perPage,
    RequestOptions requestOptions
  ) throws CliniaRuntimeException {
    HttpRequest request = HttpRequest
      .builder()
      .setPath("/catalog/v1/partitions")
      .setMethod("GET")
      .addQueryParameter("page", page)
      .addQueryParameter("perPage", perPage)
      .build();
    return executeAsync(request, requestOptions, new TypeReference() {});
  }

  /**
   * (asynchronously) Lists the data partitions.
   *
   * @param page (optional)
   * @param perPage (optional)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture listDataPartitionsAsync(Integer page, Integer perPage)
    throws CliniaRuntimeException {
    return this.listDataPartitionsAsync(page, perPage, null);
  }

  /**
   * (asynchronously) Lists the data partitions.
   *
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture listDataPartitionsAsync(RequestOptions requestOptions)
    throws CliniaRuntimeException {
    return this.listDataPartitionsAsync(null, null, requestOptions);
  }

  /**
   * (asynchronously) Lists the data partitions.
   *
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture listDataPartitionsAsync() throws CliniaRuntimeException {
    return this.listDataPartitionsAsync(null, null, null);
  }

  /**
   * Lists the data sources.
   *
   * @param page (optional)
   * @param perPage (optional)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public ListDataSources200Response listDataSources(Integer page, Integer perPage, RequestOptions requestOptions)
    throws CliniaRuntimeException {
    return LaunderThrowable.await(listDataSourcesAsync(page, perPage, requestOptions));
  }

  /**
   * Lists the data sources.
   *
   * @param page (optional)
   * @param perPage (optional)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public ListDataSources200Response listDataSources(Integer page, Integer perPage) throws CliniaRuntimeException {
    return this.listDataSources(page, perPage, null);
  }

  /**
   * Lists the data sources.
   *
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public ListDataSources200Response listDataSources(RequestOptions requestOptions) throws CliniaRuntimeException {
    return this.listDataSources(null, null, requestOptions);
  }

  /**
   * Lists the data sources.
   *
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public ListDataSources200Response listDataSources() throws CliniaRuntimeException {
    return this.listDataSources(null, null, null);
  }

  /**
   * (asynchronously) Lists the data sources.
   *
   * @param page (optional)
   * @param perPage (optional)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture listDataSourcesAsync(Integer page, Integer perPage, RequestOptions requestOptions)
    throws CliniaRuntimeException {
    HttpRequest request = HttpRequest
      .builder()
      .setPath("/catalog/v1/sources")
      .setMethod("GET")
      .addQueryParameter("page", page)
      .addQueryParameter("perPage", perPage)
      .build();
    return executeAsync(request, requestOptions, new TypeReference() {});
  }

  /**
   * (asynchronously) Lists the data sources.
   *
   * @param page (optional)
   * @param perPage (optional)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture listDataSourcesAsync(Integer page, Integer perPage) throws CliniaRuntimeException {
    return this.listDataSourcesAsync(page, perPage, null);
  }

  /**
   * (asynchronously) Lists the data sources.
   *
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture listDataSourcesAsync(RequestOptions requestOptions) throws CliniaRuntimeException {
    return this.listDataSourcesAsync(null, null, requestOptions);
  }

  /**
   * (asynchronously) Lists the data sources.
   *
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture listDataSourcesAsync() throws CliniaRuntimeException {
    return this.listDataSourcesAsync(null, null, null);
  }

  /**
   * Pause a Connection.
   *
   * @param sourceKey The key of the source. (required)
   * @param key Key of the connection. (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public void pauseConnection(@Nonnull String sourceKey, @Nonnull String key, RequestOptions requestOptions) throws CliniaRuntimeException {
    LaunderThrowable.await(pauseConnectionAsync(sourceKey, key, requestOptions));
    return;
  }

  /**
   * Pause a Connection.
   *
   * @param sourceKey The key of the source. (required)
   * @param key Key of the connection. (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public void pauseConnection(@Nonnull String sourceKey, @Nonnull String key) throws CliniaRuntimeException {
    this.pauseConnection(sourceKey, key, null);
  }

  /**
   * (asynchronously) Pause a Connection.
   *
   * @param sourceKey The key of the source. (required)
   * @param key Key of the connection. (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture pauseConnectionAsync(@Nonnull String sourceKey, @Nonnull String key, RequestOptions requestOptions)
    throws CliniaRuntimeException {
    Parameters.requireNonNull(sourceKey, "Parameter `sourceKey` is required when calling `pauseConnection`.");

    Parameters.requireNonNull(key, "Parameter `key` is required when calling `pauseConnection`.");

    HttpRequest request = HttpRequest
      .builder()
      .setPath("/catalog/v1/sources/{sourceKey}/connections/{key}/pause", sourceKey, key)
      .setMethod("POST")
      .build();
    return executeAsync(request, requestOptions, null);
  }

  /**
   * (asynchronously) Pause a Connection.
   *
   * @param sourceKey The key of the source. (required)
   * @param key Key of the connection. (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture pauseConnectionAsync(@Nonnull String sourceKey, @Nonnull String key) throws CliniaRuntimeException {
    return this.pauseConnectionAsync(sourceKey, key, null);
  }

  /**
   * Resume a Connection.
   *
   * @param sourceKey The key of the source. (required)
   * @param key Key of the connection. (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public void resumeConnection(@Nonnull String sourceKey, @Nonnull String key, RequestOptions requestOptions)
    throws CliniaRuntimeException {
    LaunderThrowable.await(resumeConnectionAsync(sourceKey, key, requestOptions));
    return;
  }

  /**
   * Resume a Connection.
   *
   * @param sourceKey The key of the source. (required)
   * @param key Key of the connection. (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public void resumeConnection(@Nonnull String sourceKey, @Nonnull String key) throws CliniaRuntimeException {
    this.resumeConnection(sourceKey, key, null);
  }

  /**
   * (asynchronously) Resume a Connection.
   *
   * @param sourceKey The key of the source. (required)
   * @param key Key of the connection. (required)
   * @param requestOptions The requestOptions to send along with the query, they will be merged with
   *     the transporter requestOptions.
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture resumeConnectionAsync(@Nonnull String sourceKey, @Nonnull String key, RequestOptions requestOptions)
    throws CliniaRuntimeException {
    Parameters.requireNonNull(sourceKey, "Parameter `sourceKey` is required when calling `resumeConnection`.");

    Parameters.requireNonNull(key, "Parameter `key` is required when calling `resumeConnection`.");

    HttpRequest request = HttpRequest
      .builder()
      .setPath("/catalog/v1/sources/{sourceKey}/connections/{key}/resume", sourceKey, key)
      .setMethod("POST")
      .build();
    return executeAsync(request, requestOptions, null);
  }

  /**
   * (asynchronously) Resume a Connection.
   *
   * @param sourceKey The key of the source. (required)
   * @param key Key of the connection. (required)
   * @throws CliniaRuntimeException If it fails to process the API call
   */
  public CompletableFuture resumeConnectionAsync(@Nonnull String sourceKey, @Nonnull String key) throws CliniaRuntimeException {
    return this.resumeConnectionAsync(sourceKey, key, null);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy