|
75 | 75 | import software.amazon.awssdk.services.json.model.JsonRequest;
|
76 | 76 | import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredRequest;
|
77 | 77 | import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredResponse;
|
| 78 | +import software.amazon.awssdk.services.json.model.OperationWithNoneAuthTypeRequest; |
| 79 | +import software.amazon.awssdk.services.json.model.OperationWithNoneAuthTypeResponse; |
78 | 80 | import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest;
|
79 | 81 | import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyResponse;
|
80 | 82 | import software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyRequest;
|
|
99 | 101 | import software.amazon.awssdk.services.json.transform.InputEventMarshaller;
|
100 | 102 | import software.amazon.awssdk.services.json.transform.InputEventTwoMarshaller;
|
101 | 103 | import software.amazon.awssdk.services.json.transform.OperationWithChecksumRequiredRequestMarshaller;
|
| 104 | +import software.amazon.awssdk.services.json.transform.OperationWithNoneAuthTypeRequestMarshaller; |
102 | 105 | import software.amazon.awssdk.services.json.transform.PaginatedOperationWithResultKeyRequestMarshaller;
|
103 | 106 | import software.amazon.awssdk.services.json.transform.PaginatedOperationWithoutResultKeyRequestMarshaller;
|
104 | 107 | import software.amazon.awssdk.services.json.transform.StreamingInputOperationRequestMarshaller;
|
@@ -617,6 +620,63 @@ public CompletableFuture<OperationWithChecksumRequiredResponse> operationWithChe
|
617 | 620 | }
|
618 | 621 | }
|
619 | 622 |
|
| 623 | + /** |
| 624 | + * Invokes the OperationWithNoneAuthType operation asynchronously. |
| 625 | + * |
| 626 | + * @param operationWithNoneAuthTypeRequest |
| 627 | + * @return A Java Future containing the result of the OperationWithNoneAuthType operation returned by the service.<br/> |
| 628 | + * The CompletableFuture returned by this method can be completed exceptionally with the following |
| 629 | + * exceptions. |
| 630 | + * <ul> |
| 631 | + * <li>SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). |
| 632 | + * Can be used for catch all scenarios.</li> |
| 633 | + * <li>SdkClientException If any client side error occurs such as an IO related failure, failure to get |
| 634 | + * credentials, etc.</li> |
| 635 | + * <li>JsonException Base class for all service exceptions. Unknown exceptions will be thrown as an instance |
| 636 | + * of this type.</li> |
| 637 | + * </ul> |
| 638 | + * @sample JsonAsyncClient.OperationWithNoneAuthType |
| 639 | + * @see <a href="https://docs.aws.amazon.com/goto/WebAPI/json-service-2010-05-08/OperationWithNoneAuthType" |
| 640 | + * target="_top">AWS API Documentation</a> |
| 641 | + */ |
| 642 | + @Override |
| 643 | + public CompletableFuture<OperationWithNoneAuthTypeResponse> operationWithNoneAuthType( |
| 644 | + OperationWithNoneAuthTypeRequest operationWithNoneAuthTypeRequest) { |
| 645 | + List<MetricPublisher> metricPublishers = resolveMetricPublishers(clientConfiguration, operationWithNoneAuthTypeRequest |
| 646 | + .overrideConfiguration().orElse(null)); |
| 647 | + MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector |
| 648 | + .create("ApiCall"); |
| 649 | + try { |
| 650 | + apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); |
| 651 | + apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "OperationWithNoneAuthType"); |
| 652 | + JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) |
| 653 | + .isPayloadJson(true).build(); |
| 654 | + |
| 655 | + HttpResponseHandler<OperationWithNoneAuthTypeResponse> responseHandler = protocolFactory.createResponseHandler( |
| 656 | + operationMetadata, OperationWithNoneAuthTypeResponse::builder); |
| 657 | + |
| 658 | + HttpResponseHandler<AwsServiceException> errorResponseHandler = createErrorResponseHandler(protocolFactory, |
| 659 | + operationMetadata); |
| 660 | + |
| 661 | + CompletableFuture<OperationWithNoneAuthTypeResponse> executeFuture = clientHandler |
| 662 | + .execute(new ClientExecutionParams<OperationWithNoneAuthTypeRequest, OperationWithNoneAuthTypeResponse>() |
| 663 | + .withOperationName("OperationWithNoneAuthType") |
| 664 | + .withMarshaller(new OperationWithNoneAuthTypeRequestMarshaller(protocolFactory)) |
| 665 | + .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) |
| 666 | + .withMetricCollector(apiCallMetricCollector) |
| 667 | + .putExecutionAttribute(SdkInternalExecutionAttribute.IS_NONE_AUTH_TYPE_REQUEST, false) |
| 668 | + .withInput(operationWithNoneAuthTypeRequest)); |
| 669 | + CompletableFuture<OperationWithNoneAuthTypeResponse> whenCompleted = executeFuture.whenComplete((r, e) -> { |
| 670 | + metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); |
| 671 | + }); |
| 672 | + executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); |
| 673 | + return executeFuture; |
| 674 | + } catch (Throwable t) { |
| 675 | + metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); |
| 676 | + return CompletableFutureUtils.failedFuture(t); |
| 677 | + } |
| 678 | + } |
| 679 | + |
620 | 680 | /**
|
621 | 681 | * Some paginated operation with result_key in paginators.json file
|
622 | 682 | *
|
|
0 commit comments