1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  *  http://aws.amazon.com/apache2.0
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 package software.amazon.awssdk.http.auth.spi.signer;
17 
18 import java.nio.ByteBuffer;
19 import org.reactivestreams.Publisher;
20 import software.amazon.awssdk.annotations.Immutable;
21 import software.amazon.awssdk.annotations.SdkPublicApi;
22 import software.amazon.awssdk.annotations.ThreadSafe;
23 import software.amazon.awssdk.http.auth.spi.internal.signer.DefaultAsyncSignRequest;
24 import software.amazon.awssdk.identity.spi.Identity;
25 import software.amazon.awssdk.utils.builder.CopyableBuilder;
26 import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
27 
28 /**
29  * Input parameters to sign a request with async payload, using {@link HttpSigner}.
30  *
31  * @param <IdentityT> The type of the identity.
32  */
33 @SdkPublicApi
34 @Immutable
35 @ThreadSafe
36 public interface AsyncSignRequest<IdentityT extends Identity>
37     extends BaseSignRequest<Publisher<ByteBuffer>, IdentityT>,
38             ToCopyableBuilder<AsyncSignRequest.Builder<IdentityT>, AsyncSignRequest<IdentityT>> {
39 
40     /**
41      * Get a new builder for creating a {@link AsyncSignRequest}.
42      */
builder(IdentityT identity)43     static <IdentityT extends Identity> Builder<IdentityT> builder(IdentityT identity) {
44         return DefaultAsyncSignRequest.builder(identity);
45     }
46 
47     /**
48      * A builder for a {@link AsyncSignRequest}.
49      */
50     interface Builder<IdentityT extends Identity>
51         extends BaseSignRequest.Builder<Builder<IdentityT>, Publisher<ByteBuffer>, IdentityT>,
52             CopyableBuilder<Builder<IdentityT>, AsyncSignRequest<IdentityT>> {
53     }
54 }
55