1321 1321 |
|
1322 1322 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
|
1323 1323 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
1324 1324 | Some(self.config.clone())
|
1325 1325 | }
|
1326 1326 |
|
1327 1327 | fn runtime_components(
|
1328 1328 | &self,
|
1329 1329 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
1330 1330 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
1331 1331 | ::std::borrow::Cow::Borrowed(&self.components)
|
1332 1332 | }
|
1333 1333 | }
|
1334 1334 |
|
1335 1335 | pub use ::aws_smithy_runtime::client::identity::IdentityCache;
|
1336 1336 | pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
|
1337 1337 | pub use ::aws_smithy_types::config_bag::ConfigBag;
|
1338 1338 |
|
1339 1339 | impl From<&::aws_types::sdk_config::SdkConfig> for Builder {
|
1340 1340 | fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1341 1341 | let mut builder = Builder::default();
|
1342 1342 | builder = builder.region(input.region().cloned());
|
1343 1343 | builder.set_use_fips(input.use_fips());
|
1344 1344 | if input.get_origin("endpoint_url").is_client_config() {
|
1345 1345 | builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string()));
|
1346 1346 | } else {
|
1347 1347 | builder.set_endpoint_url(
|
1348 1348 | input
|
1349 1349 | .service_config()
|
1350 1350 | .and_then(|conf| {
|
1351 - | conf.load_config(service_config_key("AWS_ENDPOINT_URL", "endpoint_url"))
|
1351 + | conf.load_config(service_config_key("CodeCatalyst", "AWS_ENDPOINT_URL", "endpoint_url"))
|
1352 1352 | .map(|it| it.parse().unwrap())
|
1353 1353 | })
|
1354 1354 | .or_else(|| input.endpoint_url().map(|s| s.to_string())),
|
1355 1355 | );
|
1356 1356 | }
|
1357 1357 | // resiliency
|
1358 1358 | builder.set_retry_config(input.retry_config().cloned());
|
1359 1359 | builder.set_timeout_config(input.timeout_config().cloned());
|
1360 1360 | builder.set_sleep_impl(input.sleep_impl());
|
1361 1361 |
|
1362 1362 | builder.set_http_client(input.http_client());
|
1363 1363 | builder.set_time_source(input.time_source());
|
1364 1364 | builder.set_behavior_version(input.behavior_version());
|
1365 1365 | builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
|
1366 1366 | // setting `None` here removes the default
|
1367 1367 | if let Some(config) = input.stalled_stream_protection() {
|
1368 1368 | builder.set_stalled_stream_protection(Some(config));
|
1369 1369 | }
|
1370 1370 |
|
1371 1371 | if let Some(cache) = input.identity_cache() {
|
1372 1372 | builder.set_identity_cache(cache);
|
1373 1373 | }
|
1374 1374 | builder.set_token_provider(input.token_provider());
|
1375 1375 | builder.set_app_name(input.app_name().cloned());
|
1376 1376 |
|
1377 1377 | builder
|
1378 1378 | }
|
1379 1379 | }
|
1380 1380 |
|
1381 1381 | impl From<&::aws_types::sdk_config::SdkConfig> for Config {
|
1382 1382 | fn from(sdk_config: &::aws_types::sdk_config::SdkConfig) -> Self {
|
1383 1383 | Builder::from(sdk_config).build()
|
1384 1384 | }
|
1385 1385 | }
|
1386 1386 |
|
1387 1387 | pub use ::aws_types::app_name::AppName;
|
1388 1388 |
|
1389 1389 | #[allow(dead_code)]
|
1390 - | fn service_config_key<'a>(env: &'a str, profile: &'a str) -> aws_types::service_config::ServiceConfigKey<'a> {
|
1390 + | fn service_config_key<'a>(service_id: &'a str, env: &'a str, profile: &'a str) -> aws_types::service_config::ServiceConfigKey<'a> {
|
1391 1391 | ::aws_types::service_config::ServiceConfigKey::builder()
|
1392 - | .service_id("CodeCatalyst")
|
1392 + | .service_id(service_id)
|
1393 1393 | .env(env)
|
1394 1394 | .profile(profile)
|
1395 1395 | .build()
|
1396 1396 | .expect("all field sets explicitly, can't fail")
|
1397 1397 | }
|
1398 1398 |
|
1399 1399 | pub use ::aws_smithy_async::rt::sleep::Sleep;
|
1400 1400 |
|
1401 1401 | pub(crate) fn base_client_runtime_plugins(mut config: crate::Config) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
|
1402 1402 | let mut configured_plugins = ::std::vec::Vec::new();
|
1403 1403 | ::std::mem::swap(&mut config.runtime_plugins, &mut configured_plugins);
|
1404 1404 | #[cfg(feature = "behavior-version-latest")]
|
1405 1405 | {
|
1406 1406 | if config.behavior_version.is_none() {
|
1407 1407 | config.behavior_version = Some(::aws_smithy_runtime_api::client::behavior_version::BehaviorVersion::latest());
|
1408 1408 | }
|
1409 1409 | }
|
1410 1410 |
|
1411 1411 | let default_retry_partition = "codecatalyst";
|
1412 1412 | let default_retry_partition = match config.region() {
|
1413 1413 | Some(region) => ::std::borrow::Cow::from(format!("{default_retry_partition}-{}", region)),
|
1414 1414 | None => ::std::borrow::Cow::from(default_retry_partition),
|
1415 1415 | };
|
1416 1416 |
|
1417 1417 | let scope = "aws-sdk-codecatalyst";
|
1418 1418 |
|
1419 1419 | let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
|
1420 1420 | // defaults
|
1421 1421 | .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
|
1422 1422 | ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
|