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.identity.spi; 17 18 import software.amazon.awssdk.annotations.Immutable; 19 import software.amazon.awssdk.annotations.SdkPublicApi; 20 import software.amazon.awssdk.annotations.ThreadSafe; 21 import software.amazon.awssdk.identity.spi.internal.DefaultResolveIdentityRequest; 22 import software.amazon.awssdk.utils.builder.CopyableBuilder; 23 import software.amazon.awssdk.utils.builder.ToCopyableBuilder; 24 25 /** 26 * A request to resolve an {@link Identity}. 27 * <p> 28 * The Identity may be determined for each request based on properties of the request (e.g. different credentials per bucket 29 * for S3). 30 * 31 * @see IdentityProvider 32 */ 33 @SdkPublicApi 34 @Immutable 35 @ThreadSafe 36 public interface ResolveIdentityRequest extends ToCopyableBuilder<ResolveIdentityRequest.Builder, ResolveIdentityRequest> { 37 38 /** 39 * Get a new builder for creating a {@link ResolveIdentityRequest}. 40 */ builder()41 static Builder builder() { 42 return DefaultResolveIdentityRequest.builder(); 43 } 44 45 /** 46 * Returns the value of a property that the {@link IdentityProvider} can use while resolving the identity. 47 */ property(IdentityProperty<T> property)48 <T> T property(IdentityProperty<T> property); 49 50 /** 51 * A builder for a {@link ResolveIdentityRequest}. 52 */ 53 interface Builder extends CopyableBuilder<Builder, ResolveIdentityRequest> { 54 55 /** 56 * Set a property that the {@link IdentityProvider} can use while resolving the identity. 57 */ putProperty(IdentityProperty<T> key, T value)58 <T> Builder putProperty(IdentityProperty<T> key, T value); 59 } 60 } 61