//snippet-sourcedescription:[DescribeLimits.java demonstrates how to  display the shard limit and usage for a given account .]
//snippet-keyword:[Java]
//snippet-sourcesyntax:[java]
//snippet-keyword:[SDK for Java 2.0]
//snippet-keyword:[Code Sample]
//snippet-keyword:[Amazon Kinesis]
//snippet-service:[kinesis]
//snippet-sourcetype:[full-example]
//snippet-sourcedate:[2019-06-28]
//snippet-sourceauthor:[jschwarzwalder AWS]
/*
 * Copyright 2010-2019 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.
 */
//snippet-start:[kinesis.java2.DescribeLimits.complete]

package com.example.kinesis;
//snippet-start:[kinesis.java2.DescribeLimits.import]

import software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient;
import software.amazon.awssdk.services.kinesis.KinesisAsyncClient;
import software.amazon.awssdk.services.kinesis.model.DescribeLimitsRequest;
import software.amazon.awssdk.services.kinesis.model.DescribeLimitsResponse;

import java.util.concurrent.ExecutionException;
//snippet-end:[kinesis.java2.DescribeLimits.import]

public class DescribeLimits {

    public static void main(String[] args) {
        // snippet-start:[kinesis.java2.DescribeLimits.client]
        KinesisAsyncClient client = KinesisAsyncClient.builder()
                .httpClientBuilder(NettyNioAsyncHttpClient.builder()
                        .maxConcurrency(100)
                        .maxPendingConnectionAcquires(10_000))
                .build();

        // snippet-end:[kinesis.java2.DescribeLimits.client]


        // snippet-start:[kinesis.java2.DescribeLimits.main]
        DescribeLimitsRequest request = DescribeLimitsRequest.builder()
                .build();


        DescribeLimitsResponse response = client.describeLimits(request).join();

        System.out.println("Number of open shards: " + response.openShardCount());
        System.out.println("Maximum shards allowed: " + response.shardLimit());

        // snippet-end:[kinesis.java2.DescribeLimits.main]
    }

}
//snippet-end:[kinesis.java2.DescribeLimits.complete]
@@ -116,18 +116,16 @@
  account
- .
 %5D%0A//snip
@@ -366,19 +366,17 @@
 ate:
-%5B2019-06-28
+3/26/2020
 %5D%0A//
@@ -401,22 +401,16 @@
 or:%5B
-j
 sc
-hwarzwalder
+macdon
  AWS
@@ -431,18 +431,8 @@
 ght 
-2010-2019 
 Amaz
@@ -989,64 +989,8 @@
 %0A */
-%0A//snippet-start:%5Bkinesis.java2.DescribeLimits.complete%5D
 %0A%0Apa
@@ -1070,17 +1070,16 @@
 import%5D%0A
-%0A
 import s
@@ -1104,46 +1104,22 @@
 sdk.
-http.nio.netty.NettyNioAsyncHttpClient
+regions.Region
 ;%0Aim
@@ -1166,29 +1166,24 @@
 esis.Kinesis
-Async
 Client;%0Aimpo
@@ -1335,46 +1335,68 @@
 se;%0A
-%0A
 import 
-java.util.concurrent.Execution
+software.amazon.awssdk.services.kinesis.model.Kinesis
 Exce
@@ -1594,16 +1594,58 @@
 client%5D%0A
+        Region region = Region.US_EAST_1;%0A
         
@@ -1655,21 +1655,23 @@
 esis
-Async
 Client 
-c
+kinesisC
 lien
@@ -1681,21 +1681,16 @@
  Kinesis
-Async
 Client.b
@@ -1719,193 +1719,170 @@
    .
-httpClientBuilder(NettyNioAsyncHttpClient.builder()%0A                        .maxConcurrency(100)
+region(region)%0A                .build();%0A%0A        describeKinLimits(kinesisClient);
 %0A    
+%7D%0A%0A
     
-                .maxPendingConnectionAcquires(10_000))%0A                .build();
+public static void describeKinLimits(KinesisClient kinesisClient) %7B
 %0A%0A  
@@ -1940,17 +1940,29 @@
 client%5D%0A
-%0A
+        try %7B
 %0A       
@@ -2095,32 +2095,33 @@
                 
+ 
 .build();%0A%0A%0A    
@@ -2115,17 +2115,16 @@
 ild();%0A%0A
-%0A
         
@@ -2157,17 +2157,24 @@
 ponse = 
-c
+kinesisC
 lient.de
@@ -2198,15 +2198,8 @@
 est)
-.join()
 ;%0A%0A 
@@ -2360,16 +2360,176 @@
 mit());%0A
+        %7D catch (KinesisException e) %7B%0A            System.err.println(e.getMessage());%0A            System.exit(1);%0A        %7D%0A        System.out.println(%22Done%22);
 %0A       
@@ -2590,60 +2590,6 @@
   %7D%0A
-%0A
 %7D%0A
-//snippet-end:%5Bkinesis.java2.DescribeLimits.complete%5D

Update DescribeLimits.java