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

software.amazon.awssdk.services.networkmanager.DefaultNetworkManagerAsyncClient 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.networkmanager;

import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import java.util.function.Function;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.awscore.retry.AwsRetryStrategy;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.retry.RetryMode;
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.retries.api.RetryStrategy;
import software.amazon.awssdk.services.networkmanager.internal.NetworkManagerServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.networkmanager.model.AcceptAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.AcceptAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.AccessDeniedException;
import software.amazon.awssdk.services.networkmanager.model.AssociateConnectPeerRequest;
import software.amazon.awssdk.services.networkmanager.model.AssociateConnectPeerResponse;
import software.amazon.awssdk.services.networkmanager.model.AssociateCustomerGatewayRequest;
import software.amazon.awssdk.services.networkmanager.model.AssociateCustomerGatewayResponse;
import software.amazon.awssdk.services.networkmanager.model.AssociateLinkRequest;
import software.amazon.awssdk.services.networkmanager.model.AssociateLinkResponse;
import software.amazon.awssdk.services.networkmanager.model.AssociateTransitGatewayConnectPeerRequest;
import software.amazon.awssdk.services.networkmanager.model.AssociateTransitGatewayConnectPeerResponse;
import software.amazon.awssdk.services.networkmanager.model.ConflictException;
import software.amazon.awssdk.services.networkmanager.model.CoreNetworkPolicyException;
import software.amazon.awssdk.services.networkmanager.model.CreateConnectAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateConnectAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateConnectPeerRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateConnectPeerResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateConnectionRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateConnectionResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateCoreNetworkRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateCoreNetworkResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateDeviceRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateDeviceResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateDirectConnectGatewayAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateDirectConnectGatewayAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateGlobalNetworkRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateGlobalNetworkResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateLinkRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateLinkResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateSiteRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateSiteResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateSiteToSiteVpnAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateSiteToSiteVpnAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateTransitGatewayPeeringRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateTransitGatewayPeeringResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateTransitGatewayRouteTableAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateTransitGatewayRouteTableAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.CreateVpcAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.CreateVpcAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteConnectPeerRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteConnectPeerResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteConnectionRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteConnectionResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteCoreNetworkPolicyVersionRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteCoreNetworkPolicyVersionResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteCoreNetworkRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteCoreNetworkResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteDeviceRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteDeviceResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteGlobalNetworkRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteGlobalNetworkResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteLinkRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteLinkResponse;
import software.amazon.awssdk.services.networkmanager.model.DeletePeeringRequest;
import software.amazon.awssdk.services.networkmanager.model.DeletePeeringResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteResourcePolicyRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteResourcePolicyResponse;
import software.amazon.awssdk.services.networkmanager.model.DeleteSiteRequest;
import software.amazon.awssdk.services.networkmanager.model.DeleteSiteResponse;
import software.amazon.awssdk.services.networkmanager.model.DeregisterTransitGatewayRequest;
import software.amazon.awssdk.services.networkmanager.model.DeregisterTransitGatewayResponse;
import software.amazon.awssdk.services.networkmanager.model.DescribeGlobalNetworksRequest;
import software.amazon.awssdk.services.networkmanager.model.DescribeGlobalNetworksResponse;
import software.amazon.awssdk.services.networkmanager.model.DisassociateConnectPeerRequest;
import software.amazon.awssdk.services.networkmanager.model.DisassociateConnectPeerResponse;
import software.amazon.awssdk.services.networkmanager.model.DisassociateCustomerGatewayRequest;
import software.amazon.awssdk.services.networkmanager.model.DisassociateCustomerGatewayResponse;
import software.amazon.awssdk.services.networkmanager.model.DisassociateLinkRequest;
import software.amazon.awssdk.services.networkmanager.model.DisassociateLinkResponse;
import software.amazon.awssdk.services.networkmanager.model.DisassociateTransitGatewayConnectPeerRequest;
import software.amazon.awssdk.services.networkmanager.model.DisassociateTransitGatewayConnectPeerResponse;
import software.amazon.awssdk.services.networkmanager.model.ExecuteCoreNetworkChangeSetRequest;
import software.amazon.awssdk.services.networkmanager.model.ExecuteCoreNetworkChangeSetResponse;
import software.amazon.awssdk.services.networkmanager.model.GetConnectAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.GetConnectAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.GetConnectPeerAssociationsRequest;
import software.amazon.awssdk.services.networkmanager.model.GetConnectPeerAssociationsResponse;
import software.amazon.awssdk.services.networkmanager.model.GetConnectPeerRequest;
import software.amazon.awssdk.services.networkmanager.model.GetConnectPeerResponse;
import software.amazon.awssdk.services.networkmanager.model.GetConnectionsRequest;
import software.amazon.awssdk.services.networkmanager.model.GetConnectionsResponse;
import software.amazon.awssdk.services.networkmanager.model.GetCoreNetworkChangeEventsRequest;
import software.amazon.awssdk.services.networkmanager.model.GetCoreNetworkChangeEventsResponse;
import software.amazon.awssdk.services.networkmanager.model.GetCoreNetworkChangeSetRequest;
import software.amazon.awssdk.services.networkmanager.model.GetCoreNetworkChangeSetResponse;
import software.amazon.awssdk.services.networkmanager.model.GetCoreNetworkPolicyRequest;
import software.amazon.awssdk.services.networkmanager.model.GetCoreNetworkPolicyResponse;
import software.amazon.awssdk.services.networkmanager.model.GetCoreNetworkRequest;
import software.amazon.awssdk.services.networkmanager.model.GetCoreNetworkResponse;
import software.amazon.awssdk.services.networkmanager.model.GetCustomerGatewayAssociationsRequest;
import software.amazon.awssdk.services.networkmanager.model.GetCustomerGatewayAssociationsResponse;
import software.amazon.awssdk.services.networkmanager.model.GetDevicesRequest;
import software.amazon.awssdk.services.networkmanager.model.GetDevicesResponse;
import software.amazon.awssdk.services.networkmanager.model.GetDirectConnectGatewayAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.GetDirectConnectGatewayAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.GetLinkAssociationsRequest;
import software.amazon.awssdk.services.networkmanager.model.GetLinkAssociationsResponse;
import software.amazon.awssdk.services.networkmanager.model.GetLinksRequest;
import software.amazon.awssdk.services.networkmanager.model.GetLinksResponse;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkResourceCountsRequest;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkResourceCountsResponse;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkResourceRelationshipsRequest;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkResourceRelationshipsResponse;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkResourcesRequest;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkResourcesResponse;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkRoutesRequest;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkRoutesResponse;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkTelemetryRequest;
import software.amazon.awssdk.services.networkmanager.model.GetNetworkTelemetryResponse;
import software.amazon.awssdk.services.networkmanager.model.GetResourcePolicyRequest;
import software.amazon.awssdk.services.networkmanager.model.GetResourcePolicyResponse;
import software.amazon.awssdk.services.networkmanager.model.GetRouteAnalysisRequest;
import software.amazon.awssdk.services.networkmanager.model.GetRouteAnalysisResponse;
import software.amazon.awssdk.services.networkmanager.model.GetSiteToSiteVpnAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.GetSiteToSiteVpnAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.GetSitesRequest;
import software.amazon.awssdk.services.networkmanager.model.GetSitesResponse;
import software.amazon.awssdk.services.networkmanager.model.GetTransitGatewayConnectPeerAssociationsRequest;
import software.amazon.awssdk.services.networkmanager.model.GetTransitGatewayConnectPeerAssociationsResponse;
import software.amazon.awssdk.services.networkmanager.model.GetTransitGatewayPeeringRequest;
import software.amazon.awssdk.services.networkmanager.model.GetTransitGatewayPeeringResponse;
import software.amazon.awssdk.services.networkmanager.model.GetTransitGatewayRegistrationsRequest;
import software.amazon.awssdk.services.networkmanager.model.GetTransitGatewayRegistrationsResponse;
import software.amazon.awssdk.services.networkmanager.model.GetTransitGatewayRouteTableAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.GetTransitGatewayRouteTableAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.GetVpcAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.GetVpcAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.InternalServerException;
import software.amazon.awssdk.services.networkmanager.model.ListAttachmentsRequest;
import software.amazon.awssdk.services.networkmanager.model.ListAttachmentsResponse;
import software.amazon.awssdk.services.networkmanager.model.ListConnectPeersRequest;
import software.amazon.awssdk.services.networkmanager.model.ListConnectPeersResponse;
import software.amazon.awssdk.services.networkmanager.model.ListCoreNetworkPolicyVersionsRequest;
import software.amazon.awssdk.services.networkmanager.model.ListCoreNetworkPolicyVersionsResponse;
import software.amazon.awssdk.services.networkmanager.model.ListCoreNetworksRequest;
import software.amazon.awssdk.services.networkmanager.model.ListCoreNetworksResponse;
import software.amazon.awssdk.services.networkmanager.model.ListOrganizationServiceAccessStatusRequest;
import software.amazon.awssdk.services.networkmanager.model.ListOrganizationServiceAccessStatusResponse;
import software.amazon.awssdk.services.networkmanager.model.ListPeeringsRequest;
import software.amazon.awssdk.services.networkmanager.model.ListPeeringsResponse;
import software.amazon.awssdk.services.networkmanager.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.networkmanager.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.networkmanager.model.NetworkManagerException;
import software.amazon.awssdk.services.networkmanager.model.PutCoreNetworkPolicyRequest;
import software.amazon.awssdk.services.networkmanager.model.PutCoreNetworkPolicyResponse;
import software.amazon.awssdk.services.networkmanager.model.PutResourcePolicyRequest;
import software.amazon.awssdk.services.networkmanager.model.PutResourcePolicyResponse;
import software.amazon.awssdk.services.networkmanager.model.RegisterTransitGatewayRequest;
import software.amazon.awssdk.services.networkmanager.model.RegisterTransitGatewayResponse;
import software.amazon.awssdk.services.networkmanager.model.RejectAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.RejectAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.ResourceNotFoundException;
import software.amazon.awssdk.services.networkmanager.model.RestoreCoreNetworkPolicyVersionRequest;
import software.amazon.awssdk.services.networkmanager.model.RestoreCoreNetworkPolicyVersionResponse;
import software.amazon.awssdk.services.networkmanager.model.ServiceQuotaExceededException;
import software.amazon.awssdk.services.networkmanager.model.StartOrganizationServiceAccessUpdateRequest;
import software.amazon.awssdk.services.networkmanager.model.StartOrganizationServiceAccessUpdateResponse;
import software.amazon.awssdk.services.networkmanager.model.StartRouteAnalysisRequest;
import software.amazon.awssdk.services.networkmanager.model.StartRouteAnalysisResponse;
import software.amazon.awssdk.services.networkmanager.model.TagResourceRequest;
import software.amazon.awssdk.services.networkmanager.model.TagResourceResponse;
import software.amazon.awssdk.services.networkmanager.model.ThrottlingException;
import software.amazon.awssdk.services.networkmanager.model.UntagResourceRequest;
import software.amazon.awssdk.services.networkmanager.model.UntagResourceResponse;
import software.amazon.awssdk.services.networkmanager.model.UpdateConnectionRequest;
import software.amazon.awssdk.services.networkmanager.model.UpdateConnectionResponse;
import software.amazon.awssdk.services.networkmanager.model.UpdateCoreNetworkRequest;
import software.amazon.awssdk.services.networkmanager.model.UpdateCoreNetworkResponse;
import software.amazon.awssdk.services.networkmanager.model.UpdateDeviceRequest;
import software.amazon.awssdk.services.networkmanager.model.UpdateDeviceResponse;
import software.amazon.awssdk.services.networkmanager.model.UpdateDirectConnectGatewayAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.UpdateDirectConnectGatewayAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.UpdateGlobalNetworkRequest;
import software.amazon.awssdk.services.networkmanager.model.UpdateGlobalNetworkResponse;
import software.amazon.awssdk.services.networkmanager.model.UpdateLinkRequest;
import software.amazon.awssdk.services.networkmanager.model.UpdateLinkResponse;
import software.amazon.awssdk.services.networkmanager.model.UpdateNetworkResourceMetadataRequest;
import software.amazon.awssdk.services.networkmanager.model.UpdateNetworkResourceMetadataResponse;
import software.amazon.awssdk.services.networkmanager.model.UpdateSiteRequest;
import software.amazon.awssdk.services.networkmanager.model.UpdateSiteResponse;
import software.amazon.awssdk.services.networkmanager.model.UpdateVpcAttachmentRequest;
import software.amazon.awssdk.services.networkmanager.model.UpdateVpcAttachmentResponse;
import software.amazon.awssdk.services.networkmanager.model.ValidationException;
import software.amazon.awssdk.services.networkmanager.transform.AcceptAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.AssociateConnectPeerRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.AssociateCustomerGatewayRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.AssociateLinkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.AssociateTransitGatewayConnectPeerRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateConnectAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateConnectPeerRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateConnectionRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateCoreNetworkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateDeviceRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateDirectConnectGatewayAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateGlobalNetworkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateLinkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateSiteRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateSiteToSiteVpnAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateTransitGatewayPeeringRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateTransitGatewayRouteTableAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.CreateVpcAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteConnectPeerRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteConnectionRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteCoreNetworkPolicyVersionRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteCoreNetworkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteDeviceRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteGlobalNetworkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteLinkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeletePeeringRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeleteSiteRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DeregisterTransitGatewayRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DescribeGlobalNetworksRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DisassociateConnectPeerRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DisassociateCustomerGatewayRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DisassociateLinkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.DisassociateTransitGatewayConnectPeerRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.ExecuteCoreNetworkChangeSetRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetConnectAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetConnectPeerAssociationsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetConnectPeerRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetConnectionsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetCoreNetworkChangeEventsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetCoreNetworkChangeSetRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetCoreNetworkPolicyRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetCoreNetworkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetCustomerGatewayAssociationsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetDevicesRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetDirectConnectGatewayAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetLinkAssociationsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetLinksRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetNetworkResourceCountsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetNetworkResourceRelationshipsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetNetworkResourcesRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetNetworkRoutesRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetNetworkTelemetryRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetRouteAnalysisRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetSiteToSiteVpnAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetSitesRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetTransitGatewayConnectPeerAssociationsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetTransitGatewayPeeringRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetTransitGatewayRegistrationsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetTransitGatewayRouteTableAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.GetVpcAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.ListAttachmentsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.ListConnectPeersRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.ListCoreNetworkPolicyVersionsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.ListCoreNetworksRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.ListOrganizationServiceAccessStatusRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.ListPeeringsRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.PutCoreNetworkPolicyRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.PutResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.RegisterTransitGatewayRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.RejectAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.RestoreCoreNetworkPolicyVersionRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.StartOrganizationServiceAccessUpdateRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.StartRouteAnalysisRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UpdateConnectionRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UpdateCoreNetworkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UpdateDeviceRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UpdateDirectConnectGatewayAttachmentRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UpdateGlobalNetworkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UpdateLinkRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UpdateNetworkResourceMetadataRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UpdateSiteRequestMarshaller;
import software.amazon.awssdk.services.networkmanager.transform.UpdateVpcAttachmentRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;

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

    private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
            .serviceProtocol(AwsServiceProtocol.REST_JSON).build();

    private final AsyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

    protected DefaultNetworkManagerAsyncClient(SdkClientConfiguration clientConfiguration) {
        this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
        this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
        this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
    }

    /**
     * 

* Accepts a core network attachment request. *

*

* Once the attachment request is accepted by a core network owner, the attachment is created and connected to a * core network. *

* * @param acceptAttachmentRequest * @return A Java Future containing the result of the AcceptAttachment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.AcceptAttachment * @see AWS API Documentation */ @Override public CompletableFuture acceptAttachment(AcceptAttachmentRequest acceptAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(acceptAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, acceptAttachmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AcceptAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AcceptAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AcceptAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new AcceptAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(acceptAttachmentRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Associates a core network Connect peer with a device and optionally, with a link. *

*

* If you specify a link, it must be associated with the specified device. You can only associate core network * Connect peers that have been created on a core network Connect attachment on a core network. *

* * @param associateConnectPeerRequest * @return A Java Future containing the result of the AssociateConnectPeer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • ServiceQuotaExceededException A service limit was exceeded.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.AssociateConnectPeer * @see AWS API Documentation */ @Override public CompletableFuture associateConnectPeer( AssociateConnectPeerRequest associateConnectPeerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateConnectPeerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, associateConnectPeerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateConnectPeer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AssociateConnectPeerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AssociateConnectPeer").withProtocolMetadata(protocolMetadata) .withMarshaller(new AssociateConnectPeerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(associateConnectPeerRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Associates a customer gateway with a device and optionally, with a link. If you specify a link, it must be * associated with the specified device. *

*

* You can only associate customer gateways that are connected to a VPN attachment on a transit gateway or core * network registered in your global network. When you register a transit gateway or core network, customer gateways * that are connected to the transit gateway are automatically included in the global network. To list customer * gateways that are connected to a transit gateway, use the DescribeVpnConnections EC2 API and filter by transit-gateway-id. *

*

* You cannot associate a customer gateway with more than one device and link. *

* * @param associateCustomerGatewayRequest * @return A Java Future containing the result of the AssociateCustomerGateway operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • ServiceQuotaExceededException A service limit was exceeded.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.AssociateCustomerGateway * @see AWS API Documentation */ @Override public CompletableFuture associateCustomerGateway( AssociateCustomerGatewayRequest associateCustomerGatewayRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateCustomerGatewayRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, associateCustomerGatewayRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateCustomerGateway"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AssociateCustomerGatewayResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AssociateCustomerGateway").withProtocolMetadata(protocolMetadata) .withMarshaller(new AssociateCustomerGatewayRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(associateCustomerGatewayRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Associates a link to a device. A device can be associated to multiple links and a link can be associated to * multiple devices. The device and link must be in the same global network and the same site. *

* * @param associateLinkRequest * @return A Java Future containing the result of the AssociateLink operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • ServiceQuotaExceededException A service limit was exceeded.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.AssociateLink * @see AWS * API Documentation */ @Override public CompletableFuture associateLink(AssociateLinkRequest associateLinkRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateLinkRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, associateLinkRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateLink"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, AssociateLinkResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AssociateLink").withProtocolMetadata(protocolMetadata) .withMarshaller(new AssociateLinkRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(associateLinkRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Associates a transit gateway Connect peer with a device, and optionally, with a link. If you specify a link, it * must be associated with the specified device. *

*

* You can only associate transit gateway Connect peers that have been created on a transit gateway that's * registered in your global network. *

*

* You cannot associate a transit gateway Connect peer with more than one device and link. *

* * @param associateTransitGatewayConnectPeerRequest * @return A Java Future containing the result of the AssociateTransitGatewayConnectPeer operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • ServiceQuotaExceededException A service limit was exceeded.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.AssociateTransitGatewayConnectPeer * @see AWS API Documentation */ @Override public CompletableFuture associateTransitGatewayConnectPeer( AssociateTransitGatewayConnectPeerRequest associateTransitGatewayConnectPeerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateTransitGatewayConnectPeerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, associateTransitGatewayConnectPeerRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateTransitGatewayConnectPeer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, AssociateTransitGatewayConnectPeerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AssociateTransitGatewayConnectPeer").withProtocolMetadata(protocolMetadata) .withMarshaller(new AssociateTransitGatewayConnectPeerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(associateTransitGatewayConnectPeerRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a core network Connect attachment from a specified core network attachment. *

*

* A core network Connect attachment is a GRE-based tunnel attachment that you can use to establish a connection * between a core network and an appliance. A core network Connect attachment uses an existing VPC attachment as the * underlying transport mechanism. *

* * @param createConnectAttachmentRequest * @return A Java Future containing the result of the CreateConnectAttachment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.CreateConnectAttachment * @see AWS API Documentation */ @Override public CompletableFuture createConnectAttachment( CreateConnectAttachmentRequest createConnectAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createConnectAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createConnectAttachmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateConnectAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateConnectAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateConnectAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateConnectAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createConnectAttachmentRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a core network Connect peer for a specified core network connect attachment between a core network and an * appliance. The peer address and transit gateway address must be the same IP address family (IPv4 or IPv6). *

* * @param createConnectPeerRequest * @return A Java Future containing the result of the CreateConnectPeer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.CreateConnectPeer * @see AWS API Documentation */ @Override public CompletableFuture createConnectPeer(CreateConnectPeerRequest createConnectPeerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createConnectPeerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createConnectPeerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateConnectPeer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateConnectPeerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateConnectPeer").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateConnectPeerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createConnectPeerRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a connection between two devices. The devices can be a physical or virtual appliance that connects to a * third-party appliance in a VPC, or a physical appliance that connects to another physical appliance in an * on-premises network. *

* * @param createConnectionRequest * @return A Java Future containing the result of the CreateConnection operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • ServiceQuotaExceededException A service limit was exceeded.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.CreateConnection * @see AWS API Documentation */ @Override public CompletableFuture createConnection(CreateConnectionRequest createConnectionRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createConnectionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createConnectionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateConnection"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateConnectionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateConnection").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateConnectionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createConnectionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a core network as part of your global network, and optionally, with a core network policy. *

* * @param createCoreNetworkRequest * @return A Java Future containing the result of the CreateCoreNetwork operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • CoreNetworkPolicyException Describes a core network policy exception.
  • *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • ServiceQuotaExceededException A service limit was exceeded.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.CreateCoreNetwork * @see AWS API Documentation */ @Override public CompletableFuture createCoreNetwork(CreateCoreNetworkRequest createCoreNetworkRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createCoreNetworkRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createCoreNetworkRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCoreNetwork"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateCoreNetworkResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateCoreNetwork").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateCoreNetworkRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createCoreNetworkRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new device in a global network. If you specify both a site ID and a location, the location of the site * is used for visualization in the Network Manager console. *

* * @param createDeviceRequest * @return A Java Future containing the result of the CreateDevice operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • ServiceQuotaExceededException A service limit was exceeded.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.CreateDevice * @see AWS * API Documentation */ @Override public CompletableFuture createDevice(CreateDeviceRequest createDeviceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDeviceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createDeviceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDevice"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateDeviceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateDevice").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateDeviceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createDeviceRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an Amazon Web Services Direct Connect gateway attachment *

* * @param createDirectConnectGatewayAttachmentRequest * @return A Java Future containing the result of the CreateDirectConnectGatewayAttachment operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.CreateDirectConnectGatewayAttachment * @see AWS API Documentation */ @Override public CompletableFuture createDirectConnectGatewayAttachment( CreateDirectConnectGatewayAttachmentRequest createDirectConnectGatewayAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDirectConnectGatewayAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createDirectConnectGatewayAttachmentRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDirectConnectGatewayAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, CreateDirectConnectGatewayAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateDirectConnectGatewayAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateDirectConnectGatewayAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createDirectConnectGatewayAttachmentRequest)); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new, empty global network. *

* * @param createGlobalNetworkRequest * @return A Java Future containing the result of the CreateGlobalNetwork operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • ServiceQuotaExceededException A service limit was exceeded.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.CreateGlobalNetwork * @see AWS API Documentation */ @Override public CompletableFuture createGlobalNetwork( CreateGlobalNetworkRequest createGlobalNetworkRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createGlobalNetworkRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createGlobalNetworkRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateGlobalNetwork"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateGlobalNetworkResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateGlobalNetwork").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateGlobalNetworkRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createGlobalNetworkRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new link for a specified site. *

* * @param createLinkRequest * @return A Java Future containing the result of the CreateLink operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • ServiceQuotaExceededException A service limit was exceeded.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.CreateLink * @see AWS API * Documentation */ @Override public CompletableFuture createLink(CreateLinkRequest createLinkRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createLinkRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createLinkRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateLink"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateLinkResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("CreateLink") .withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateLinkRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createLinkRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new site in a global network. *

* * @param createSiteRequest * @return A Java Future containing the result of the CreateSite operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • ServiceQuotaExceededException A service limit was exceeded.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.CreateSite * @see AWS API * Documentation */ @Override public CompletableFuture createSite(CreateSiteRequest createSiteRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createSiteRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createSiteRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSite"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateSiteResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("CreateSite") .withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateSiteRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createSiteRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates an Amazon Web Services site-to-site VPN attachment on an edge location of a core network. *

* * @param createSiteToSiteVpnAttachmentRequest * @return A Java Future containing the result of the CreateSiteToSiteVpnAttachment operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.CreateSiteToSiteVpnAttachment * @see AWS API Documentation */ @Override public CompletableFuture createSiteToSiteVpnAttachment( CreateSiteToSiteVpnAttachmentRequest createSiteToSiteVpnAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createSiteToSiteVpnAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createSiteToSiteVpnAttachmentRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSiteToSiteVpnAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateSiteToSiteVpnAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateSiteToSiteVpnAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateSiteToSiteVpnAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createSiteToSiteVpnAttachmentRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a transit gateway peering connection. *

* * @param createTransitGatewayPeeringRequest * @return A Java Future containing the result of the CreateTransitGatewayPeering operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.CreateTransitGatewayPeering * @see AWS API Documentation */ @Override public CompletableFuture createTransitGatewayPeering( CreateTransitGatewayPeeringRequest createTransitGatewayPeeringRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createTransitGatewayPeeringRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createTransitGatewayPeeringRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateTransitGatewayPeering"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateTransitGatewayPeeringResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateTransitGatewayPeering").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateTransitGatewayPeeringRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createTransitGatewayPeeringRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a transit gateway route table attachment. *

* * @param createTransitGatewayRouteTableAttachmentRequest * @return A Java Future containing the result of the CreateTransitGatewayRouteTableAttachment operation returned by * the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.CreateTransitGatewayRouteTableAttachment * @see AWS API Documentation */ @Override public CompletableFuture createTransitGatewayRouteTableAttachment( CreateTransitGatewayRouteTableAttachmentRequest createTransitGatewayRouteTableAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration( createTransitGatewayRouteTableAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createTransitGatewayRouteTableAttachmentRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateTransitGatewayRouteTableAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, CreateTransitGatewayRouteTableAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateTransitGatewayRouteTableAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateTransitGatewayRouteTableAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createTransitGatewayRouteTableAttachmentRequest)); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a VPC attachment on an edge location of a core network. *

* * @param createVpcAttachmentRequest * @return A Java Future containing the result of the CreateVpcAttachment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.CreateVpcAttachment * @see AWS API Documentation */ @Override public CompletableFuture createVpcAttachment( CreateVpcAttachmentRequest createVpcAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createVpcAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createVpcAttachmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateVpcAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateVpcAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateVpcAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateVpcAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createVpcAttachmentRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes an attachment. Supports all attachment types. *

* * @param deleteAttachmentRequest * @return A Java Future containing the result of the DeleteAttachment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.DeleteAttachment * @see AWS API Documentation */ @Override public CompletableFuture deleteAttachment(DeleteAttachmentRequest deleteAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAttachmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteAttachmentRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a Connect peer. *

* * @param deleteConnectPeerRequest * @return A Java Future containing the result of the DeleteConnectPeer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.DeleteConnectPeer * @see AWS API Documentation */ @Override public CompletableFuture deleteConnectPeer(DeleteConnectPeerRequest deleteConnectPeerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteConnectPeerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteConnectPeerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteConnectPeer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteConnectPeerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteConnectPeer").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteConnectPeerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteConnectPeerRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the specified connection in your global network. *

* * @param deleteConnectionRequest * @return A Java Future containing the result of the DeleteConnection operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.DeleteConnection * @see AWS API Documentation */ @Override public CompletableFuture deleteConnection(DeleteConnectionRequest deleteConnectionRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteConnectionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteConnectionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteConnection"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteConnectionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteConnection").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteConnectionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteConnectionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a core network along with all core network policies. This can only be done if there are no attachments on * a core network. *

* * @param deleteCoreNetworkRequest * @return A Java Future containing the result of the DeleteCoreNetwork operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.DeleteCoreNetwork * @see AWS API Documentation */ @Override public CompletableFuture deleteCoreNetwork(DeleteCoreNetworkRequest deleteCoreNetworkRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCoreNetworkRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCoreNetworkRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCoreNetwork"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteCoreNetworkResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCoreNetwork").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteCoreNetworkRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteCoreNetworkRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a policy version from a core network. You can't delete the current LIVE policy. *

* * @param deleteCoreNetworkPolicyVersionRequest * @return A Java Future containing the result of the DeleteCoreNetworkPolicyVersion operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.DeleteCoreNetworkPolicyVersion * @see AWS API Documentation */ @Override public CompletableFuture deleteCoreNetworkPolicyVersion( DeleteCoreNetworkPolicyVersionRequest deleteCoreNetworkPolicyVersionRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCoreNetworkPolicyVersionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCoreNetworkPolicyVersionRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCoreNetworkPolicyVersion"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteCoreNetworkPolicyVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCoreNetworkPolicyVersion").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteCoreNetworkPolicyVersionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteCoreNetworkPolicyVersionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes an existing device. You must first disassociate the device from any links and customer gateways. *

* * @param deleteDeviceRequest * @return A Java Future containing the result of the DeleteDevice operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.DeleteDevice * @see AWS * API Documentation */ @Override public CompletableFuture deleteDevice(DeleteDeviceRequest deleteDeviceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteDeviceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDeviceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDevice"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteDeviceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteDevice").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteDeviceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteDeviceRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes an existing global network. You must first delete all global network objects (devices, links, and sites), * deregister all transit gateways, and delete any core networks. *

* * @param deleteGlobalNetworkRequest * @return A Java Future containing the result of the DeleteGlobalNetwork operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.DeleteGlobalNetwork * @see AWS API Documentation */ @Override public CompletableFuture deleteGlobalNetwork( DeleteGlobalNetworkRequest deleteGlobalNetworkRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteGlobalNetworkRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteGlobalNetworkRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteGlobalNetwork"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteGlobalNetworkResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteGlobalNetwork").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteGlobalNetworkRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteGlobalNetworkRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes an existing link. You must first disassociate the link from any devices and customer gateways. *

* * @param deleteLinkRequest * @return A Java Future containing the result of the DeleteLink operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.DeleteLink * @see AWS API * Documentation */ @Override public CompletableFuture deleteLink(DeleteLinkRequest deleteLinkRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteLinkRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteLinkRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteLink"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteLinkResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("DeleteLink") .withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteLinkRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteLinkRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes an existing peering connection. *

* * @param deletePeeringRequest * @return A Java Future containing the result of the DeletePeering operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.DeletePeering * @see AWS * API Documentation */ @Override public CompletableFuture deletePeering(DeletePeeringRequest deletePeeringRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deletePeeringRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deletePeeringRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeletePeering"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeletePeeringResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeletePeering").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeletePeeringRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deletePeeringRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a resource policy for the specified resource. This revokes the access of the principals specified in the * resource policy. *

* * @param deleteResourcePolicyRequest * @return A Java Future containing the result of the DeleteResourcePolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.DeleteResourcePolicy * @see AWS API Documentation */ @Override public CompletableFuture deleteResourcePolicy( DeleteResourcePolicyRequest deleteResourcePolicyRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteResourcePolicyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteResourcePolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteResourcePolicy"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteResourcePolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteResourcePolicy").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteResourcePolicyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteResourcePolicyRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes an existing site. The site cannot be associated with any device or link. *

* * @param deleteSiteRequest * @return A Java Future containing the result of the DeleteSite operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.DeleteSite * @see AWS API * Documentation */ @Override public CompletableFuture deleteSite(DeleteSiteRequest deleteSiteRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteSiteRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSiteRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSite"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteSiteResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("DeleteSite") .withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteSiteRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteSiteRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deregisters a transit gateway from your global network. This action does not delete your transit gateway, or * modify any of its attachments. This action removes any customer gateway associations. *

* * @param deregisterTransitGatewayRequest * @return A Java Future containing the result of the DeregisterTransitGateway operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.DeregisterTransitGateway * @see AWS API Documentation */ @Override public CompletableFuture deregisterTransitGateway( DeregisterTransitGatewayRequest deregisterTransitGatewayRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deregisterTransitGatewayRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deregisterTransitGatewayRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeregisterTransitGateway"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeregisterTransitGatewayResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeregisterTransitGateway").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeregisterTransitGatewayRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deregisterTransitGatewayRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes one or more global networks. By default, all global networks are described. To describe the objects in * your global network, you must use the appropriate Get* action. For example, to list the transit * gateways in your global network, use GetTransitGatewayRegistrations. *

* * @param describeGlobalNetworksRequest * @return A Java Future containing the result of the DescribeGlobalNetworks operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.DescribeGlobalNetworks * @see AWS API Documentation */ @Override public CompletableFuture describeGlobalNetworks( DescribeGlobalNetworksRequest describeGlobalNetworksRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeGlobalNetworksRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeGlobalNetworksRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeGlobalNetworks"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeGlobalNetworksResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeGlobalNetworks").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeGlobalNetworksRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeGlobalNetworksRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Disassociates a core network Connect peer from a device and a link. *

* * @param disassociateConnectPeerRequest * @return A Java Future containing the result of the DisassociateConnectPeer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.DisassociateConnectPeer * @see AWS API Documentation */ @Override public CompletableFuture disassociateConnectPeer( DisassociateConnectPeerRequest disassociateConnectPeerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disassociateConnectPeerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateConnectPeerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateConnectPeer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DisassociateConnectPeerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DisassociateConnectPeer").withProtocolMetadata(protocolMetadata) .withMarshaller(new DisassociateConnectPeerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(disassociateConnectPeerRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Disassociates a customer gateway from a device and a link. *

* * @param disassociateCustomerGatewayRequest * @return A Java Future containing the result of the DisassociateCustomerGateway operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.DisassociateCustomerGateway * @see AWS API Documentation */ @Override public CompletableFuture disassociateCustomerGateway( DisassociateCustomerGatewayRequest disassociateCustomerGatewayRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disassociateCustomerGatewayRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateCustomerGatewayRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateCustomerGateway"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DisassociateCustomerGatewayResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DisassociateCustomerGateway").withProtocolMetadata(protocolMetadata) .withMarshaller(new DisassociateCustomerGatewayRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(disassociateCustomerGatewayRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Disassociates an existing device from a link. You must first disassociate any customer gateways that are * associated with the link. *

* * @param disassociateLinkRequest * @return A Java Future containing the result of the DisassociateLink operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.DisassociateLink * @see AWS API Documentation */ @Override public CompletableFuture disassociateLink(DisassociateLinkRequest disassociateLinkRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disassociateLinkRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateLinkRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateLink"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DisassociateLinkResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DisassociateLink").withProtocolMetadata(protocolMetadata) .withMarshaller(new DisassociateLinkRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(disassociateLinkRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Disassociates a transit gateway Connect peer from a device and link. *

* * @param disassociateTransitGatewayConnectPeerRequest * @return A Java Future containing the result of the DisassociateTransitGatewayConnectPeer operation returned by * the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.DisassociateTransitGatewayConnectPeer * @see AWS API Documentation */ @Override public CompletableFuture disassociateTransitGatewayConnectPeer( DisassociateTransitGatewayConnectPeerRequest disassociateTransitGatewayConnectPeerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disassociateTransitGatewayConnectPeerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateTransitGatewayConnectPeerRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateTransitGatewayConnectPeer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DisassociateTransitGatewayConnectPeerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DisassociateTransitGatewayConnectPeer").withProtocolMetadata(protocolMetadata) .withMarshaller(new DisassociateTransitGatewayConnectPeerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(disassociateTransitGatewayConnectPeerRequest)); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Executes a change set on your core network. Deploys changes globally based on the policy submitted.. *

* * @param executeCoreNetworkChangeSetRequest * @return A Java Future containing the result of the ExecuteCoreNetworkChangeSet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.ExecuteCoreNetworkChangeSet * @see AWS API Documentation */ @Override public CompletableFuture executeCoreNetworkChangeSet( ExecuteCoreNetworkChangeSetRequest executeCoreNetworkChangeSetRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(executeCoreNetworkChangeSetRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, executeCoreNetworkChangeSetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ExecuteCoreNetworkChangeSet"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ExecuteCoreNetworkChangeSetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ExecuteCoreNetworkChangeSet").withProtocolMetadata(protocolMetadata) .withMarshaller(new ExecuteCoreNetworkChangeSetRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(executeCoreNetworkChangeSetRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a core network Connect attachment. *

* * @param getConnectAttachmentRequest * @return A Java Future containing the result of the GetConnectAttachment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetConnectAttachment * @see AWS API Documentation */ @Override public CompletableFuture getConnectAttachment( GetConnectAttachmentRequest getConnectAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getConnectAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getConnectAttachmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetConnectAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetConnectAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetConnectAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetConnectAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getConnectAttachmentRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a core network Connect peer. *

* * @param getConnectPeerRequest * @return A Java Future containing the result of the GetConnectPeer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetConnectPeer * @see AWS * API Documentation */ @Override public CompletableFuture getConnectPeer(GetConnectPeerRequest getConnectPeerRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getConnectPeerRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getConnectPeerRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetConnectPeer"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetConnectPeerResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetConnectPeer").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetConnectPeerRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getConnectPeerRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a core network Connect peer associations. *

* * @param getConnectPeerAssociationsRequest * @return A Java Future containing the result of the GetConnectPeerAssociations operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetConnectPeerAssociations * @see AWS API Documentation */ @Override public CompletableFuture getConnectPeerAssociations( GetConnectPeerAssociationsRequest getConnectPeerAssociationsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getConnectPeerAssociationsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getConnectPeerAssociationsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetConnectPeerAssociations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetConnectPeerAssociationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetConnectPeerAssociations").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetConnectPeerAssociationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getConnectPeerAssociationsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about one or more of your connections in a global network. *

* * @param getConnectionsRequest * @return A Java Future containing the result of the GetConnections operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetConnections * @see AWS * API Documentation */ @Override public CompletableFuture getConnections(GetConnectionsRequest getConnectionsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getConnectionsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getConnectionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetConnections"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetConnectionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetConnections").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetConnectionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getConnectionsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about the LIVE policy for a core network. *

* * @param getCoreNetworkRequest * @return A Java Future containing the result of the GetCoreNetwork operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetCoreNetwork * @see AWS * API Documentation */ @Override public CompletableFuture getCoreNetwork(GetCoreNetworkRequest getCoreNetworkRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getCoreNetworkRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getCoreNetworkRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCoreNetwork"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetCoreNetworkResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetCoreNetwork").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetCoreNetworkRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getCoreNetworkRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a core network change event. *

* * @param getCoreNetworkChangeEventsRequest * @return A Java Future containing the result of the GetCoreNetworkChangeEvents operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetCoreNetworkChangeEvents * @see AWS API Documentation */ @Override public CompletableFuture getCoreNetworkChangeEvents( GetCoreNetworkChangeEventsRequest getCoreNetworkChangeEventsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getCoreNetworkChangeEventsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getCoreNetworkChangeEventsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCoreNetworkChangeEvents"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetCoreNetworkChangeEventsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetCoreNetworkChangeEvents").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetCoreNetworkChangeEventsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getCoreNetworkChangeEventsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a change set between the LIVE core network policy and a submitted policy. *

* * @param getCoreNetworkChangeSetRequest * @return A Java Future containing the result of the GetCoreNetworkChangeSet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetCoreNetworkChangeSet * @see AWS API Documentation */ @Override public CompletableFuture getCoreNetworkChangeSet( GetCoreNetworkChangeSetRequest getCoreNetworkChangeSetRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getCoreNetworkChangeSetRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getCoreNetworkChangeSetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCoreNetworkChangeSet"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetCoreNetworkChangeSetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetCoreNetworkChangeSet").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetCoreNetworkChangeSetRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getCoreNetworkChangeSetRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns details about a core network policy. You can get details about your current live policy or any previous * policy version. *

* * @param getCoreNetworkPolicyRequest * @return A Java Future containing the result of the GetCoreNetworkPolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetCoreNetworkPolicy * @see AWS API Documentation */ @Override public CompletableFuture getCoreNetworkPolicy( GetCoreNetworkPolicyRequest getCoreNetworkPolicyRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getCoreNetworkPolicyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getCoreNetworkPolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCoreNetworkPolicy"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetCoreNetworkPolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetCoreNetworkPolicy").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetCoreNetworkPolicyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getCoreNetworkPolicyRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets the association information for customer gateways that are associated with devices and links in your global * network. *

* * @param getCustomerGatewayAssociationsRequest * @return A Java Future containing the result of the GetCustomerGatewayAssociations operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetCustomerGatewayAssociations * @see AWS API Documentation */ @Override public CompletableFuture getCustomerGatewayAssociations( GetCustomerGatewayAssociationsRequest getCustomerGatewayAssociationsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getCustomerGatewayAssociationsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getCustomerGatewayAssociationsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCustomerGatewayAssociations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetCustomerGatewayAssociationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetCustomerGatewayAssociations").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetCustomerGatewayAssociationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getCustomerGatewayAssociationsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about one or more of your devices in a global network. *

* * @param getDevicesRequest * @return A Java Future containing the result of the GetDevices operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetDevices * @see AWS API * Documentation */ @Override public CompletableFuture getDevices(GetDevicesRequest getDevicesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDevicesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getDevicesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDevices"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetDevicesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("GetDevices") .withProtocolMetadata(protocolMetadata) .withMarshaller(new GetDevicesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getDevicesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a specific Amazon Web Services Direct Connect gateway attachment. *

* * @param getDirectConnectGatewayAttachmentRequest * @return A Java Future containing the result of the GetDirectConnectGatewayAttachment operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetDirectConnectGatewayAttachment * @see AWS API Documentation */ @Override public CompletableFuture getDirectConnectGatewayAttachment( GetDirectConnectGatewayAttachmentRequest getDirectConnectGatewayAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDirectConnectGatewayAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getDirectConnectGatewayAttachmentRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDirectConnectGatewayAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, GetDirectConnectGatewayAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetDirectConnectGatewayAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetDirectConnectGatewayAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getDirectConnectGatewayAttachmentRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets the link associations for a device or a link. Either the device ID or the link ID must be specified. *

* * @param getLinkAssociationsRequest * @return A Java Future containing the result of the GetLinkAssociations operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetLinkAssociations * @see AWS API Documentation */ @Override public CompletableFuture getLinkAssociations( GetLinkAssociationsRequest getLinkAssociationsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getLinkAssociationsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getLinkAssociationsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetLinkAssociations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetLinkAssociationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetLinkAssociations").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetLinkAssociationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getLinkAssociationsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about one or more links in a specified global network. *

*

* If you specify the site ID, you cannot specify the type or provider in the same request. You can specify the type * and provider in the same request. *

* * @param getLinksRequest * @return A Java Future containing the result of the GetLinks operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetLinks * @see AWS API * Documentation */ @Override public CompletableFuture getLinks(GetLinksRequest getLinksRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getLinksRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getLinksRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetLinks"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetLinksResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("GetLinks") .withProtocolMetadata(protocolMetadata) .withMarshaller(new GetLinksRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withMetricCollector(apiCallMetricCollector).withInput(getLinksRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets the count of network resources, by resource type, for the specified global network. *

* * @param getNetworkResourceCountsRequest * @return A Java Future containing the result of the GetNetworkResourceCounts operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetNetworkResourceCounts * @see AWS API Documentation */ @Override public CompletableFuture getNetworkResourceCounts( GetNetworkResourceCountsRequest getNetworkResourceCountsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getNetworkResourceCountsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getNetworkResourceCountsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetNetworkResourceCounts"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetNetworkResourceCountsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetNetworkResourceCounts").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetNetworkResourceCountsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getNetworkResourceCountsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets the network resource relationships for the specified global network. *

* * @param getNetworkResourceRelationshipsRequest * @return A Java Future containing the result of the GetNetworkResourceRelationships operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetNetworkResourceRelationships * @see AWS API Documentation */ @Override public CompletableFuture getNetworkResourceRelationships( GetNetworkResourceRelationshipsRequest getNetworkResourceRelationshipsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getNetworkResourceRelationshipsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getNetworkResourceRelationshipsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetNetworkResourceRelationships"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetNetworkResourceRelationshipsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetNetworkResourceRelationships").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetNetworkResourceRelationshipsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getNetworkResourceRelationshipsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the network resources for the specified global network. *

*

* The results include information from the corresponding Describe call for the resource, minus any sensitive * information such as pre-shared keys. *

* * @param getNetworkResourcesRequest * @return A Java Future containing the result of the GetNetworkResources operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetNetworkResources * @see AWS API Documentation */ @Override public CompletableFuture getNetworkResources( GetNetworkResourcesRequest getNetworkResourcesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getNetworkResourcesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getNetworkResourcesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetNetworkResources"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetNetworkResourcesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetNetworkResources").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetNetworkResourcesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getNetworkResourcesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets the network routes of the specified global network. *

* * @param getNetworkRoutesRequest * @return A Java Future containing the result of the GetNetworkRoutes operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetNetworkRoutes * @see AWS API Documentation */ @Override public CompletableFuture getNetworkRoutes(GetNetworkRoutesRequest getNetworkRoutesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getNetworkRoutesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getNetworkRoutesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetNetworkRoutes"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetNetworkRoutesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetNetworkRoutes").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetNetworkRoutesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getNetworkRoutesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets the network telemetry of the specified global network. *

* * @param getNetworkTelemetryRequest * @return A Java Future containing the result of the GetNetworkTelemetry operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetNetworkTelemetry * @see AWS API Documentation */ @Override public CompletableFuture getNetworkTelemetry( GetNetworkTelemetryRequest getNetworkTelemetryRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getNetworkTelemetryRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getNetworkTelemetryRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetNetworkTelemetry"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetNetworkTelemetryResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetNetworkTelemetry").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetNetworkTelemetryRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getNetworkTelemetryRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a resource policy. *

* * @param getResourcePolicyRequest * @return A Java Future containing the result of the GetResourcePolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetResourcePolicy * @see AWS API Documentation */ @Override public CompletableFuture getResourcePolicy(GetResourcePolicyRequest getResourcePolicyRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getResourcePolicyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getResourcePolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetResourcePolicy"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetResourcePolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetResourcePolicy").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetResourcePolicyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getResourcePolicyRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about the specified route analysis. *

* * @param getRouteAnalysisRequest * @return A Java Future containing the result of the GetRouteAnalysis operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetRouteAnalysis * @see AWS API Documentation */ @Override public CompletableFuture getRouteAnalysis(GetRouteAnalysisRequest getRouteAnalysisRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getRouteAnalysisRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getRouteAnalysisRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetRouteAnalysis"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetRouteAnalysisResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetRouteAnalysis").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetRouteAnalysisRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getRouteAnalysisRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a site-to-site VPN attachment. *

* * @param getSiteToSiteVpnAttachmentRequest * @return A Java Future containing the result of the GetSiteToSiteVpnAttachment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetSiteToSiteVpnAttachment * @see AWS API Documentation */ @Override public CompletableFuture getSiteToSiteVpnAttachment( GetSiteToSiteVpnAttachmentRequest getSiteToSiteVpnAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSiteToSiteVpnAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getSiteToSiteVpnAttachmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSiteToSiteVpnAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetSiteToSiteVpnAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSiteToSiteVpnAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetSiteToSiteVpnAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getSiteToSiteVpnAttachmentRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about one or more of your sites in a global network. *

* * @param getSitesRequest * @return A Java Future containing the result of the GetSites operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetSites * @see AWS API * Documentation */ @Override public CompletableFuture getSites(GetSitesRequest getSitesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSitesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getSitesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSites"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetSitesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("GetSites") .withProtocolMetadata(protocolMetadata) .withMarshaller(new GetSitesRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withMetricCollector(apiCallMetricCollector).withInput(getSitesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about one or more of your transit gateway Connect peer associations in a global network. *

* * @param getTransitGatewayConnectPeerAssociationsRequest * @return A Java Future containing the result of the GetTransitGatewayConnectPeerAssociations operation returned by * the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetTransitGatewayConnectPeerAssociations * @see AWS API Documentation */ @Override public CompletableFuture getTransitGatewayConnectPeerAssociations( GetTransitGatewayConnectPeerAssociationsRequest getTransitGatewayConnectPeerAssociationsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration( getTransitGatewayConnectPeerAssociationsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getTransitGatewayConnectPeerAssociationsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetTransitGatewayConnectPeerAssociations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, GetTransitGatewayConnectPeerAssociationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetTransitGatewayConnectPeerAssociations").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetTransitGatewayConnectPeerAssociationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getTransitGatewayConnectPeerAssociationsRequest)); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a transit gateway peer. *

* * @param getTransitGatewayPeeringRequest * @return A Java Future containing the result of the GetTransitGatewayPeering operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetTransitGatewayPeering * @see AWS API Documentation */ @Override public CompletableFuture getTransitGatewayPeering( GetTransitGatewayPeeringRequest getTransitGatewayPeeringRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getTransitGatewayPeeringRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getTransitGatewayPeeringRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetTransitGatewayPeering"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetTransitGatewayPeeringResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetTransitGatewayPeering").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetTransitGatewayPeeringRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getTransitGatewayPeeringRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets information about the transit gateway registrations in a specified global network. *

* * @param getTransitGatewayRegistrationsRequest * @return A Java Future containing the result of the GetTransitGatewayRegistrations operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetTransitGatewayRegistrations * @see AWS API Documentation */ @Override public CompletableFuture getTransitGatewayRegistrations( GetTransitGatewayRegistrationsRequest getTransitGatewayRegistrationsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getTransitGatewayRegistrationsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getTransitGatewayRegistrationsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetTransitGatewayRegistrations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetTransitGatewayRegistrationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetTransitGatewayRegistrations").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetTransitGatewayRegistrationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getTransitGatewayRegistrationsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a transit gateway route table attachment. *

* * @param getTransitGatewayRouteTableAttachmentRequest * @return A Java Future containing the result of the GetTransitGatewayRouteTableAttachment operation returned by * the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetTransitGatewayRouteTableAttachment * @see AWS API Documentation */ @Override public CompletableFuture getTransitGatewayRouteTableAttachment( GetTransitGatewayRouteTableAttachmentRequest getTransitGatewayRouteTableAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getTransitGatewayRouteTableAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getTransitGatewayRouteTableAttachmentRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetTransitGatewayRouteTableAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, GetTransitGatewayRouteTableAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetTransitGatewayRouteTableAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetTransitGatewayRouteTableAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getTransitGatewayRouteTableAttachmentRequest)); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a VPC attachment. *

* * @param getVpcAttachmentRequest * @return A Java Future containing the result of the GetVpcAttachment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.GetVpcAttachment * @see AWS API Documentation */ @Override public CompletableFuture getVpcAttachment(GetVpcAttachmentRequest getVpcAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getVpcAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getVpcAttachmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetVpcAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetVpcAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetVpcAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetVpcAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getVpcAttachmentRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a list of core network attachments. *

* * @param listAttachmentsRequest * @return A Java Future containing the result of the ListAttachments operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.ListAttachments * @see AWS API Documentation */ @Override public CompletableFuture listAttachments(ListAttachmentsRequest listAttachmentsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listAttachmentsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listAttachmentsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAttachments"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListAttachmentsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListAttachments").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListAttachmentsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listAttachmentsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a list of core network Connect peers. *

* * @param listConnectPeersRequest * @return A Java Future containing the result of the ListConnectPeers operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.ListConnectPeers * @see AWS API Documentation */ @Override public CompletableFuture listConnectPeers(ListConnectPeersRequest listConnectPeersRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listConnectPeersRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listConnectPeersRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListConnectPeers"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListConnectPeersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListConnectPeers").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListConnectPeersRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listConnectPeersRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a list of core network policy versions. *

* * @param listCoreNetworkPolicyVersionsRequest * @return A Java Future containing the result of the ListCoreNetworkPolicyVersions operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.ListCoreNetworkPolicyVersions * @see AWS API Documentation */ @Override public CompletableFuture listCoreNetworkPolicyVersions( ListCoreNetworkPolicyVersionsRequest listCoreNetworkPolicyVersionsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCoreNetworkPolicyVersionsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listCoreNetworkPolicyVersionsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCoreNetworkPolicyVersions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListCoreNetworkPolicyVersionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCoreNetworkPolicyVersions").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListCoreNetworkPolicyVersionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listCoreNetworkPolicyVersionsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a list of owned and shared core networks. *

* * @param listCoreNetworksRequest * @return A Java Future containing the result of the ListCoreNetworks operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.ListCoreNetworks * @see AWS API Documentation */ @Override public CompletableFuture listCoreNetworks(ListCoreNetworksRequest listCoreNetworksRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCoreNetworksRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listCoreNetworksRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCoreNetworks"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListCoreNetworksResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCoreNetworks").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListCoreNetworksRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listCoreNetworksRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Gets the status of the Service Linked Role (SLR) deployment for the accounts in a given Amazon Web Services * Organization. *

* * @param listOrganizationServiceAccessStatusRequest * @return A Java Future containing the result of the ListOrganizationServiceAccessStatus operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.ListOrganizationServiceAccessStatus * @see AWS API Documentation */ @Override public CompletableFuture listOrganizationServiceAccessStatus( ListOrganizationServiceAccessStatusRequest listOrganizationServiceAccessStatusRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listOrganizationServiceAccessStatusRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listOrganizationServiceAccessStatusRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListOrganizationServiceAccessStatus"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, ListOrganizationServiceAccessStatusResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListOrganizationServiceAccessStatus").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListOrganizationServiceAccessStatusRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listOrganizationServiceAccessStatusRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the peerings for a core network. *

* * @param listPeeringsRequest * @return A Java Future containing the result of the ListPeerings operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.ListPeerings * @see AWS * API Documentation */ @Override public CompletableFuture listPeerings(ListPeeringsRequest listPeeringsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listPeeringsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listPeeringsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListPeerings"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListPeeringsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListPeerings").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListPeeringsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listPeeringsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the tags for a specified resource. *

* * @param listTagsForResourceRequest * @return A Java Future containing the result of the ListTagsForResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.ListTagsForResource * @see AWS API Documentation */ @Override public CompletableFuture listTagsForResource( ListTagsForResourceRequest listTagsForResourceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTagsForResourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTagsForResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListTagsForResource").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listTagsForResourceRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new, immutable version of a core network policy. A subsequent change set is created showing the * differences between the LIVE policy and the submitted policy. *

* * @param putCoreNetworkPolicyRequest * @return A Java Future containing the result of the PutCoreNetworkPolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • CoreNetworkPolicyException Describes a core network policy exception.
  • *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.PutCoreNetworkPolicy * @see AWS API Documentation */ @Override public CompletableFuture putCoreNetworkPolicy( PutCoreNetworkPolicyRequest putCoreNetworkPolicyRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putCoreNetworkPolicyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, putCoreNetworkPolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutCoreNetworkPolicy"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, PutCoreNetworkPolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("PutCoreNetworkPolicy").withProtocolMetadata(protocolMetadata) .withMarshaller(new PutCoreNetworkPolicyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(putCoreNetworkPolicyRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates or updates a resource policy. *

* * @param putResourcePolicyRequest * @return A Java Future containing the result of the PutResourcePolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • ServiceQuotaExceededException A service limit was exceeded.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.PutResourcePolicy * @see AWS API Documentation */ @Override public CompletableFuture putResourcePolicy(PutResourcePolicyRequest putResourcePolicyRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putResourcePolicyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, putResourcePolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutResourcePolicy"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, PutResourcePolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("PutResourcePolicy").withProtocolMetadata(protocolMetadata) .withMarshaller(new PutResourcePolicyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(putResourcePolicyRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Registers a transit gateway in your global network. Not all Regions support transit gateways for global networks. * For a list of the supported Regions, see Region Availability in the Amazon Web Services Transit Gateways for Global Networks User Guide. The * transit gateway can be in any of the supported Amazon Web Services Regions, but it must be owned by the same * Amazon Web Services account that owns the global network. You cannot register a transit gateway in more than one * global network. *

* * @param registerTransitGatewayRequest * @return A Java Future containing the result of the RegisterTransitGateway operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.RegisterTransitGateway * @see AWS API Documentation */ @Override public CompletableFuture registerTransitGateway( RegisterTransitGatewayRequest registerTransitGatewayRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(registerTransitGatewayRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, registerTransitGatewayRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RegisterTransitGateway"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RegisterTransitGatewayResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RegisterTransitGateway").withProtocolMetadata(protocolMetadata) .withMarshaller(new RegisterTransitGatewayRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(registerTransitGatewayRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Rejects a core network attachment request. *

* * @param rejectAttachmentRequest * @return A Java Future containing the result of the RejectAttachment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.RejectAttachment * @see AWS API Documentation */ @Override public CompletableFuture rejectAttachment(RejectAttachmentRequest rejectAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(rejectAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, rejectAttachmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RejectAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RejectAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RejectAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new RejectAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(rejectAttachmentRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Restores a previous policy version as a new, immutable version of a core network policy. A subsequent change set * is created showing the differences between the LIVE policy and restored policy. *

* * @param restoreCoreNetworkPolicyVersionRequest * @return A Java Future containing the result of the RestoreCoreNetworkPolicyVersion operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.RestoreCoreNetworkPolicyVersion * @see AWS API Documentation */ @Override public CompletableFuture restoreCoreNetworkPolicyVersion( RestoreCoreNetworkPolicyVersionRequest restoreCoreNetworkPolicyVersionRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(restoreCoreNetworkPolicyVersionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, restoreCoreNetworkPolicyVersionRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RestoreCoreNetworkPolicyVersion"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RestoreCoreNetworkPolicyVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RestoreCoreNetworkPolicyVersion").withProtocolMetadata(protocolMetadata) .withMarshaller(new RestoreCoreNetworkPolicyVersionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(restoreCoreNetworkPolicyVersionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Enables the Network Manager service for an Amazon Web Services Organization. This can only be called by a * management account within the organization. *

* * @param startOrganizationServiceAccessUpdateRequest * @return A Java Future containing the result of the StartOrganizationServiceAccessUpdate operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • ServiceQuotaExceededException A service limit was exceeded.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.StartOrganizationServiceAccessUpdate * @see AWS API Documentation */ @Override public CompletableFuture startOrganizationServiceAccessUpdate( StartOrganizationServiceAccessUpdateRequest startOrganizationServiceAccessUpdateRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startOrganizationServiceAccessUpdateRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startOrganizationServiceAccessUpdateRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartOrganizationServiceAccessUpdate"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, StartOrganizationServiceAccessUpdateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StartOrganizationServiceAccessUpdate").withProtocolMetadata(protocolMetadata) .withMarshaller(new StartOrganizationServiceAccessUpdateRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(startOrganizationServiceAccessUpdateRequest)); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Starts analyzing the routing path between the specified source and destination. For more information, see Route Analyzer. *

* * @param startRouteAnalysisRequest * @return A Java Future containing the result of the StartRouteAnalysis operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.StartRouteAnalysis * @see AWS API Documentation */ @Override public CompletableFuture startRouteAnalysis(StartRouteAnalysisRequest startRouteAnalysisRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startRouteAnalysisRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startRouteAnalysisRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartRouteAnalysis"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartRouteAnalysisResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StartRouteAnalysis").withProtocolMetadata(protocolMetadata) .withMarshaller(new StartRouteAnalysisRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(startRouteAnalysisRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Tags a specified resource. *

* * @param tagResourceRequest * @return A Java Future containing the result of the TagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • ServiceQuotaExceededException A service limit was exceeded.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.TagResource * @see AWS * API Documentation */ @Override public CompletableFuture tagResource(TagResourceRequest tagResourceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(tagResourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, TagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("TagResource").withProtocolMetadata(protocolMetadata) .withMarshaller(new TagResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(tagResourceRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Removes tags from a specified resource. *

* * @param untagResourceRequest * @return A Java Future containing the result of the UntagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.UntagResource * @see AWS * API Documentation */ @Override public CompletableFuture untagResource(UntagResourceRequest untagResourceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(untagResourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UntagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UntagResource").withProtocolMetadata(protocolMetadata) .withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(untagResourceRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the information for an existing connection. To remove information for any of the parameters, specify an * empty string. *

* * @param updateConnectionRequest * @return A Java Future containing the result of the UpdateConnection operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.UpdateConnection * @see AWS API Documentation */ @Override public CompletableFuture updateConnection(UpdateConnectionRequest updateConnectionRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateConnectionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateConnectionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateConnection"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateConnectionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateConnection").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateConnectionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateConnectionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the description of a core network. *

* * @param updateCoreNetworkRequest * @return A Java Future containing the result of the UpdateCoreNetwork operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.UpdateCoreNetwork * @see AWS API Documentation */ @Override public CompletableFuture updateCoreNetwork(UpdateCoreNetworkRequest updateCoreNetworkRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateCoreNetworkRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCoreNetworkRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCoreNetwork"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateCoreNetworkResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateCoreNetwork").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateCoreNetworkRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateCoreNetworkRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the details for an existing device. To remove information for any of the parameters, specify an empty * string. *

* * @param updateDeviceRequest * @return A Java Future containing the result of the UpdateDevice operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.UpdateDevice * @see AWS * API Documentation */ @Override public CompletableFuture updateDevice(UpdateDeviceRequest updateDeviceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateDeviceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateDeviceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateDevice"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateDeviceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateDevice").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateDeviceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateDeviceRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the edge locations associated with an Amazon Web Services Direct Connect gateway attachment. *

* * @param updateDirectConnectGatewayAttachmentRequest * @return A Java Future containing the result of the UpdateDirectConnectGatewayAttachment operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.UpdateDirectConnectGatewayAttachment * @see AWS API Documentation */ @Override public CompletableFuture updateDirectConnectGatewayAttachment( UpdateDirectConnectGatewayAttachmentRequest updateDirectConnectGatewayAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateDirectConnectGatewayAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateDirectConnectGatewayAttachmentRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateDirectConnectGatewayAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, UpdateDirectConnectGatewayAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateDirectConnectGatewayAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateDirectConnectGatewayAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateDirectConnectGatewayAttachmentRequest)); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates an existing global network. To remove information for any of the parameters, specify an empty string. *

* * @param updateGlobalNetworkRequest * @return A Java Future containing the result of the UpdateGlobalNetwork operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.UpdateGlobalNetwork * @see AWS API Documentation */ @Override public CompletableFuture updateGlobalNetwork( UpdateGlobalNetworkRequest updateGlobalNetworkRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateGlobalNetworkRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateGlobalNetworkRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateGlobalNetwork"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateGlobalNetworkResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateGlobalNetwork").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateGlobalNetworkRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateGlobalNetworkRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the details for an existing link. To remove information for any of the parameters, specify an empty * string. *

* * @param updateLinkRequest * @return A Java Future containing the result of the UpdateLink operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • ServiceQuotaExceededException A service limit was exceeded.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.UpdateLink * @see AWS API * Documentation */ @Override public CompletableFuture updateLink(UpdateLinkRequest updateLinkRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateLinkRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateLinkRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateLink"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateLinkResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("UpdateLink") .withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateLinkRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateLinkRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the resource metadata for the specified global network. *

* * @param updateNetworkResourceMetadataRequest * @return A Java Future containing the result of the UpdateNetworkResourceMetadata operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.UpdateNetworkResourceMetadata * @see AWS API Documentation */ @Override public CompletableFuture updateNetworkResourceMetadata( UpdateNetworkResourceMetadataRequest updateNetworkResourceMetadataRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateNetworkResourceMetadataRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateNetworkResourceMetadataRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateNetworkResourceMetadata"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateNetworkResourceMetadataResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateNetworkResourceMetadata").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateNetworkResourceMetadataRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateNetworkResourceMetadataRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the information for an existing site. To remove information for any of the parameters, specify an empty * string. *

* * @param updateSiteRequest * @return A Java Future containing the result of the UpdateSite operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.UpdateSite * @see AWS API * Documentation */ @Override public CompletableFuture updateSite(UpdateSiteRequest updateSiteRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateSiteRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSiteRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSite"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateSiteResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("UpdateSite") .withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateSiteRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateSiteRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates a VPC attachment. *

* * @param updateVpcAttachmentRequest * @return A Java Future containing the result of the UpdateVpcAttachment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationException The input fails to satisfy the constraints.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ResourceNotFoundException The specified resource could not be found.
  • *
  • ConflictException There was a conflict processing the request. Updating or deleting the resource can * cause an inconsistent state.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException The request has failed due to an internal error.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • NetworkManagerException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample NetworkManagerAsyncClient.UpdateVpcAttachment * @see AWS API Documentation */ @Override public CompletableFuture updateVpcAttachment( UpdateVpcAttachmentRequest updateVpcAttachmentRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateVpcAttachmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateVpcAttachmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "NetworkManager"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateVpcAttachment"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateVpcAttachmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateVpcAttachment").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateVpcAttachmentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateVpcAttachmentRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } @Override public final NetworkManagerServiceClientConfiguration serviceClientConfiguration() { return new NetworkManagerServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build(); } @Override public final String serviceName() { return SERVICE_NAME; } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(NetworkManagerException::builder) .protocol(AwsJsonProtocol.REST_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceQuotaExceededException") .exceptionBuilderSupplier(ServiceQuotaExceededException::builder).httpStatusCode(402).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalServerException") .exceptionBuilderSupplier(InternalServerException::builder).httpStatusCode(500).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFoundException") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(404).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ValidationException") .exceptionBuilderSupplier(ValidationException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ThrottlingException") .exceptionBuilderSupplier(ThrottlingException::builder).httpStatusCode(429).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AccessDeniedException") .exceptionBuilderSupplier(AccessDeniedException::builder).httpStatusCode(403).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ConflictException") .exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("CoreNetworkPolicyException") .exceptionBuilderSupplier(CoreNetworkPolicyException::builder).httpStatusCode(400).build()); } 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 void updateRetryStrategyClientConfiguration(SdkClientConfiguration.Builder configuration) { ClientOverrideConfiguration.Builder builder = configuration.asOverrideConfigurationBuilder(); RetryMode retryMode = builder.retryMode(); if (retryMode != null) { configuration.option(SdkClientOption.RETRY_STRATEGY, AwsRetryStrategy.forRetryMode(retryMode)); } else { Consumer> configurator = builder.retryStrategyConfigurator(); if (configurator != null) { RetryStrategy.Builder defaultBuilder = AwsRetryStrategy.defaultRetryStrategy().toBuilder(); configurator.accept(defaultBuilder); configuration.option(SdkClientOption.RETRY_STRATEGY, defaultBuilder.build()); } else { RetryStrategy retryStrategy = builder.retryStrategy(); if (retryStrategy != null) { configuration.option(SdkClientOption.RETRY_STRATEGY, retryStrategy); } } } configuration.option(SdkClientOption.CONFIGURED_RETRY_MODE, null); configuration.option(SdkClientOption.CONFIGURED_RETRY_STRATEGY, null); configuration.option(SdkClientOption.CONFIGURED_RETRY_CONFIGURATOR, null); } private SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request, SdkClientConfiguration clientConfiguration) { List plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList()); SdkClientConfiguration.Builder configuration = clientConfiguration.toBuilder(); if (plugins.isEmpty()) { return configuration.build(); } NetworkManagerServiceClientConfigurationBuilder serviceConfigBuilder = new NetworkManagerServiceClientConfigurationBuilder( configuration); for (SdkPlugin plugin : plugins) { plugin.configureClient(serviceConfigBuilder); } updateRetryStrategyClientConfiguration(configuration); return configuration.build(); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata, Function> exceptionMetadataMapper) { return protocolFactory.createErrorResponseHandler(operationMetadata, exceptionMetadataMapper); } @Override public void close() { clientHandler.close(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy