1 /* 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with 5 * the License. A copy of the License is located at 6 * 7 * http://aws.amazon.com/apache2.0 8 * 9 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 10 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions 11 * and limitations under the License. 12 */ 13 14 package software.amazon.awssdk.services.kms; 15 16 import software.amazon.awssdk.annotations.Generated; 17 import software.amazon.awssdk.annotations.SdkInternalApi; 18 import software.amazon.awssdk.core.client.config.SdkClientConfiguration; 19 import software.amazon.awssdk.core.client.config.SdkClientOption; 20 import software.amazon.awssdk.services.kms.endpoints.KmsEndpointProvider; 21 22 /** 23 * Internal implementation of {@link KmsClientBuilder}. 24 */ 25 @Generated("software.amazon.awssdk:codegen") 26 @SdkInternalApi 27 final class DefaultKmsClientBuilder extends DefaultKmsBaseClientBuilder<KmsClientBuilder, KmsClient> implements KmsClientBuilder { 28 @Override endpointProvider(KmsEndpointProvider endpointProvider)29 public DefaultKmsClientBuilder endpointProvider(KmsEndpointProvider endpointProvider) { 30 clientConfiguration.option(SdkClientOption.ENDPOINT_PROVIDER, endpointProvider); 31 return this; 32 } 33 34 @Override buildClient()35 protected final KmsClient buildClient() { 36 SdkClientConfiguration clientConfiguration = super.syncClientConfiguration(); 37 this.validateClientOptions(clientConfiguration); 38 KmsClient client = new DefaultKmsClient(clientConfiguration); 39 return client; 40 } 41 } 42