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

software.amazon.awssdk.services.honeycode.DefaultHoneycodeClient Maven / Gradle / Ivy

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.honeycode;

import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.client.handler.SyncClientHandler;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.util.VersionInfo;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.honeycode.model.AccessDeniedException;
import software.amazon.awssdk.services.honeycode.model.AutomationExecutionException;
import software.amazon.awssdk.services.honeycode.model.AutomationExecutionTimeoutException;
import software.amazon.awssdk.services.honeycode.model.BatchCreateTableRowsRequest;
import software.amazon.awssdk.services.honeycode.model.BatchCreateTableRowsResponse;
import software.amazon.awssdk.services.honeycode.model.BatchDeleteTableRowsRequest;
import software.amazon.awssdk.services.honeycode.model.BatchDeleteTableRowsResponse;
import software.amazon.awssdk.services.honeycode.model.BatchUpdateTableRowsRequest;
import software.amazon.awssdk.services.honeycode.model.BatchUpdateTableRowsResponse;
import software.amazon.awssdk.services.honeycode.model.BatchUpsertTableRowsRequest;
import software.amazon.awssdk.services.honeycode.model.BatchUpsertTableRowsResponse;
import software.amazon.awssdk.services.honeycode.model.DescribeTableDataImportJobRequest;
import software.amazon.awssdk.services.honeycode.model.DescribeTableDataImportJobResponse;
import software.amazon.awssdk.services.honeycode.model.GetScreenDataRequest;
import software.amazon.awssdk.services.honeycode.model.GetScreenDataResponse;
import software.amazon.awssdk.services.honeycode.model.HoneycodeException;
import software.amazon.awssdk.services.honeycode.model.HoneycodeRequest;
import software.amazon.awssdk.services.honeycode.model.InternalServerException;
import software.amazon.awssdk.services.honeycode.model.InvokeScreenAutomationRequest;
import software.amazon.awssdk.services.honeycode.model.InvokeScreenAutomationResponse;
import software.amazon.awssdk.services.honeycode.model.ListTableColumnsRequest;
import software.amazon.awssdk.services.honeycode.model.ListTableColumnsResponse;
import software.amazon.awssdk.services.honeycode.model.ListTableRowsRequest;
import software.amazon.awssdk.services.honeycode.model.ListTableRowsResponse;
import software.amazon.awssdk.services.honeycode.model.ListTablesRequest;
import software.amazon.awssdk.services.honeycode.model.ListTablesResponse;
import software.amazon.awssdk.services.honeycode.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.honeycode.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.honeycode.model.QueryTableRowsRequest;
import software.amazon.awssdk.services.honeycode.model.QueryTableRowsResponse;
import software.amazon.awssdk.services.honeycode.model.RequestTimeoutException;
import software.amazon.awssdk.services.honeycode.model.ResourceNotFoundException;
import software.amazon.awssdk.services.honeycode.model.ServiceQuotaExceededException;
import software.amazon.awssdk.services.honeycode.model.ServiceUnavailableException;
import software.amazon.awssdk.services.honeycode.model.StartTableDataImportJobRequest;
import software.amazon.awssdk.services.honeycode.model.StartTableDataImportJobResponse;
import software.amazon.awssdk.services.honeycode.model.TagResourceRequest;
import software.amazon.awssdk.services.honeycode.model.TagResourceResponse;
import software.amazon.awssdk.services.honeycode.model.ThrottlingException;
import software.amazon.awssdk.services.honeycode.model.UntagResourceRequest;
import software.amazon.awssdk.services.honeycode.model.UntagResourceResponse;
import software.amazon.awssdk.services.honeycode.model.ValidationException;
import software.amazon.awssdk.services.honeycode.paginators.ListTableColumnsIterable;
import software.amazon.awssdk.services.honeycode.paginators.ListTableRowsIterable;
import software.amazon.awssdk.services.honeycode.paginators.ListTablesIterable;
import software.amazon.awssdk.services.honeycode.paginators.QueryTableRowsIterable;
import software.amazon.awssdk.services.honeycode.transform.BatchCreateTableRowsRequestMarshaller;
import software.amazon.awssdk.services.honeycode.transform.BatchDeleteTableRowsRequestMarshaller;
import software.amazon.awssdk.services.honeycode.transform.BatchUpdateTableRowsRequestMarshaller;
import software.amazon.awssdk.services.honeycode.transform.BatchUpsertTableRowsRequestMarshaller;
import software.amazon.awssdk.services.honeycode.transform.DescribeTableDataImportJobRequestMarshaller;
import software.amazon.awssdk.services.honeycode.transform.GetScreenDataRequestMarshaller;
import software.amazon.awssdk.services.honeycode.transform.InvokeScreenAutomationRequestMarshaller;
import software.amazon.awssdk.services.honeycode.transform.ListTableColumnsRequestMarshaller;
import software.amazon.awssdk.services.honeycode.transform.ListTableRowsRequestMarshaller;
import software.amazon.awssdk.services.honeycode.transform.ListTablesRequestMarshaller;
import software.amazon.awssdk.services.honeycode.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.honeycode.transform.QueryTableRowsRequestMarshaller;
import software.amazon.awssdk.services.honeycode.transform.StartTableDataImportJobRequestMarshaller;
import software.amazon.awssdk.services.honeycode.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.honeycode.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.utils.Logger;

/**
 * Internal implementation of {@link HoneycodeClient}.
 *
 * @see HoneycodeClient#builder()
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultHoneycodeClient implements HoneycodeClient {
    private static final Logger log = Logger.loggerFor(DefaultHoneycodeClient.class);

    private final SyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

    private final HoneycodeServiceClientConfiguration serviceClientConfiguration;

    protected DefaultHoneycodeClient(HoneycodeServiceClientConfiguration serviceClientConfiguration,
            SdkClientConfiguration clientConfiguration) {
        this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
        this.clientConfiguration = clientConfiguration;
        this.serviceClientConfiguration = serviceClientConfiguration;
        this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
    }

    /**
     * 

* The BatchCreateTableRows API allows you to create one or more rows at the end of a table in a workbook. The API * allows you to specify the values to set in some or all of the columns in the new rows. *

*

* If a column is not explicitly set in a specific row, then the column level formula specified in the table will be * applied to the new row. If there is no column level formula but the last row of the table has a formula, then * that formula will be copied down to the new row. If there is no column level formula and no formula in the last * row of the table, then that column will be left blank for the new rows. *

* * @param batchCreateTableRowsRequest * @return Result of the BatchCreateTableRows operation returned by the service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws RequestTimeoutException * The request timed out. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ServiceQuotaExceededException * The request caused service quota to be breached. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.BatchCreateTableRows * @see AWS API Documentation */ @Override public BatchCreateTableRowsResponse batchCreateTableRows(BatchCreateTableRowsRequest batchCreateTableRowsRequest) throws AccessDeniedException, InternalServerException, RequestTimeoutException, ResourceNotFoundException, ServiceQuotaExceededException, ServiceUnavailableException, ThrottlingException, ValidationException, AwsServiceException, SdkClientException, HoneycodeException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, BatchCreateTableRowsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, batchCreateTableRowsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Honeycode"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchCreateTableRows"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("BatchCreateTableRows").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(batchCreateTableRowsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new BatchCreateTableRowsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* The BatchDeleteTableRows API allows you to delete one or more rows from a table in a workbook. You need to * specify the ids of the rows that you want to delete from the table. *

* * @param batchDeleteTableRowsRequest * @return Result of the BatchDeleteTableRows operation returned by the service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws RequestTimeoutException * The request timed out. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.BatchDeleteTableRows * @see AWS API Documentation */ @Override public BatchDeleteTableRowsResponse batchDeleteTableRows(BatchDeleteTableRowsRequest batchDeleteTableRowsRequest) throws AccessDeniedException, InternalServerException, ResourceNotFoundException, ServiceUnavailableException, ValidationException, RequestTimeoutException, ThrottlingException, AwsServiceException, SdkClientException, HoneycodeException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, BatchDeleteTableRowsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, batchDeleteTableRowsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Honeycode"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchDeleteTableRows"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("BatchDeleteTableRows").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(batchDeleteTableRowsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new BatchDeleteTableRowsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* The BatchUpdateTableRows API allows you to update one or more rows in a table in a workbook. *

*

* You can specify the values to set in some or all of the columns in the table for the specified rows. If a column * is not explicitly specified in a particular row, then that column will not be updated for that row. To clear out * the data in a specific cell, you need to set the value as an empty string (""). *

* * @param batchUpdateTableRowsRequest * @return Result of the BatchUpdateTableRows operation returned by the service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws RequestTimeoutException * The request timed out. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.BatchUpdateTableRows * @see AWS API Documentation */ @Override public BatchUpdateTableRowsResponse batchUpdateTableRows(BatchUpdateTableRowsRequest batchUpdateTableRowsRequest) throws AccessDeniedException, InternalServerException, ResourceNotFoundException, ServiceUnavailableException, ValidationException, RequestTimeoutException, ThrottlingException, AwsServiceException, SdkClientException, HoneycodeException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, BatchUpdateTableRowsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, batchUpdateTableRowsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Honeycode"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchUpdateTableRows"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("BatchUpdateTableRows").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(batchUpdateTableRowsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new BatchUpdateTableRowsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* The BatchUpsertTableRows API allows you to upsert one or more rows in a table. The upsert operation takes a * filter expression as input and evaluates it to find matching rows on the destination table. If matching rows are * found, it will update the cells in the matching rows to new values specified in the request. If no matching rows * are found, a new row is added at the end of the table and the cells in that row are set to the new values * specified in the request. *

*

* You can specify the values to set in some or all of the columns in the table for the matching or newly appended * rows. If a column is not explicitly specified for a particular row, then that column will not be updated for that * row. To clear out the data in a specific cell, you need to set the value as an empty string (""). *

* * @param batchUpsertTableRowsRequest * @return Result of the BatchUpsertTableRows operation returned by the service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws RequestTimeoutException * The request timed out. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ServiceQuotaExceededException * The request caused service quota to be breached. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.BatchUpsertTableRows * @see AWS API Documentation */ @Override public BatchUpsertTableRowsResponse batchUpsertTableRows(BatchUpsertTableRowsRequest batchUpsertTableRowsRequest) throws AccessDeniedException, InternalServerException, RequestTimeoutException, ResourceNotFoundException, ServiceQuotaExceededException, ServiceUnavailableException, ThrottlingException, ValidationException, AwsServiceException, SdkClientException, HoneycodeException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, BatchUpsertTableRowsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, batchUpsertTableRowsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Honeycode"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchUpsertTableRows"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("BatchUpsertTableRows").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(batchUpsertTableRowsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new BatchUpsertTableRowsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* The DescribeTableDataImportJob API allows you to retrieve the status and details of a table data import job. *

* * @param describeTableDataImportJobRequest * @return Result of the DescribeTableDataImportJob operation returned by the service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws RequestTimeoutException * The request timed out. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.DescribeTableDataImportJob * @see AWS API Documentation */ @Override public DescribeTableDataImportJobResponse describeTableDataImportJob( DescribeTableDataImportJobRequest describeTableDataImportJobRequest) throws AccessDeniedException, InternalServerException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, ValidationException, RequestTimeoutException, AwsServiceException, SdkClientException, HoneycodeException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeTableDataImportJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeTableDataImportJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Honeycode"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeTableDataImportJob"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeTableDataImportJob").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(describeTableDataImportJobRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DescribeTableDataImportJobRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* The GetScreenData API allows retrieval of data from a screen in a Honeycode app. The API allows setting local * variables in the screen to filter, sort or otherwise affect what will be displayed on the screen. *

* * @param getScreenDataRequest * @return Result of the GetScreenData operation returned by the service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws RequestTimeoutException * The request timed out. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.GetScreenData * @see AWS API * Documentation */ @Override public GetScreenDataResponse getScreenData(GetScreenDataRequest getScreenDataRequest) throws AccessDeniedException, InternalServerException, RequestTimeoutException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, ValidationException, AwsServiceException, SdkClientException, HoneycodeException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetScreenDataResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, getScreenDataRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Honeycode"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetScreenData"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetScreenData").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(getScreenDataRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetScreenDataRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* The InvokeScreenAutomation API allows invoking an action defined in a screen in a Honeycode app. The API allows * setting local variables, which can then be used in the automation being invoked. This allows automating the * Honeycode app interactions to write, update or delete data in the workbook. *

* * @param invokeScreenAutomationRequest * @return Result of the InvokeScreenAutomation operation returned by the service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws AutomationExecutionException * The automation execution did not end successfully. * @throws AutomationExecutionTimeoutException * The automation execution timed out. * @throws RequestTimeoutException * The request timed out. * @throws ServiceQuotaExceededException * The request caused service quota to be breached. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.InvokeScreenAutomation * @see AWS API Documentation */ @Override public InvokeScreenAutomationResponse invokeScreenAutomation(InvokeScreenAutomationRequest invokeScreenAutomationRequest) throws AccessDeniedException, InternalServerException, ResourceNotFoundException, ValidationException, ThrottlingException, ServiceUnavailableException, AutomationExecutionException, AutomationExecutionTimeoutException, RequestTimeoutException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, HoneycodeException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, InvokeScreenAutomationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, invokeScreenAutomationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Honeycode"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "InvokeScreenAutomation"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("InvokeScreenAutomation").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(invokeScreenAutomationRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new InvokeScreenAutomationRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* The ListTableColumns API allows you to retrieve a list of all the columns in a table in a workbook. *

* * @param listTableColumnsRequest * @return Result of the ListTableColumns operation returned by the service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws RequestTimeoutException * The request timed out. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.ListTableColumns * @see AWS * API Documentation */ @Override public ListTableColumnsResponse listTableColumns(ListTableColumnsRequest listTableColumnsRequest) throws AccessDeniedException, InternalServerException, RequestTimeoutException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, ValidationException, AwsServiceException, SdkClientException, HoneycodeException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListTableColumnsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, listTableColumnsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Honeycode"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTableColumns"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListTableColumns").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(listTableColumnsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListTableColumnsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* The ListTableColumns API allows you to retrieve a list of all the columns in a table in a workbook. *

*
*

* This is a variant of * {@link #listTableColumns(software.amazon.awssdk.services.honeycode.model.ListTableColumnsRequest)} operation. The * return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle * making service calls for you. *

*

* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no * guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response * pages by making service calls until there are no pages left or your iteration stops. If there are errors in your * request, you will see the failures only after you start iterating through the iterable. *

* *

* The following are few ways to iterate through the response pages: *

* 1) Using a Stream * *
     * {@code
     * software.amazon.awssdk.services.honeycode.paginators.ListTableColumnsIterable responses = client.listTableColumnsPaginator(request);
     * responses.stream().forEach(....);
     * }
     * 
* * 2) Using For loop * *
     * {
     *     @code
     *     software.amazon.awssdk.services.honeycode.paginators.ListTableColumnsIterable responses = client
     *             .listTableColumnsPaginator(request);
     *     for (software.amazon.awssdk.services.honeycode.model.ListTableColumnsResponse response : responses) {
     *         // do something;
     *     }
     * }
     * 
* * 3) Use iterator directly * *
     * {@code
     * software.amazon.awssdk.services.honeycode.paginators.ListTableColumnsIterable responses = client.listTableColumnsPaginator(request);
     * responses.iterator().forEachRemaining(....);
     * }
     * 
*

* Please notice that the configuration of null won't limit the number of results you get with the paginator. It * only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listTableColumns(software.amazon.awssdk.services.honeycode.model.ListTableColumnsRequest)} operation. *

* * @param listTableColumnsRequest * @return A custom iterable that can be used to iterate through all the response pages. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws RequestTimeoutException * The request timed out. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.ListTableColumns * @see AWS * API Documentation */ @Override public ListTableColumnsIterable listTableColumnsPaginator(ListTableColumnsRequest listTableColumnsRequest) throws AccessDeniedException, InternalServerException, RequestTimeoutException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, ValidationException, AwsServiceException, SdkClientException, HoneycodeException { return new ListTableColumnsIterable(this, applyPaginatorUserAgent(listTableColumnsRequest)); } /** *

* The ListTableRows API allows you to retrieve a list of all the rows in a table in a workbook. *

* * @param listTableRowsRequest * @return Result of the ListTableRows operation returned by the service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws RequestTimeoutException * The request timed out. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.ListTableRows * @see AWS API * Documentation */ @Override public ListTableRowsResponse listTableRows(ListTableRowsRequest listTableRowsRequest) throws AccessDeniedException, InternalServerException, ResourceNotFoundException, ServiceUnavailableException, ValidationException, RequestTimeoutException, ThrottlingException, AwsServiceException, SdkClientException, HoneycodeException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListTableRowsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, listTableRowsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Honeycode"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTableRows"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListTableRows").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(listTableRowsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListTableRowsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* The ListTableRows API allows you to retrieve a list of all the rows in a table in a workbook. *

*
*

* This is a variant of {@link #listTableRows(software.amazon.awssdk.services.honeycode.model.ListTableRowsRequest)} * operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will * internally handle making service calls for you. *

*

* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no * guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response * pages by making service calls until there are no pages left or your iteration stops. If there are errors in your * request, you will see the failures only after you start iterating through the iterable. *

* *

* The following are few ways to iterate through the response pages: *

* 1) Using a Stream * *
     * {@code
     * software.amazon.awssdk.services.honeycode.paginators.ListTableRowsIterable responses = client.listTableRowsPaginator(request);
     * responses.stream().forEach(....);
     * }
     * 
* * 2) Using For loop * *
     * {
     *     @code
     *     software.amazon.awssdk.services.honeycode.paginators.ListTableRowsIterable responses = client.listTableRowsPaginator(request);
     *     for (software.amazon.awssdk.services.honeycode.model.ListTableRowsResponse response : responses) {
     *         // do something;
     *     }
     * }
     * 
* * 3) Use iterator directly * *
     * {@code
     * software.amazon.awssdk.services.honeycode.paginators.ListTableRowsIterable responses = client.listTableRowsPaginator(request);
     * responses.iterator().forEachRemaining(....);
     * }
     * 
*

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listTableRows(software.amazon.awssdk.services.honeycode.model.ListTableRowsRequest)} operation. *

* * @param listTableRowsRequest * @return A custom iterable that can be used to iterate through all the response pages. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws RequestTimeoutException * The request timed out. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.ListTableRows * @see AWS API * Documentation */ @Override public ListTableRowsIterable listTableRowsPaginator(ListTableRowsRequest listTableRowsRequest) throws AccessDeniedException, InternalServerException, ResourceNotFoundException, ServiceUnavailableException, ValidationException, RequestTimeoutException, ThrottlingException, AwsServiceException, SdkClientException, HoneycodeException { return new ListTableRowsIterable(this, applyPaginatorUserAgent(listTableRowsRequest)); } /** *

* The ListTables API allows you to retrieve a list of all the tables in a workbook. *

* * @param listTablesRequest * @return Result of the ListTables operation returned by the service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws RequestTimeoutException * The request timed out. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.ListTables * @see AWS API * Documentation */ @Override public ListTablesResponse listTables(ListTablesRequest listTablesRequest) throws AccessDeniedException, InternalServerException, RequestTimeoutException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, ValidationException, AwsServiceException, SdkClientException, HoneycodeException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListTablesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, listTablesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Honeycode"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTables"); return clientHandler .execute(new ClientExecutionParams().withOperationName("ListTables") .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(listTablesRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListTablesRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* The ListTables API allows you to retrieve a list of all the tables in a workbook. *

*
*

* This is a variant of {@link #listTables(software.amazon.awssdk.services.honeycode.model.ListTablesRequest)} * operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will * internally handle making service calls for you. *

*

* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no * guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response * pages by making service calls until there are no pages left or your iteration stops. If there are errors in your * request, you will see the failures only after you start iterating through the iterable. *

* *

* The following are few ways to iterate through the response pages: *

* 1) Using a Stream * *
     * {@code
     * software.amazon.awssdk.services.honeycode.paginators.ListTablesIterable responses = client.listTablesPaginator(request);
     * responses.stream().forEach(....);
     * }
     * 
* * 2) Using For loop * *
     * {
     *     @code
     *     software.amazon.awssdk.services.honeycode.paginators.ListTablesIterable responses = client.listTablesPaginator(request);
     *     for (software.amazon.awssdk.services.honeycode.model.ListTablesResponse response : responses) {
     *         // do something;
     *     }
     * }
     * 
* * 3) Use iterator directly * *
     * {@code
     * software.amazon.awssdk.services.honeycode.paginators.ListTablesIterable responses = client.listTablesPaginator(request);
     * responses.iterator().forEachRemaining(....);
     * }
     * 
*

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #listTables(software.amazon.awssdk.services.honeycode.model.ListTablesRequest)} operation. *

* * @param listTablesRequest * @return A custom iterable that can be used to iterate through all the response pages. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws RequestTimeoutException * The request timed out. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.ListTables * @see AWS API * Documentation */ @Override public ListTablesIterable listTablesPaginator(ListTablesRequest listTablesRequest) throws AccessDeniedException, InternalServerException, RequestTimeoutException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, ValidationException, AwsServiceException, SdkClientException, HoneycodeException { return new ListTablesIterable(this, applyPaginatorUserAgent(listTablesRequest)); } /** *

* The ListTagsForResource API allows you to return a resource's tags. *

* * @param listTagsForResourceRequest * @return Result of the ListTagsForResource operation returned by the service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws RequestTimeoutException * The request timed out. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.ListTagsForResource * @see AWS * API Documentation */ @Override public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) throws AccessDeniedException, InternalServerException, RequestTimeoutException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, ValidationException, AwsServiceException, SdkClientException, HoneycodeException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTagsForResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Honeycode"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListTagsForResource").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(listTagsForResourceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* The QueryTableRows API allows you to use a filter formula to query for specific rows in a table. *

* * @param queryTableRowsRequest * @return Result of the QueryTableRows operation returned by the service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws RequestTimeoutException * The request timed out. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.QueryTableRows * @see AWS API * Documentation */ @Override public QueryTableRowsResponse queryTableRows(QueryTableRowsRequest queryTableRowsRequest) throws AccessDeniedException, InternalServerException, RequestTimeoutException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, ValidationException, AwsServiceException, SdkClientException, HoneycodeException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, QueryTableRowsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, queryTableRowsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Honeycode"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "QueryTableRows"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("QueryTableRows").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(queryTableRowsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new QueryTableRowsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* The QueryTableRows API allows you to use a filter formula to query for specific rows in a table. *

*
*

* This is a variant of * {@link #queryTableRows(software.amazon.awssdk.services.honeycode.model.QueryTableRowsRequest)} operation. The * return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle * making service calls for you. *

*

* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no * guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response * pages by making service calls until there are no pages left or your iteration stops. If there are errors in your * request, you will see the failures only after you start iterating through the iterable. *

* *

* The following are few ways to iterate through the response pages: *

* 1) Using a Stream * *
     * {@code
     * software.amazon.awssdk.services.honeycode.paginators.QueryTableRowsIterable responses = client.queryTableRowsPaginator(request);
     * responses.stream().forEach(....);
     * }
     * 
* * 2) Using For loop * *
     * {
     *     @code
     *     software.amazon.awssdk.services.honeycode.paginators.QueryTableRowsIterable responses = client
     *             .queryTableRowsPaginator(request);
     *     for (software.amazon.awssdk.services.honeycode.model.QueryTableRowsResponse response : responses) {
     *         // do something;
     *     }
     * }
     * 
* * 3) Use iterator directly * *
     * {@code
     * software.amazon.awssdk.services.honeycode.paginators.QueryTableRowsIterable responses = client.queryTableRowsPaginator(request);
     * responses.iterator().forEachRemaining(....);
     * }
     * 
*

* Please notice that the configuration of maxResults won't limit the number of results you get with the * paginator. It only limits the number of results in each page. *

*

* Note: If you prefer to have control on service calls, use the * {@link #queryTableRows(software.amazon.awssdk.services.honeycode.model.QueryTableRowsRequest)} operation. *

* * @param queryTableRowsRequest * @return A custom iterable that can be used to iterate through all the response pages. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws RequestTimeoutException * The request timed out. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.QueryTableRows * @see AWS API * Documentation */ @Override public QueryTableRowsIterable queryTableRowsPaginator(QueryTableRowsRequest queryTableRowsRequest) throws AccessDeniedException, InternalServerException, RequestTimeoutException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, ValidationException, AwsServiceException, SdkClientException, HoneycodeException { return new QueryTableRowsIterable(this, applyPaginatorUserAgent(queryTableRowsRequest)); } /** *

* The StartTableDataImportJob API allows you to start an import job on a table. This API will only return the id of * the job that was started. To find out the status of the import request, you need to call the * DescribeTableDataImportJob API. *

* * @param startTableDataImportJobRequest * @return Result of the StartTableDataImportJob operation returned by the service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws RequestTimeoutException * The request timed out. * @throws ServiceQuotaExceededException * The request caused service quota to be breached. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.StartTableDataImportJob * @see AWS API Documentation */ @Override public StartTableDataImportJobResponse startTableDataImportJob(StartTableDataImportJobRequest startTableDataImportJobRequest) throws AccessDeniedException, InternalServerException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, ValidationException, RequestTimeoutException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, HoneycodeException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartTableDataImportJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, startTableDataImportJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Honeycode"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartTableDataImportJob"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("StartTableDataImportJob").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(startTableDataImportJobRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new StartTableDataImportJobRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* The TagResource API allows you to add tags to an ARN-able resource. Resource includes workbook, table, screen and * screen-automation. *

* * @param tagResourceRequest * @return Result of the TagResource operation returned by the service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws RequestTimeoutException * The request timed out. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.TagResource * @see AWS API * Documentation */ @Override public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws AccessDeniedException, InternalServerException, RequestTimeoutException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, ValidationException, AwsServiceException, SdkClientException, HoneycodeException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, TagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Honeycode"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("TagResource").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(tagResourceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new TagResourceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* The UntagResource API allows you to removes tags from an ARN-able resource. Resource includes workbook, table, * screen and screen-automation. *

* * @param untagResourceRequest * @return Result of the UntagResource operation returned by the service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. Check that the workbook is owned by you and * your IAM policy allows access to the resource in the request. * @throws InternalServerException * There were unexpected errors from the server. * @throws RequestTimeoutException * The request timed out. * @throws ResourceNotFoundException * A Workbook, Table, App, Screen or Screen Automation was not found with the given ID. * @throws ServiceUnavailableException * Remote service is unreachable. * @throws ThrottlingException * Tps(transactions per second) rate reached. * @throws ValidationException * Request is invalid. The message in the response contains details on why the request is invalid. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws HoneycodeException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample HoneycodeClient.UntagResource * @see AWS API * Documentation */ @Override public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws AccessDeniedException, InternalServerException, RequestTimeoutException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, ValidationException, AwsServiceException, SdkClientException, HoneycodeException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UntagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Honeycode"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UntagResource").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(untagResourceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UntagResourceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } private T applyPaginatorUserAgent(T request) { Consumer userAgentApplier = b -> b.addApiName(ApiName.builder() .version(VersionInfo.SDK_VERSION).name("PAGINATED").build()); AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration() .map(c -> c.toBuilder().applyMutation(userAgentApplier).build()) .orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build())); return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build(); } @Override public final String serviceName() { return SERVICE_NAME; } private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration, RequestOverrideConfiguration requestOverrideConfiguration) { List publishers = null; if (requestOverrideConfiguration != null) { publishers = requestOverrideConfiguration.metricPublishers(); } if (publishers == null || publishers.isEmpty()) { publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS); } if (publishers == null) { publishers = Collections.emptyList(); } return publishers; } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(HoneycodeException::builder) .protocol(AwsJsonProtocol.REST_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("AccessDeniedException") .exceptionBuilderSupplier(AccessDeniedException::builder).httpStatusCode(403).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AutomationExecutionException") .exceptionBuilderSupplier(AutomationExecutionException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("RequestTimeoutException") .exceptionBuilderSupplier(RequestTimeoutException::builder).httpStatusCode(504).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFoundException") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(404).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AutomationExecutionTimeoutException") .exceptionBuilderSupplier(AutomationExecutionTimeoutException::builder).httpStatusCode(504) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ThrottlingException") .exceptionBuilderSupplier(ThrottlingException::builder).httpStatusCode(429).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ValidationException") .exceptionBuilderSupplier(ValidationException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceUnavailableException") .exceptionBuilderSupplier(ServiceUnavailableException::builder).httpStatusCode(503).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceQuotaExceededException") .exceptionBuilderSupplier(ServiceQuotaExceededException::builder).httpStatusCode(402).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalServerException") .exceptionBuilderSupplier(InternalServerException::builder).httpStatusCode(500).build()); } @Override public final HoneycodeServiceClientConfiguration serviceClientConfiguration() { return this.serviceClientConfiguration; } @Override public void close() { clientHandler.close(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy