@@ -0,0 +1,3111 @@
+//snippet-sourcedescription:%5BDeleteEndpoint.java demonstrates how to delete an endpoint.%5D%0A//snippet-keyword:%5BJava%5D%0A//snippet-sourcesyntax:%5Bjava%5D%0A//snippet-keyword:%5BCode Sample%5D%0A//snippet-keyword:%5BAmazon Pinpoint%5D%0A//snippet-service:%5Bpinpoint%5D%0A//snippet-sourcetype:%5Bfull-example%5D%0A//snippet-sourcedate:%5B03/02/2020%5D%0A//snippet-sourceauthor:%5Bscmacdon-aws%5D%0A/*%0A * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22).%0A * You may not use this file except in compliance with the License.%0A * A copy of the License is located at%0A *%0A *  http://aws.amazon.com/apache2.0%0A *%0A * or in the %22license%22 file accompanying this file. This file is distributed%0A * on an %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either%0A * express or implied. See the License for the specific language governing%0A * permissions and limitations under the License.%0A */%0A%0Apackage com.example.pinpoint;%0A%0A//snippet-start:%5Bpinpoint.java2.deleteendpoint.import%5D%0Aimport software.amazon.awssdk.regions.Region;%0Aimport software.amazon.awssdk.services.pinpoint.PinpointClient;%0Aimport software.amazon.awssdk.services.pinpoint.model.DeleteEndpointRequest;%0Aimport software.amazon.awssdk.services.pinpoint.model.DeleteEndpointResponse;%0Aimport software.amazon.awssdk.services.pinpoint.model.PinpointException;%0A//snippet-end:%5Bpinpoint.java2.deleteendpoint.import%5D%0A%0Apublic class DeleteEndpoint %7B%0A    public static void main(String%5B%5D args) %7B%0A        final String USAGE = %22%5Cn%22 +%0A                %22DeleteEndpoint - delete an application in pinpoint dashboard%5Cn%5Cn%22 +%0A                %22Usage: DeleteEndpoint %3CappName%3E %3CendpointId %3E%5Cn%5Cn%22 +%0A                %22Where:%5Cn%22 +%0A                %22  appId - the id of the application to delete.%5Cn%5Cn%22 +%0A                %22  endpointId - the id of the endpoint to delete.%5Cn%22;%0A%0A        if (args.length %3C 1) %7B%0A            System.out.println(USAGE);%0A            System.exit(1);%0A        %7D%0A%0A        String appId = args%5B0%5D;%0A        String endpointId = args%5B1%5D;%0A%0A        System.out.println(%22Deleting an endpoint with id: %22 + endpointId);%0A%0A        PinpointClient pinpoint = PinpointClient.builder()%0A                .region(Region.US_EAST_1)%0A                .build();%0A%0A        deletePinEncpoint(pinpoint, appId, endpointId );%0A    %7D%0A%0A    //snippet-start:%5Bpinpoint.java2.deleteendpoint.main%5D%0A    public static void deletePinEncpoint(PinpointClient pinpoint, String appId, String endpointId ) %7B%0A%0A        try %7B%0A%0A            DeleteEndpointRequest appRequest = DeleteEndpointRequest.builder()%0A                    .applicationId(appId)%0A                    .endpointId(endpointId)%0A                    .build();%0A%0A            DeleteEndpointResponse result = pinpoint.deleteEndpoint(appRequest);%0A            String id = result.endpointResponse().id();%0A            System.out.println(%22The deleted endpoint id  %22 + id);%0A        %7D catch (PinpointException e) %7B%0A            System.err.println(e.awsErrorDetails().errorMessage());%0A            System.exit(1);%0A        %7D%0A        System.out.println(%22Done%22);%0A        //snippet-end:%5Bpinpoint.java2.deleteendpoint.main%5D%0A    %7D%0A%7D%0A

Create DeleteEndpoint.java