@@ -160,6 +160,7 @@ impl Builder {
160
160
builder. set_timeout_config ( config_bag. load :: < :: aws_smithy_types:: timeout:: TimeoutConfig > ( ) . cloned ( ) ) ;
161
161
builder. set_retry_partition ( config_bag. load :: < :: aws_smithy_runtime:: client:: retries:: RetryPartition > ( ) . cloned ( ) ) ;
162
162
builder. set_app_name ( config_bag. load :: < :: aws_types:: app_name:: AppName > ( ) . cloned ( ) ) ;
163
+ builder. set_endpoint_url ( config_bag. load :: < :: aws_types:: endpoint_config:: EndpointUrl > ( ) . map ( |ty| ty. 0 . clone ( ) ) ) ;
163
164
builder. set_use_dual_stack ( config_bag. load :: < :: aws_types:: endpoint_config:: UseDualStack > ( ) . map ( |ty| ty. 0 ) ) ;
164
165
builder. set_use_fips ( config_bag. load :: < :: aws_types:: endpoint_config:: UseFips > ( ) . map ( |ty| ty. 0 ) ) ;
165
166
builder. set_region ( config_bag. load :: < crate :: config:: Region > ( ) . cloned ( ) ) ;
@@ -887,6 +888,24 @@ impl Builder {
887
888
self . config . store_or_unset ( gen) ;
888
889
self
889
890
}
891
+ /// Sets the endpoint URL used to communicate with this service
892
+
893
+ /// Note: this is used in combination with other endpoint rules, e.g. an API that applies a host-label prefix
894
+ /// will be prefixed onto this URL. To fully override the endpoint resolver, use
895
+ /// [`Builder::endpoint_resolver`].
896
+ pub fn endpoint_url ( mut self , endpoint_url : impl Into < :: std:: string:: String > ) -> Self {
897
+ self . set_endpoint_url ( Some ( endpoint_url. into ( ) ) ) ;
898
+ self
899
+ }
900
+ /// Sets the endpoint URL used to communicate with this service
901
+
902
+ /// Note: this is used in combination with other endpoint rules, e.g. an API that applies a host-label prefix
903
+ /// will be prefixed onto this URL. To fully override the endpoint resolver, use
904
+ /// [`Builder::endpoint_resolver`].
905
+ pub fn set_endpoint_url ( & mut self , endpoint_url : Option < :: std:: string:: String > ) -> & mut Self {
906
+ self . config . store_or_unset ( endpoint_url. map ( :: aws_types:: endpoint_config:: EndpointUrl ) ) ;
907
+ self
908
+ }
890
909
/// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
891
910
pub fn use_dual_stack ( mut self , use_dual_stack : impl Into < bool > ) -> Self {
892
911
self . set_use_dual_stack ( Some ( use_dual_stack. into ( ) ) ) ;
@@ -1190,6 +1209,19 @@ impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
1190
1209
builder = builder. region ( input. region ( ) . cloned ( ) ) ;
1191
1210
builder. set_use_fips ( input. use_fips ( ) ) ;
1192
1211
builder. set_use_dual_stack ( input. use_dual_stack ( ) ) ;
1212
+ if input. get_origin ( "endpoint_url" ) . is_client_config ( ) {
1213
+ builder. set_endpoint_url ( input. endpoint_url ( ) . map ( |s| s. to_string ( ) ) ) ;
1214
+ } else {
1215
+ builder. set_endpoint_url (
1216
+ input
1217
+ . service_config ( )
1218
+ . and_then ( |conf| {
1219
+ conf. load_config ( service_config_key ( "AWS_ENDPOINT_URL" , "endpoint_url" ) )
1220
+ . map ( |it| it. parse ( ) . unwrap ( ) )
1221
+ } )
1222
+ . or_else ( || input. endpoint_url ( ) . map ( |s| s. to_string ( ) ) ) ,
1223
+ ) ;
1224
+ }
1193
1225
// resiliency
1194
1226
builder. set_retry_config ( input. retry_config ( ) . cloned ( ) ) ;
1195
1227
builder. set_timeout_config ( input. timeout_config ( ) . cloned ( ) ) ;
0 commit comments