@@ -0,0 +1,2421 @@
+//snippet-sourcedescription:%5BDeleteBot.java demonstrates how to delete an Amazon Lex conversational bot.%5D%0A//snippet-keyword:%5BAWS SDK for Java v2%5D%0A//snippet-keyword:%5BCode Sample%5D%0A//snippet-service:%5BAmazon Lex%5D%0A//snippet-sourcetype:%5Bfull-example%5D%0A// snippet-sourcedate:%5B09/27/2021%5D%0A//snippet-sourceauthor:%5Bscmacdon - aws%5D%0A%0A/*%0A   Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.%0A   SPDX-License-Identifier: Apache-2.0%0A*/%0A%0Apackage com.example.lex;%0A%0A// snippet-start:%5Blex.java2.delete_bot.import%5D%0Aimport software.amazon.awssdk.regions.Region;%0Aimport software.amazon.awssdk.services.lexmodelbuilding.LexModelBuildingClient;%0Aimport software.amazon.awssdk.services.lexmodelbuilding.model.DeleteBotRequest;%0Aimport software.amazon.awssdk.services.lexmodelbuilding.model.LexModelBuildingException;%0A// snippet-end:%5Blex.java2.delete_bot.import%5D%0A%0A/**%0A * To run this Java V2 code example, ensure that you have setup your development environment, including your credentials.%0A *%0A * For information, see this documentation topic:%0A *%0A * https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/get-started.html%0A */%0Apublic class DeleteBot %7B%0A    public static void main(String%5B%5D args) %7B%0A%0A        final String USAGE = %22%5Cn%22 +%0A                %22Usage: %22 +%0A                %22   %3CbotName%3E%5Cn%5Cn%22 +%0A                %22Where:%5Cn%22 +%0A                %22   botName - the name of an existing bot to delete (for example, BookHotel).%5Cn%5Cn%22 ;%0A%0A        if (args.length != 1) %7B%0A            System.out.println(USAGE);%0A            System.exit(1);%0A        %7D%0A%0A        String botName = args%5B0%5D;%0A        Region region = Region.US_WEST_2;%0A        LexModelBuildingClient lexClient = LexModelBuildingClient.builder()%0A                .region(region)%0A                .build();%0A%0A        deleteSpecificBot(lexClient, botName);%0A        lexClient.close();%0A    %7D%0A%0A    // snippet-start:%5Blex.java2.delete_bot.main%5D%0A    public static void deleteSpecificBot( LexModelBuildingClient lexClient, String botName) %7B%0A%0A        try %7B%0A            DeleteBotRequest botRequest = DeleteBotRequest.builder()%0A                    .name(botName)%0A                    .build();%0A%0A            lexClient.deleteBot(botRequest);%0A            System.out.println(botName +%22 was deleted!%22);%0A%0A        %7D catch (LexModelBuildingException e) %7B%0A            System.out.println(e.getLocalizedMessage());%0A            System.exit(1);%0A        %7D%0A    %7D%0A    // snippet-end:%5Blex.java2.delete_bot.main%5D%0A%7D%0A

Create DeleteBot.java