From 90a9b7493001456285932e18ce3679265bcdc601 Mon Sep 17 00:00:00 2001 From: AllanFly120 Date: Mon, 14 Dec 2020 00:43:20 +0000 Subject: [PATCH] feat(client-*): update user-agent population and injecting --- .../AccessAnalyzerClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-accessanalyzer/runtimeConfig.ts | 5 +++- clients/client-acm-pca/ACMPCAClient.ts | 27 +++++++++-------- .../client-acm-pca/runtimeConfig.browser.ts | 5 +++- .../client-acm-pca/runtimeConfig.native.ts | 3 -- clients/client-acm-pca/runtimeConfig.ts | 5 +++- clients/client-acm/ACMClient.ts | 27 +++++++++-------- clients/client-acm/runtimeConfig.browser.ts | 5 +++- clients/client-acm/runtimeConfig.native.ts | 3 -- clients/client-acm/runtimeConfig.ts | 5 +++- .../AlexaForBusinessClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- clients/client-amplify/AmplifyClient.ts | 27 +++++++++-------- .../client-amplify/runtimeConfig.browser.ts | 5 +++- .../client-amplify/runtimeConfig.native.ts | 3 -- clients/client-amplify/runtimeConfig.ts | 5 +++- .../AmplifyBackendClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-amplifybackend/runtimeConfig.ts | 5 +++- .../client-api-gateway/APIGatewayClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-api-gateway/runtimeConfig.ts | 5 +++- .../ApiGatewayManagementApiClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../client-apigatewayv2/ApiGatewayV2Client.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-apigatewayv2/runtimeConfig.ts | 5 +++- clients/client-app-mesh/AppMeshClient.ts | 27 +++++++++-------- .../client-app-mesh/runtimeConfig.browser.ts | 5 +++- .../client-app-mesh/runtimeConfig.native.ts | 3 -- clients/client-app-mesh/runtimeConfig.ts | 5 +++- clients/client-appconfig/AppConfigClient.ts | 27 +++++++++-------- .../client-appconfig/runtimeConfig.browser.ts | 5 +++- .../client-appconfig/runtimeConfig.native.ts | 3 -- clients/client-appconfig/runtimeConfig.ts | 5 +++- clients/client-appflow/AppflowClient.ts | 27 +++++++++-------- .../client-appflow/runtimeConfig.browser.ts | 5 +++- .../client-appflow/runtimeConfig.native.ts | 3 -- clients/client-appflow/runtimeConfig.ts | 5 +++- .../AppIntegrationsClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-appintegrations/runtimeConfig.ts | 5 +++- .../ApplicationAutoScalingClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../ApplicationDiscoveryServiceClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../ApplicationInsightsClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- clients/client-appstream/AppStreamClient.ts | 27 +++++++++-------- .../client-appstream/runtimeConfig.browser.ts | 5 +++- .../client-appstream/runtimeConfig.native.ts | 3 -- clients/client-appstream/runtimeConfig.ts | 5 +++- clients/client-appsync/AppSyncClient.ts | 27 +++++++++-------- .../client-appsync/runtimeConfig.browser.ts | 5 +++- .../client-appsync/runtimeConfig.native.ts | 3 -- clients/client-appsync/runtimeConfig.ts | 5 +++- clients/client-athena/AthenaClient.ts | 27 +++++++++-------- .../client-athena/runtimeConfig.browser.ts | 5 +++- clients/client-athena/runtimeConfig.native.ts | 3 -- clients/client-athena/runtimeConfig.ts | 5 +++- .../client-auditmanager/AuditManagerClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-auditmanager/runtimeConfig.ts | 5 +++- .../AutoScalingPlansClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../client-auto-scaling/AutoScalingClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-auto-scaling/runtimeConfig.ts | 5 +++- clients/client-backup/BackupClient.ts | 27 +++++++++-------- .../client-backup/runtimeConfig.browser.ts | 5 +++- clients/client-backup/runtimeConfig.native.ts | 3 -- clients/client-backup/runtimeConfig.ts | 5 +++- clients/client-batch/BatchClient.ts | 27 +++++++++-------- clients/client-batch/runtimeConfig.browser.ts | 5 +++- clients/client-batch/runtimeConfig.native.ts | 3 -- clients/client-batch/runtimeConfig.ts | 5 +++- clients/client-braket/BraketClient.ts | 27 +++++++++-------- .../client-braket/runtimeConfig.browser.ts | 5 +++- clients/client-braket/runtimeConfig.native.ts | 3 -- clients/client-braket/runtimeConfig.ts | 5 +++- clients/client-budgets/BudgetsClient.ts | 27 +++++++++-------- .../client-budgets/runtimeConfig.browser.ts | 5 +++- .../client-budgets/runtimeConfig.native.ts | 3 -- clients/client-budgets/runtimeConfig.ts | 5 +++- clients/client-chime/ChimeClient.ts | 27 +++++++++-------- clients/client-chime/runtimeConfig.browser.ts | 5 +++- clients/client-chime/runtimeConfig.native.ts | 3 -- clients/client-chime/runtimeConfig.ts | 5 +++- clients/client-cloud9/Cloud9Client.ts | 27 +++++++++-------- .../client-cloud9/runtimeConfig.browser.ts | 5 +++- clients/client-cloud9/runtimeConfig.native.ts | 3 -- clients/client-cloud9/runtimeConfig.ts | 5 +++- .../CloudDirectoryClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-clouddirectory/runtimeConfig.ts | 5 +++- .../CloudFormationClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-cloudformation/runtimeConfig.ts | 5 +++- clients/client-cloudfront/CloudFrontClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../client-cloudfront/runtimeConfig.native.ts | 3 -- clients/client-cloudfront/runtimeConfig.ts | 5 +++- .../client-cloudhsm-v2/CloudHSMV2Client.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-cloudhsm-v2/runtimeConfig.ts | 5 +++- clients/client-cloudhsm/CloudHSMClient.ts | 27 +++++++++-------- .../client-cloudhsm/runtimeConfig.browser.ts | 5 +++- .../client-cloudhsm/runtimeConfig.native.ts | 3 -- clients/client-cloudhsm/runtimeConfig.ts | 5 +++- .../CloudSearchDomainClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../client-cloudsearch/CloudSearchClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-cloudsearch/runtimeConfig.ts | 5 +++- clients/client-cloudtrail/CloudTrailClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../client-cloudtrail/runtimeConfig.native.ts | 3 -- clients/client-cloudtrail/runtimeConfig.ts | 5 +++- .../CloudWatchEventsClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-cloudwatch-events/runtimeConfig.ts | 5 +++- .../CloudWatchLogsClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-cloudwatch-logs/runtimeConfig.ts | 5 +++- clients/client-cloudwatch/CloudWatchClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../client-cloudwatch/runtimeConfig.native.ts | 3 -- clients/client-cloudwatch/runtimeConfig.ts | 5 +++- .../client-codeartifact/CodeartifactClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-codeartifact/runtimeConfig.ts | 5 +++- clients/client-codebuild/CodeBuildClient.ts | 27 +++++++++-------- .../client-codebuild/runtimeConfig.browser.ts | 5 +++- .../client-codebuild/runtimeConfig.native.ts | 3 -- clients/client-codebuild/runtimeConfig.ts | 5 +++- clients/client-codecommit/CodeCommitClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../client-codecommit/runtimeConfig.native.ts | 3 -- clients/client-codecommit/runtimeConfig.ts | 5 +++- clients/client-codedeploy/CodeDeployClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../client-codedeploy/runtimeConfig.native.ts | 3 -- clients/client-codedeploy/runtimeConfig.ts | 5 +++- .../CodeGuruReviewerClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-codeguru-reviewer/runtimeConfig.ts | 5 +++- .../CodeGuruProfilerClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-codeguruprofiler/runtimeConfig.ts | 5 +++- .../client-codepipeline/CodePipelineClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-codepipeline/runtimeConfig.ts | 5 +++- .../CodeStarConnectionsClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../CodestarNotificationsClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- clients/client-codestar/CodeStarClient.ts | 27 +++++++++-------- .../client-codestar/runtimeConfig.browser.ts | 5 +++- .../client-codestar/runtimeConfig.native.ts | 3 -- clients/client-codestar/runtimeConfig.ts | 5 +++- .../CognitoIdentityProviderClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../CognitoIdentityClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-cognito-identity/runtimeConfig.ts | 5 +++- .../client-cognito-sync/CognitoSyncClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-cognito-sync/runtimeConfig.ts | 5 +++- clients/client-comprehend/ComprehendClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../client-comprehend/runtimeConfig.native.ts | 3 -- clients/client-comprehend/runtimeConfig.ts | 5 +++- .../ComprehendMedicalClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-comprehendmedical/runtimeConfig.ts | 5 +++- .../ComputeOptimizerClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-compute-optimizer/runtimeConfig.ts | 5 +++- .../ConfigServiceClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-config-service/runtimeConfig.ts | 5 +++- .../ConnectContactLensClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- clients/client-connect/ConnectClient.ts | 27 +++++++++-------- .../client-connect/runtimeConfig.browser.ts | 5 +++- .../client-connect/runtimeConfig.native.ts | 3 -- clients/client-connect/runtimeConfig.ts | 5 +++- .../ConnectParticipantClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../CostAndUsageReportServiceClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../CostExplorerClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-cost-explorer/runtimeConfig.ts | 5 +++- .../CustomerProfilesClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-customer-profiles/runtimeConfig.ts | 5 +++- .../DataPipelineClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-data-pipeline/runtimeConfig.ts | 5 +++- .../DatabaseMigrationServiceClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- clients/client-databrew/DataBrewClient.ts | 27 +++++++++-------- .../client-databrew/runtimeConfig.browser.ts | 5 +++- .../client-databrew/runtimeConfig.native.ts | 3 -- clients/client-databrew/runtimeConfig.ts | 5 +++- .../client-dataexchange/DataExchangeClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-dataexchange/runtimeConfig.ts | 5 +++- clients/client-datasync/DataSyncClient.ts | 27 +++++++++-------- .../client-datasync/runtimeConfig.browser.ts | 5 +++- .../client-datasync/runtimeConfig.native.ts | 3 -- clients/client-datasync/runtimeConfig.ts | 5 +++- clients/client-dax/DAXClient.ts | 27 +++++++++-------- clients/client-dax/runtimeConfig.browser.ts | 5 +++- clients/client-dax/runtimeConfig.native.ts | 3 -- clients/client-dax/runtimeConfig.ts | 5 +++- clients/client-detective/DetectiveClient.ts | 27 +++++++++-------- .../client-detective/runtimeConfig.browser.ts | 5 +++- .../client-detective/runtimeConfig.native.ts | 3 -- clients/client-detective/runtimeConfig.ts | 5 +++- .../client-device-farm/DeviceFarmClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-device-farm/runtimeConfig.ts | 5 +++- .../client-devops-guru/DevOpsGuruClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-devops-guru/runtimeConfig.ts | 5 +++- .../DirectConnectClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-direct-connect/runtimeConfig.ts | 5 +++- .../DirectoryServiceClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-directory-service/runtimeConfig.ts | 5 +++- clients/client-dlm/DLMClient.ts | 27 +++++++++-------- clients/client-dlm/runtimeConfig.browser.ts | 5 +++- clients/client-dlm/runtimeConfig.native.ts | 3 -- clients/client-dlm/runtimeConfig.ts | 5 +++- clients/client-docdb/DocDBClient.ts | 27 +++++++++-------- clients/client-docdb/runtimeConfig.browser.ts | 5 +++- clients/client-docdb/runtimeConfig.native.ts | 3 -- clients/client-docdb/runtimeConfig.ts | 5 +++- .../DynamoDBStreamsClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-dynamodb-streams/runtimeConfig.ts | 5 +++- clients/client-dynamodb/DynamoDBClient.ts | 27 +++++++++-------- .../client-dynamodb/runtimeConfig.browser.ts | 5 +++- .../client-dynamodb/runtimeConfig.native.ts | 3 -- clients/client-dynamodb/runtimeConfig.ts | 5 +++- clients/client-ebs/EBSClient.ts | 27 +++++++++-------- clients/client-ebs/runtimeConfig.browser.ts | 5 +++- clients/client-ebs/runtimeConfig.native.ts | 3 -- clients/client-ebs/runtimeConfig.ts | 5 +++- .../EC2InstanceConnectClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- clients/client-ec2/EC2Client.ts | 27 +++++++++-------- clients/client-ec2/runtimeConfig.browser.ts | 5 +++- clients/client-ec2/runtimeConfig.native.ts | 3 -- clients/client-ec2/runtimeConfig.ts | 5 +++- clients/client-ecr-public/ECRPUBLICClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../client-ecr-public/runtimeConfig.native.ts | 3 -- clients/client-ecr-public/runtimeConfig.ts | 5 +++- clients/client-ecr/ECRClient.ts | 27 +++++++++-------- clients/client-ecr/runtimeConfig.browser.ts | 5 +++- clients/client-ecr/runtimeConfig.native.ts | 3 -- clients/client-ecr/runtimeConfig.ts | 5 +++- clients/client-ecs/ECSClient.ts | 27 +++++++++-------- clients/client-ecs/runtimeConfig.browser.ts | 5 +++- clients/client-ecs/runtimeConfig.native.ts | 3 -- clients/client-ecs/runtimeConfig.ts | 5 +++- clients/client-efs/EFSClient.ts | 27 +++++++++-------- clients/client-efs/runtimeConfig.browser.ts | 5 +++- clients/client-efs/runtimeConfig.native.ts | 3 -- clients/client-efs/runtimeConfig.ts | 5 +++- clients/client-eks/EKSClient.ts | 27 +++++++++-------- clients/client-eks/runtimeConfig.browser.ts | 5 +++- clients/client-eks/runtimeConfig.native.ts | 3 -- clients/client-eks/runtimeConfig.ts | 5 +++- .../ElasticBeanstalkClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-elastic-beanstalk/runtimeConfig.ts | 5 +++- .../ElasticInferenceClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-elastic-inference/runtimeConfig.ts | 5 +++- .../ElasticLoadBalancingV2Client.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../ElasticLoadBalancingClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../ElasticTranscoderClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../client-elasticache/ElastiCacheClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-elasticache/runtimeConfig.ts | 5 +++- .../ElasticsearchServiceClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../EMRContainersClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-emr-containers/runtimeConfig.ts | 5 +++- clients/client-emr/EMRClient.ts | 27 +++++++++-------- clients/client-emr/runtimeConfig.browser.ts | 5 +++- clients/client-emr/runtimeConfig.native.ts | 3 -- clients/client-emr/runtimeConfig.ts | 5 +++- .../client-eventbridge/EventBridgeClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-eventbridge/runtimeConfig.ts | 5 +++- clients/client-firehose/FirehoseClient.ts | 27 +++++++++-------- .../client-firehose/runtimeConfig.browser.ts | 5 +++- .../client-firehose/runtimeConfig.native.ts | 3 -- clients/client-firehose/runtimeConfig.ts | 5 +++- clients/client-fms/FMSClient.ts | 27 +++++++++-------- clients/client-fms/runtimeConfig.browser.ts | 5 +++- clients/client-fms/runtimeConfig.native.ts | 3 -- clients/client-fms/runtimeConfig.ts | 5 +++- clients/client-forecast/ForecastClient.ts | 27 +++++++++-------- .../client-forecast/runtimeConfig.browser.ts | 5 +++- .../client-forecast/runtimeConfig.native.ts | 3 -- clients/client-forecast/runtimeConfig.ts | 5 +++- .../ForecastqueryClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-forecastquery/runtimeConfig.ts | 5 +++- .../FraudDetectorClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-frauddetector/runtimeConfig.ts | 5 +++- clients/client-fsx/FSxClient.ts | 27 +++++++++-------- clients/client-fsx/runtimeConfig.browser.ts | 5 +++- clients/client-fsx/runtimeConfig.native.ts | 3 -- clients/client-fsx/runtimeConfig.ts | 5 +++- clients/client-gamelift/GameLiftClient.ts | 27 +++++++++-------- .../client-gamelift/runtimeConfig.browser.ts | 5 +++- .../client-gamelift/runtimeConfig.native.ts | 3 -- clients/client-gamelift/runtimeConfig.ts | 5 +++- clients/client-glacier/GlacierClient.ts | 27 +++++++++-------- .../client-glacier/runtimeConfig.browser.ts | 5 +++- .../client-glacier/runtimeConfig.native.ts | 3 -- clients/client-glacier/runtimeConfig.ts | 5 +++- .../GlobalAcceleratorClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- clients/client-glue/GlueClient.ts | 27 +++++++++-------- clients/client-glue/runtimeConfig.browser.ts | 5 +++- clients/client-glue/runtimeConfig.native.ts | 3 -- clients/client-glue/runtimeConfig.ts | 5 +++- clients/client-greengrass/GreengrassClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../client-greengrass/runtimeConfig.native.ts | 3 -- clients/client-greengrass/runtimeConfig.ts | 5 +++- .../GroundStationClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-groundstation/runtimeConfig.ts | 5 +++- clients/client-guardduty/GuardDutyClient.ts | 27 +++++++++-------- .../client-guardduty/runtimeConfig.browser.ts | 5 +++- .../client-guardduty/runtimeConfig.native.ts | 3 -- clients/client-guardduty/runtimeConfig.ts | 5 +++- clients/client-health/HealthClient.ts | 27 +++++++++-------- .../client-health/runtimeConfig.browser.ts | 5 +++- clients/client-health/runtimeConfig.native.ts | 3 -- clients/client-health/runtimeConfig.ts | 5 +++- clients/client-healthlake/HealthLakeClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../client-healthlake/runtimeConfig.native.ts | 3 -- clients/client-healthlake/runtimeConfig.ts | 5 +++- clients/client-honeycode/HoneycodeClient.ts | 27 +++++++++-------- .../client-honeycode/runtimeConfig.browser.ts | 5 +++- .../client-honeycode/runtimeConfig.native.ts | 3 -- clients/client-honeycode/runtimeConfig.ts | 5 +++- clients/client-iam/IAMClient.ts | 27 +++++++++-------- clients/client-iam/runtimeConfig.browser.ts | 5 +++- clients/client-iam/runtimeConfig.native.ts | 3 -- clients/client-iam/runtimeConfig.ts | 5 +++- .../IdentitystoreClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-identitystore/runtimeConfig.ts | 5 +++- .../client-imagebuilder/ImagebuilderClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-imagebuilder/runtimeConfig.ts | 5 +++- clients/client-inspector/InspectorClient.ts | 27 +++++++++-------- .../client-inspector/runtimeConfig.browser.ts | 5 +++- .../client-inspector/runtimeConfig.native.ts | 3 -- clients/client-inspector/runtimeConfig.ts | 5 +++- .../IoT1ClickDevicesServiceClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../IoT1ClickProjectsClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../IoTDataPlaneClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-iot-data-plane/runtimeConfig.ts | 5 +++- .../IoTEventsDataClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-iot-events-data/runtimeConfig.ts | 5 +++- clients/client-iot-events/IoTEventsClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../client-iot-events/runtimeConfig.native.ts | 3 -- clients/client-iot-events/runtimeConfig.ts | 5 +++- .../IoTJobsDataPlaneClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- clients/client-iot/IoTClient.ts | 27 +++++++++-------- clients/client-iot/runtimeConfig.browser.ts | 5 +++- clients/client-iot/runtimeConfig.native.ts | 3 -- clients/client-iot/runtimeConfig.ts | 5 +++- .../client-iotanalytics/IoTAnalyticsClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-iotanalytics/runtimeConfig.ts | 5 +++- .../IoTSecureTunnelingClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../client-iotsitewise/IoTSiteWiseClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-iotsitewise/runtimeConfig.ts | 5 +++- .../IoTThingsGraphClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-iotthingsgraph/runtimeConfig.ts | 5 +++- clients/client-ivs/IvsClient.ts | 27 +++++++++-------- clients/client-ivs/runtimeConfig.browser.ts | 5 +++- clients/client-ivs/runtimeConfig.native.ts | 3 -- clients/client-ivs/runtimeConfig.ts | 5 +++- clients/client-kafka/KafkaClient.ts | 27 +++++++++-------- clients/client-kafka/runtimeConfig.browser.ts | 5 +++- clients/client-kafka/runtimeConfig.native.ts | 3 -- clients/client-kafka/runtimeConfig.ts | 5 +++- clients/client-kendra/KendraClient.ts | 27 +++++++++-------- .../client-kendra/runtimeConfig.browser.ts | 5 +++- clients/client-kendra/runtimeConfig.native.ts | 3 -- clients/client-kendra/runtimeConfig.ts | 5 +++- .../KinesisAnalyticsV2Client.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../KinesisAnalyticsClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-kinesis-analytics/runtimeConfig.ts | 5 +++- .../KinesisVideoArchivedMediaClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../KinesisVideoMediaClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../KinesisVideoSignalingClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../KinesisVideoClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-kinesis-video/runtimeConfig.ts | 5 +++- clients/client-kinesis/KinesisClient.ts | 23 ++++++++------- .../client-kinesis/runtimeConfig.browser.ts | 5 +++- .../client-kinesis/runtimeConfig.native.ts | 3 -- clients/client-kinesis/runtimeConfig.ts | 5 +++- clients/client-kms/KMSClient.ts | 27 +++++++++-------- clients/client-kms/runtimeConfig.browser.ts | 5 +++- clients/client-kms/runtimeConfig.native.ts | 3 -- clients/client-kms/runtimeConfig.ts | 5 +++- .../LakeFormationClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-lakeformation/runtimeConfig.ts | 5 +++- clients/client-lambda/LambdaClient.ts | 27 +++++++++-------- .../client-lambda/runtimeConfig.browser.ts | 5 +++- clients/client-lambda/runtimeConfig.native.ts | 3 -- clients/client-lambda/runtimeConfig.ts | 5 +++- .../LexModelBuildingServiceClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../LexRuntimeServiceClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../LicenseManagerClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-license-manager/runtimeConfig.ts | 5 +++- clients/client-lightsail/LightsailClient.ts | 27 +++++++++-------- .../client-lightsail/runtimeConfig.browser.ts | 5 +++- .../client-lightsail/runtimeConfig.native.ts | 3 -- clients/client-lightsail/runtimeConfig.ts | 5 +++- .../LookoutVisionClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-lookoutvision/runtimeConfig.ts | 5 +++- .../MachineLearningClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-machine-learning/runtimeConfig.ts | 5 +++- clients/client-macie/MacieClient.ts | 27 +++++++++-------- clients/client-macie/runtimeConfig.browser.ts | 5 +++- clients/client-macie/runtimeConfig.native.ts | 3 -- clients/client-macie/runtimeConfig.ts | 5 +++- clients/client-macie2/Macie2Client.ts | 27 +++++++++-------- .../client-macie2/runtimeConfig.browser.ts | 5 +++- clients/client-macie2/runtimeConfig.native.ts | 3 -- clients/client-macie2/runtimeConfig.ts | 5 +++- .../ManagedBlockchainClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-managedblockchain/runtimeConfig.ts | 5 +++- .../MarketplaceCatalogClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../MarketplaceCommerceAnalyticsClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../MarketplaceEntitlementServiceClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../MarketplaceMeteringClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../client-mediaconnect/MediaConnectClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-mediaconnect/runtimeConfig.ts | 5 +++- .../client-mediaconvert/MediaConvertClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-mediaconvert/runtimeConfig.ts | 5 +++- clients/client-medialive/MediaLiveClient.ts | 27 +++++++++-------- .../client-medialive/runtimeConfig.browser.ts | 5 +++- .../client-medialive/runtimeConfig.native.ts | 3 -- clients/client-medialive/runtimeConfig.ts | 5 +++- .../MediaPackageVodClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-mediapackage-vod/runtimeConfig.ts | 5 +++- .../client-mediapackage/MediaPackageClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-mediapackage/runtimeConfig.ts | 5 +++- .../MediaStoreDataClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-mediastore-data/runtimeConfig.ts | 5 +++- clients/client-mediastore/MediaStoreClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../client-mediastore/runtimeConfig.native.ts | 3 -- clients/client-mediastore/runtimeConfig.ts | 5 +++- .../client-mediatailor/MediaTailorClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-mediatailor/runtimeConfig.ts | 5 +++- .../MigrationHubClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-migration-hub/runtimeConfig.ts | 5 +++- .../MigrationHubConfigClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- clients/client-mobile/MobileClient.ts | 27 +++++++++-------- .../client-mobile/runtimeConfig.browser.ts | 5 +++- clients/client-mobile/runtimeConfig.native.ts | 3 -- clients/client-mobile/runtimeConfig.ts | 5 +++- clients/client-mq/MqClient.ts | 27 +++++++++-------- clients/client-mq/runtimeConfig.browser.ts | 5 +++- clients/client-mq/runtimeConfig.native.ts | 3 -- clients/client-mq/runtimeConfig.ts | 5 +++- clients/client-mturk/MTurkClient.ts | 27 +++++++++-------- clients/client-mturk/runtimeConfig.browser.ts | 5 +++- clients/client-mturk/runtimeConfig.native.ts | 3 -- clients/client-mturk/runtimeConfig.ts | 5 +++- clients/client-neptune/NeptuneClient.ts | 27 +++++++++-------- .../client-neptune/runtimeConfig.browser.ts | 5 +++- .../client-neptune/runtimeConfig.native.ts | 3 -- clients/client-neptune/runtimeConfig.ts | 5 +++- .../NetworkFirewallClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-network-firewall/runtimeConfig.ts | 5 +++- .../NetworkManagerClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-networkmanager/runtimeConfig.ts | 5 +++- clients/client-opsworks/OpsWorksClient.ts | 27 +++++++++-------- .../client-opsworks/runtimeConfig.browser.ts | 5 +++- .../client-opsworks/runtimeConfig.native.ts | 3 -- clients/client-opsworks/runtimeConfig.ts | 5 +++- clients/client-opsworkscm/OpsWorksCMClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../client-opsworkscm/runtimeConfig.native.ts | 3 -- clients/client-opsworkscm/runtimeConfig.ts | 5 +++- .../OrganizationsClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-organizations/runtimeConfig.ts | 5 +++- clients/client-outposts/OutpostsClient.ts | 27 +++++++++-------- .../client-outposts/runtimeConfig.browser.ts | 5 +++- .../client-outposts/runtimeConfig.native.ts | 3 -- clients/client-outposts/runtimeConfig.ts | 5 +++- .../PersonalizeEventsClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../PersonalizeRuntimeClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../client-personalize/PersonalizeClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-personalize/runtimeConfig.ts | 5 +++- clients/client-pi/PIClient.ts | 27 +++++++++-------- clients/client-pi/runtimeConfig.browser.ts | 5 +++- clients/client-pi/runtimeConfig.native.ts | 3 -- clients/client-pi/runtimeConfig.ts | 5 +++- .../PinpointEmailClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-pinpoint-email/runtimeConfig.ts | 5 +++- .../PinpointSMSVoiceClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- clients/client-pinpoint/PinpointClient.ts | 27 +++++++++-------- .../client-pinpoint/runtimeConfig.browser.ts | 5 +++- .../client-pinpoint/runtimeConfig.native.ts | 3 -- clients/client-pinpoint/runtimeConfig.ts | 5 +++- clients/client-polly/PollyClient.ts | 27 +++++++++-------- clients/client-polly/runtimeConfig.browser.ts | 5 +++- clients/client-polly/runtimeConfig.native.ts | 3 -- clients/client-polly/runtimeConfig.ts | 5 +++- clients/client-pricing/PricingClient.ts | 27 +++++++++-------- .../client-pricing/runtimeConfig.browser.ts | 5 +++- .../client-pricing/runtimeConfig.native.ts | 3 -- clients/client-pricing/runtimeConfig.ts | 5 +++- .../client-qldb-session/QLDBSessionClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-qldb-session/runtimeConfig.ts | 5 +++- clients/client-qldb/QLDBClient.ts | 27 +++++++++-------- clients/client-qldb/runtimeConfig.browser.ts | 5 +++- clients/client-qldb/runtimeConfig.native.ts | 3 -- clients/client-qldb/runtimeConfig.ts | 5 +++- clients/client-quicksight/QuickSightClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../client-quicksight/runtimeConfig.native.ts | 3 -- clients/client-quicksight/runtimeConfig.ts | 5 +++- clients/client-ram/RAMClient.ts | 27 +++++++++-------- clients/client-ram/runtimeConfig.browser.ts | 5 +++- clients/client-ram/runtimeConfig.native.ts | 3 -- clients/client-ram/runtimeConfig.ts | 5 +++- clients/client-rds-data/RDSDataClient.ts | 27 +++++++++-------- .../client-rds-data/runtimeConfig.browser.ts | 5 +++- .../client-rds-data/runtimeConfig.native.ts | 3 -- clients/client-rds-data/runtimeConfig.ts | 5 +++- clients/client-rds/RDSClient.ts | 27 +++++++++-------- clients/client-rds/runtimeConfig.browser.ts | 5 +++- clients/client-rds/runtimeConfig.native.ts | 3 -- clients/client-rds/runtimeConfig.ts | 5 +++- .../RedshiftDataClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-redshift-data/runtimeConfig.ts | 5 +++- clients/client-redshift/RedshiftClient.ts | 27 +++++++++-------- .../client-redshift/runtimeConfig.browser.ts | 5 +++- .../client-redshift/runtimeConfig.native.ts | 3 -- clients/client-redshift/runtimeConfig.ts | 5 +++- .../client-rekognition/RekognitionClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-rekognition/runtimeConfig.ts | 5 +++- .../ResourceGroupsTaggingAPIClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../ResourceGroupsClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-resource-groups/runtimeConfig.ts | 5 +++- clients/client-robomaker/RoboMakerClient.ts | 27 +++++++++-------- .../client-robomaker/runtimeConfig.browser.ts | 5 +++- .../client-robomaker/runtimeConfig.native.ts | 3 -- clients/client-robomaker/runtimeConfig.ts | 5 +++- .../Route53DomainsClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-route-53-domains/runtimeConfig.ts | 5 +++- clients/client-route-53/Route53Client.ts | 27 +++++++++-------- .../client-route-53/runtimeConfig.browser.ts | 5 +++- .../client-route-53/runtimeConfig.native.ts | 3 -- clients/client-route-53/runtimeConfig.ts | 5 +++- .../Route53ResolverClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-route53resolver/runtimeConfig.ts | 5 +++- clients/client-s3-control/S3ControlClient.ts | 29 ++++++++++--------- .../runtimeConfig.browser.ts | 5 +++- .../client-s3-control/runtimeConfig.native.ts | 3 -- clients/client-s3-control/runtimeConfig.ts | 5 +++- clients/client-s3/S3Client.ts | 24 ++++++++------- clients/client-s3/runtimeConfig.browser.ts | 5 +++- clients/client-s3/runtimeConfig.native.ts | 3 -- clients/client-s3/runtimeConfig.ts | 5 +++- clients/client-s3outposts/S3OutpostsClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../client-s3outposts/runtimeConfig.native.ts | 3 -- clients/client-s3outposts/runtimeConfig.ts | 5 +++- .../SageMakerA2IRuntimeClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../SagemakerEdgeClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-sagemaker-edge/runtimeConfig.ts | 5 +++- .../SageMakerFeatureStoreRuntimeClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../SageMakerRuntimeClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-sagemaker-runtime/runtimeConfig.ts | 5 +++- clients/client-sagemaker/SageMakerClient.ts | 27 +++++++++-------- .../client-sagemaker/runtimeConfig.browser.ts | 5 +++- .../client-sagemaker/runtimeConfig.native.ts | 3 -- clients/client-sagemaker/runtimeConfig.ts | 5 +++- .../client-savingsplans/SavingsplansClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-savingsplans/runtimeConfig.ts | 5 +++- clients/client-schemas/SchemasClient.ts | 27 +++++++++-------- .../client-schemas/runtimeConfig.browser.ts | 5 +++- .../client-schemas/runtimeConfig.native.ts | 3 -- clients/client-schemas/runtimeConfig.ts | 5 +++- .../SecretsManagerClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-secrets-manager/runtimeConfig.ts | 5 +++- .../client-securityhub/SecurityHubClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-securityhub/runtimeConfig.ts | 5 +++- .../ServerlessApplicationRepositoryClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../ServiceCatalogAppRegistryClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- .../ServiceCatalogClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-service-catalog/runtimeConfig.ts | 5 +++- .../ServiceQuotasClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-service-quotas/runtimeConfig.ts | 5 +++- .../ServiceDiscoveryClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-servicediscovery/runtimeConfig.ts | 5 +++- clients/client-ses/SESClient.ts | 27 +++++++++-------- clients/client-ses/runtimeConfig.browser.ts | 5 +++- clients/client-ses/runtimeConfig.native.ts | 3 -- clients/client-ses/runtimeConfig.ts | 5 +++- clients/client-sesv2/SESv2Client.ts | 27 +++++++++-------- clients/client-sesv2/runtimeConfig.browser.ts | 5 +++- clients/client-sesv2/runtimeConfig.native.ts | 3 -- clients/client-sesv2/runtimeConfig.ts | 5 +++- clients/client-sfn/SFNClient.ts | 27 +++++++++-------- clients/client-sfn/runtimeConfig.browser.ts | 5 +++- clients/client-sfn/runtimeConfig.native.ts | 3 -- clients/client-sfn/runtimeConfig.ts | 5 +++- clients/client-shield/ShieldClient.ts | 27 +++++++++-------- .../client-shield/runtimeConfig.browser.ts | 5 +++- clients/client-shield/runtimeConfig.native.ts | 3 -- clients/client-shield/runtimeConfig.ts | 5 +++- clients/client-signer/SignerClient.ts | 27 +++++++++-------- .../client-signer/runtimeConfig.browser.ts | 5 +++- clients/client-signer/runtimeConfig.native.ts | 3 -- clients/client-signer/runtimeConfig.ts | 5 +++- clients/client-sms/SMSClient.ts | 27 +++++++++-------- clients/client-sms/runtimeConfig.browser.ts | 5 +++- clients/client-sms/runtimeConfig.native.ts | 3 -- clients/client-sms/runtimeConfig.ts | 5 +++- clients/client-snowball/SnowballClient.ts | 27 +++++++++-------- .../client-snowball/runtimeConfig.browser.ts | 5 +++- .../client-snowball/runtimeConfig.native.ts | 3 -- clients/client-snowball/runtimeConfig.ts | 5 +++- clients/client-sns/SNSClient.ts | 27 +++++++++-------- clients/client-sns/runtimeConfig.browser.ts | 5 +++- clients/client-sns/runtimeConfig.native.ts | 3 -- clients/client-sns/runtimeConfig.ts | 5 +++- clients/client-sqs/SQSClient.ts | 27 +++++++++-------- clients/client-sqs/runtimeConfig.browser.ts | 5 +++- clients/client-sqs/runtimeConfig.native.ts | 3 -- clients/client-sqs/runtimeConfig.ts | 5 +++- clients/client-ssm/SSMClient.ts | 27 +++++++++-------- clients/client-ssm/runtimeConfig.browser.ts | 5 +++- clients/client-ssm/runtimeConfig.native.ts | 3 -- clients/client-ssm/runtimeConfig.ts | 5 +++- clients/client-sso-admin/SSOAdminClient.ts | 27 +++++++++-------- .../client-sso-admin/runtimeConfig.browser.ts | 5 +++- .../client-sso-admin/runtimeConfig.native.ts | 3 -- clients/client-sso-admin/runtimeConfig.ts | 5 +++- clients/client-sso-oidc/SSOOIDCClient.ts | 27 +++++++++-------- .../client-sso-oidc/runtimeConfig.browser.ts | 5 +++- .../client-sso-oidc/runtimeConfig.native.ts | 3 -- clients/client-sso-oidc/runtimeConfig.ts | 5 +++- clients/client-sso/SSOClient.ts | 27 +++++++++-------- clients/client-sso/runtimeConfig.browser.ts | 5 +++- clients/client-sso/runtimeConfig.native.ts | 3 -- clients/client-sso/runtimeConfig.ts | 5 +++- .../StorageGatewayClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-storage-gateway/runtimeConfig.ts | 5 +++- clients/client-sts/STSClient.ts | 27 +++++++++-------- clients/client-sts/runtimeConfig.browser.ts | 5 +++- clients/client-sts/runtimeConfig.native.ts | 3 -- clients/client-sts/runtimeConfig.ts | 5 +++- clients/client-support/SupportClient.ts | 27 +++++++++-------- .../client-support/runtimeConfig.browser.ts | 5 +++- .../client-support/runtimeConfig.native.ts | 3 -- clients/client-support/runtimeConfig.ts | 5 +++- clients/client-swf/SWFClient.ts | 27 +++++++++-------- clients/client-swf/runtimeConfig.browser.ts | 5 +++- clients/client-swf/runtimeConfig.native.ts | 3 -- clients/client-swf/runtimeConfig.ts | 5 +++- clients/client-synthetics/SyntheticsClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../client-synthetics/runtimeConfig.native.ts | 3 -- clients/client-synthetics/runtimeConfig.ts | 5 +++- clients/client-textract/TextractClient.ts | 27 +++++++++-------- .../client-textract/runtimeConfig.browser.ts | 5 +++- .../client-textract/runtimeConfig.native.ts | 3 -- clients/client-textract/runtimeConfig.ts | 5 +++- .../TimestreamQueryClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-timestream-query/runtimeConfig.ts | 5 +++- .../TimestreamWriteClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../client-timestream-write/runtimeConfig.ts | 5 +++- .../TranscribeStreamingClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- clients/client-transcribe/TranscribeClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../client-transcribe/runtimeConfig.native.ts | 3 -- clients/client-transcribe/runtimeConfig.ts | 5 +++- clients/client-transfer/TransferClient.ts | 27 +++++++++-------- .../client-transfer/runtimeConfig.browser.ts | 5 +++- .../client-transfer/runtimeConfig.native.ts | 3 -- clients/client-transfer/runtimeConfig.ts | 5 +++- clients/client-translate/TranslateClient.ts | 27 +++++++++-------- .../client-translate/runtimeConfig.browser.ts | 5 +++- .../client-translate/runtimeConfig.native.ts | 3 -- clients/client-translate/runtimeConfig.ts | 5 +++- .../client-waf-regional/WAFRegionalClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- clients/client-waf-regional/runtimeConfig.ts | 5 +++- clients/client-waf/WAFClient.ts | 27 +++++++++-------- clients/client-waf/runtimeConfig.browser.ts | 5 +++- clients/client-waf/runtimeConfig.native.ts | 3 -- clients/client-waf/runtimeConfig.ts | 5 +++- clients/client-wafv2/WAFV2Client.ts | 27 +++++++++-------- clients/client-wafv2/runtimeConfig.browser.ts | 5 +++- clients/client-wafv2/runtimeConfig.native.ts | 3 -- clients/client-wafv2/runtimeConfig.ts | 5 +++- clients/client-workdocs/WorkDocsClient.ts | 27 +++++++++-------- .../client-workdocs/runtimeConfig.browser.ts | 5 +++- .../client-workdocs/runtimeConfig.native.ts | 3 -- clients/client-workdocs/runtimeConfig.ts | 5 +++- clients/client-worklink/WorkLinkClient.ts | 27 +++++++++-------- .../client-worklink/runtimeConfig.browser.ts | 5 +++- .../client-worklink/runtimeConfig.native.ts | 3 -- clients/client-worklink/runtimeConfig.ts | 5 +++- clients/client-workmail/WorkMailClient.ts | 27 +++++++++-------- .../client-workmail/runtimeConfig.browser.ts | 5 +++- .../client-workmail/runtimeConfig.native.ts | 3 -- clients/client-workmail/runtimeConfig.ts | 5 +++- .../WorkMailMessageFlowClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../runtimeConfig.native.ts | 3 -- .../runtimeConfig.ts | 5 +++- clients/client-workspaces/WorkSpacesClient.ts | 27 +++++++++-------- .../runtimeConfig.browser.ts | 5 +++- .../client-workspaces/runtimeConfig.native.ts | 3 -- clients/client-workspaces/runtimeConfig.ts | 5 +++- clients/client-xray/XRayClient.ts | 27 +++++++++-------- clients/client-xray/runtimeConfig.browser.ts | 5 +++- clients/client-xray/runtimeConfig.native.ts | 3 -- clients/client-xray/runtimeConfig.ts | 5 +++- protocol_tests/aws-ec2/EC2ProtocolClient.ts | 27 +++++++++-------- .../aws-ec2/runtimeConfig.browser.ts | 5 +++- .../aws-ec2/runtimeConfig.native.ts | 3 -- protocol_tests/aws-ec2/runtimeConfig.ts | 5 +++- protocol_tests/aws-json/JsonProtocolClient.ts | 27 +++++++++-------- .../aws-json/runtimeConfig.browser.ts | 5 +++- .../aws-json/runtimeConfig.native.ts | 3 -- protocol_tests/aws-json/runtimeConfig.ts | 5 +++- .../aws-query/QueryProtocolClient.ts | 27 +++++++++-------- .../aws-query/runtimeConfig.browser.ts | 5 +++- .../aws-query/runtimeConfig.native.ts | 3 -- protocol_tests/aws-query/runtimeConfig.ts | 5 +++- .../aws-restjson/RestJsonProtocolClient.ts | 27 +++++++++-------- .../aws-restjson/runtimeConfig.browser.ts | 5 +++- .../aws-restjson/runtimeConfig.native.ts | 3 -- protocol_tests/aws-restjson/runtimeConfig.ts | 5 +++- .../aws-restxml/RestXmlProtocolClient.ts | 27 +++++++++-------- .../aws-restxml/runtimeConfig.browser.ts | 5 +++- .../aws-restxml/runtimeConfig.native.ts | 3 -- protocol_tests/aws-restxml/runtimeConfig.ts | 5 +++- 1008 files changed, 5793 insertions(+), 4282 deletions(-) diff --git a/clients/client-accessanalyzer/AccessAnalyzerClient.ts b/clients/client-accessanalyzer/AccessAnalyzerClient.ts index f9c23f265187e..5c517e0649a47 100644 --- a/clients/client-accessanalyzer/AccessAnalyzerClient.ts +++ b/clients/client-accessanalyzer/AccessAnalyzerClient.ts @@ -62,6 +62,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -72,6 +73,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -161,11 +163,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -207,6 +204,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AccessAnalyzerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -215,8 +218,8 @@ export type AccessAnalyzerClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AccessAnalyzerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -224,8 +227,8 @@ export type AccessAnalyzerClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS IAM Access Analyzer helps identify potential resource-access risks by enabling you to identify @@ -253,16 +256,16 @@ export class AccessAnalyzerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-accessanalyzer/runtimeConfig.browser.ts b/clients/client-accessanalyzer/runtimeConfig.browser.ts index aea62fb426257..aeb0a8d930385 100644 --- a/clients/client-accessanalyzer/runtimeConfig.browser.ts +++ b/clients/client-accessanalyzer/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-accessanalyzer/runtimeConfig.native.ts b/clients/client-accessanalyzer/runtimeConfig.native.ts index 977139ea8ccf0..27025d278a61a 100644 --- a/clients/client-accessanalyzer/runtimeConfig.native.ts +++ b/clients/client-accessanalyzer/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AccessAnalyzerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-accessanalyzer/runtimeConfig.ts b/clients/client-accessanalyzer/runtimeConfig.ts index fe6bac89cd3a2..11316e2e90531 100644 --- a/clients/client-accessanalyzer/runtimeConfig.ts +++ b/clients/client-accessanalyzer/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-acm-pca/ACMPCAClient.ts b/clients/client-acm-pca/ACMPCAClient.ts index 5e197d837534a..978832399643b 100644 --- a/clients/client-acm-pca/ACMPCAClient.ts +++ b/clients/client-acm-pca/ACMPCAClient.ts @@ -97,6 +97,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -107,6 +108,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -206,11 +208,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -252,6 +249,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ACMPCAClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -260,8 +263,8 @@ export type ACMPCAClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ACMPCAClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -269,8 +272,8 @@ export type ACMPCAClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * @@ -307,16 +310,16 @@ export class ACMPCAClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-acm-pca/runtimeConfig.browser.ts b/clients/client-acm-pca/runtimeConfig.browser.ts index 9b071e3e9dd57..a4bcf1ceb4241 100644 --- a/clients/client-acm-pca/runtimeConfig.browser.ts +++ b/clients/client-acm-pca/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-acm-pca/runtimeConfig.native.ts b/clients/client-acm-pca/runtimeConfig.native.ts index d103502caad3b..3bc3237efc3be 100644 --- a/clients/client-acm-pca/runtimeConfig.native.ts +++ b/clients/client-acm-pca/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ACMPCAClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-acm-pca/runtimeConfig.ts b/clients/client-acm-pca/runtimeConfig.ts index f7c71161f59e6..455c8822cf339 100644 --- a/clients/client-acm-pca/runtimeConfig.ts +++ b/clients/client-acm-pca/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-acm/ACMClient.ts b/clients/client-acm/ACMClient.ts index 1ba3fef53d5a4..c011c6492ab29 100644 --- a/clients/client-acm/ACMClient.ts +++ b/clients/client-acm/ACMClient.ts @@ -66,6 +66,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -76,6 +77,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -155,11 +157,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -201,6 +198,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ACMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -209,8 +212,8 @@ export type ACMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ACMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -218,8 +221,8 @@ export type ACMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Certificate Manager @@ -246,16 +249,16 @@ export class ACMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-acm/runtimeConfig.browser.ts b/clients/client-acm/runtimeConfig.browser.ts index 92c538fdd6816..bcefe6b8a7f9e 100644 --- a/clients/client-acm/runtimeConfig.browser.ts +++ b/clients/client-acm/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-acm/runtimeConfig.native.ts b/clients/client-acm/runtimeConfig.native.ts index df9a10ab63b65..3583aceeb6c15 100644 --- a/clients/client-acm/runtimeConfig.native.ts +++ b/clients/client-acm/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ACMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-acm/runtimeConfig.ts b/clients/client-acm/runtimeConfig.ts index b40f62b46c221..16efc30de391f 100644 --- a/clients/client-acm/runtimeConfig.ts +++ b/clients/client-acm/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-alexa-for-business/AlexaForBusinessClient.ts b/clients/client-alexa-for-business/AlexaForBusinessClient.ts index 038500f442bcc..61f74d02194ff 100644 --- a/clients/client-alexa-for-business/AlexaForBusinessClient.ts +++ b/clients/client-alexa-for-business/AlexaForBusinessClient.ts @@ -245,6 +245,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -255,6 +256,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -494,11 +496,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -540,6 +537,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AlexaForBusinessClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -548,8 +551,8 @@ export type AlexaForBusinessClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AlexaForBusinessClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -557,8 +560,8 @@ export type AlexaForBusinessClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Alexa for Business helps you use Alexa in your organization. Alexa for Business provides you with the tools @@ -587,16 +590,16 @@ export class AlexaForBusinessClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-alexa-for-business/runtimeConfig.browser.ts b/clients/client-alexa-for-business/runtimeConfig.browser.ts index 9b181024e2927..a2cff05b4fa5a 100644 --- a/clients/client-alexa-for-business/runtimeConfig.browser.ts +++ b/clients/client-alexa-for-business/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-alexa-for-business/runtimeConfig.native.ts b/clients/client-alexa-for-business/runtimeConfig.native.ts index 0a2c52c955f39..ad88f4b0f6fbb 100644 --- a/clients/client-alexa-for-business/runtimeConfig.native.ts +++ b/clients/client-alexa-for-business/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AlexaForBusinessClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-alexa-for-business/runtimeConfig.ts b/clients/client-alexa-for-business/runtimeConfig.ts index a7671434b4188..1f68c8b42ce44 100644 --- a/clients/client-alexa-for-business/runtimeConfig.ts +++ b/clients/client-alexa-for-business/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-amplify/AmplifyClient.ts b/clients/client-amplify/AmplifyClient.ts index c70758d5374bf..95e83395af6da 100644 --- a/clients/client-amplify/AmplifyClient.ts +++ b/clients/client-amplify/AmplifyClient.ts @@ -102,6 +102,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -112,6 +113,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -239,11 +241,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -285,6 +282,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AmplifyClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -293,8 +296,8 @@ export type AmplifyClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AmplifyClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -302,8 +305,8 @@ export type AmplifyClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amplify enables developers to develop and deploy cloud-powered mobile and web apps. @@ -330,16 +333,16 @@ export class AmplifyClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-amplify/runtimeConfig.browser.ts b/clients/client-amplify/runtimeConfig.browser.ts index 94d63be37d9d7..c949cd76810ab 100644 --- a/clients/client-amplify/runtimeConfig.browser.ts +++ b/clients/client-amplify/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-amplify/runtimeConfig.native.ts b/clients/client-amplify/runtimeConfig.native.ts index 67186c904256e..886468e2a6fe8 100644 --- a/clients/client-amplify/runtimeConfig.native.ts +++ b/clients/client-amplify/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AmplifyClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-amplify/runtimeConfig.ts b/clients/client-amplify/runtimeConfig.ts index 98bbb08b8ee35..8e12c10ac52f0 100644 --- a/clients/client-amplify/runtimeConfig.ts +++ b/clients/client-amplify/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-amplifybackend/AmplifyBackendClient.ts b/clients/client-amplifybackend/AmplifyBackendClient.ts index 57c1ba5c2479f..27763b2c4cddc 100644 --- a/clients/client-amplifybackend/AmplifyBackendClient.ts +++ b/clients/client-amplifybackend/AmplifyBackendClient.ts @@ -74,6 +74,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -84,6 +85,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -185,11 +187,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -231,6 +228,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AmplifyBackendClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -239,8 +242,8 @@ export type AmplifyBackendClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AmplifyBackendClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -248,8 +251,8 @@ export type AmplifyBackendClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Amplify Admin API

@@ -271,16 +274,16 @@ export class AmplifyBackendClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-amplifybackend/runtimeConfig.browser.ts b/clients/client-amplifybackend/runtimeConfig.browser.ts index 1ad28c41c63a0..8b63035791eba 100644 --- a/clients/client-amplifybackend/runtimeConfig.browser.ts +++ b/clients/client-amplifybackend/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-amplifybackend/runtimeConfig.native.ts b/clients/client-amplifybackend/runtimeConfig.native.ts index 56a11bbb199dd..f0be385fe8248 100644 --- a/clients/client-amplifybackend/runtimeConfig.native.ts +++ b/clients/client-amplifybackend/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AmplifyBackendClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-amplifybackend/runtimeConfig.ts b/clients/client-amplifybackend/runtimeConfig.ts index 8b2a934698efe..e83cbf1e5d96f 100644 --- a/clients/client-amplifybackend/runtimeConfig.ts +++ b/clients/client-amplifybackend/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-api-gateway/APIGatewayClient.ts b/clients/client-api-gateway/APIGatewayClient.ts index 0ca741da0c6de..f4a40d2befedf 100644 --- a/clients/client-api-gateway/APIGatewayClient.ts +++ b/clients/client-api-gateway/APIGatewayClient.ts @@ -264,6 +264,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -274,6 +275,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -567,11 +569,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -613,6 +610,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type APIGatewayClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -621,8 +624,8 @@ export type APIGatewayClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type APIGatewayClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -630,8 +633,8 @@ export type APIGatewayClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon API Gateway @@ -654,17 +657,17 @@ export class APIGatewayClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getAcceptHeaderPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-api-gateway/runtimeConfig.browser.ts b/clients/client-api-gateway/runtimeConfig.browser.ts index fd249324763eb..7400734f7dd8b 100644 --- a/clients/client-api-gateway/runtimeConfig.browser.ts +++ b/clients/client-api-gateway/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-api-gateway/runtimeConfig.native.ts b/clients/client-api-gateway/runtimeConfig.native.ts index 09bcef62e9075..b163cffadc3b1 100644 --- a/clients/client-api-gateway/runtimeConfig.native.ts +++ b/clients/client-api-gateway/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./APIGatewayClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-api-gateway/runtimeConfig.ts b/clients/client-api-gateway/runtimeConfig.ts index ab7c57f926a2a..e251975dfd375 100644 --- a/clients/client-api-gateway/runtimeConfig.ts +++ b/clients/client-api-gateway/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-apigatewaymanagementapi/ApiGatewayManagementApiClient.ts b/clients/client-apigatewaymanagementapi/ApiGatewayManagementApiClient.ts index f916a2e0b43fd..477b27084e8c4 100644 --- a/clients/client-apigatewaymanagementapi/ApiGatewayManagementApiClient.ts +++ b/clients/client-apigatewaymanagementapi/ApiGatewayManagementApiClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = DeleteConnectionCommandInput | GetConnectionCommandInput | PostToConnectionCommandInput; @@ -104,11 +106,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -150,6 +147,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ApiGatewayManagementApiClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -158,8 +161,8 @@ export type ApiGatewayManagementApiClientConfig = Partial<__SmithyConfiguration< EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ApiGatewayManagementApiClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -167,8 +170,8 @@ export type ApiGatewayManagementApiClientResolvedConfig = __SmithyResolvedConfig EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The Amazon API Gateway Management API allows you to directly manage runtime aspects of your deployed APIs. To use it, you must explicitly set the SDK's endpoint to point to the endpoint of your deployed API. The endpoint will be of the form https://{api-id}.execute-api.{region}.amazonaws.com/{stage}, or will be the endpoint corresponding to your API's custom domain and base path, if applicable.

@@ -190,16 +193,16 @@ export class ApiGatewayManagementApiClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-apigatewaymanagementapi/runtimeConfig.browser.ts b/clients/client-apigatewaymanagementapi/runtimeConfig.browser.ts index ee28d5c154cf4..495e2a35002d9 100644 --- a/clients/client-apigatewaymanagementapi/runtimeConfig.browser.ts +++ b/clients/client-apigatewaymanagementapi/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-apigatewaymanagementapi/runtimeConfig.native.ts b/clients/client-apigatewaymanagementapi/runtimeConfig.native.ts index 7230ad03c35ba..418428ceb61e7 100644 --- a/clients/client-apigatewaymanagementapi/runtimeConfig.native.ts +++ b/clients/client-apigatewaymanagementapi/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ApiGatewayManagementApiClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-apigatewaymanagementapi/runtimeConfig.ts b/clients/client-apigatewaymanagementapi/runtimeConfig.ts index feb00fe0763d1..332453d5bb21c 100644 --- a/clients/client-apigatewaymanagementapi/runtimeConfig.ts +++ b/clients/client-apigatewaymanagementapi/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-apigatewayv2/ApiGatewayV2Client.ts b/clients/client-apigatewayv2/ApiGatewayV2Client.ts index 1aced5bc712bb..7acc1d8b04a36 100644 --- a/clients/client-apigatewayv2/ApiGatewayV2Client.ts +++ b/clients/client-apigatewayv2/ApiGatewayV2Client.ts @@ -146,6 +146,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -156,6 +157,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -353,11 +355,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -399,6 +396,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ApiGatewayV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -407,8 +410,8 @@ export type ApiGatewayV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ApiGatewayV2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -416,8 +419,8 @@ export type ApiGatewayV2ClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon API Gateway V2

@@ -439,16 +442,16 @@ export class ApiGatewayV2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-apigatewayv2/runtimeConfig.browser.ts b/clients/client-apigatewayv2/runtimeConfig.browser.ts index b3ad587e97f7f..252cbaed9c536 100644 --- a/clients/client-apigatewayv2/runtimeConfig.browser.ts +++ b/clients/client-apigatewayv2/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-apigatewayv2/runtimeConfig.native.ts b/clients/client-apigatewayv2/runtimeConfig.native.ts index 01cb1a3346bea..4f4096e65edad 100644 --- a/clients/client-apigatewayv2/runtimeConfig.native.ts +++ b/clients/client-apigatewayv2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ApiGatewayV2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-apigatewayv2/runtimeConfig.ts b/clients/client-apigatewayv2/runtimeConfig.ts index d9a914fe7a49f..a598bbbb59b3f 100644 --- a/clients/client-apigatewayv2/runtimeConfig.ts +++ b/clients/client-apigatewayv2/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-app-mesh/AppMeshClient.ts b/clients/client-app-mesh/AppMeshClient.ts index b9fc0b6e18313..36fd67cc52abb 100644 --- a/clients/client-app-mesh/AppMeshClient.ts +++ b/clients/client-app-mesh/AppMeshClient.ts @@ -124,6 +124,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -134,6 +135,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -263,11 +265,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -309,6 +306,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AppMeshClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -317,8 +320,8 @@ export type AppMeshClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AppMeshClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -326,8 +329,8 @@ export type AppMeshClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS App Mesh is a service mesh based on the Envoy proxy that makes it easy to monitor and @@ -361,16 +364,16 @@ export class AppMeshClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-app-mesh/runtimeConfig.browser.ts b/clients/client-app-mesh/runtimeConfig.browser.ts index 828cbab883916..86c3bc604ead3 100644 --- a/clients/client-app-mesh/runtimeConfig.browser.ts +++ b/clients/client-app-mesh/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-app-mesh/runtimeConfig.native.ts b/clients/client-app-mesh/runtimeConfig.native.ts index 268b7f6eee3f6..4b9aaa11dd343 100644 --- a/clients/client-app-mesh/runtimeConfig.native.ts +++ b/clients/client-app-mesh/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AppMeshClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-app-mesh/runtimeConfig.ts b/clients/client-app-mesh/runtimeConfig.ts index 85c57aa16db8e..8ee5368a017ad 100644 --- a/clients/client-app-mesh/runtimeConfig.ts +++ b/clients/client-app-mesh/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-appconfig/AppConfigClient.ts b/clients/client-appconfig/AppConfigClient.ts index 8bf768cb61628..5300da19290c5 100644 --- a/clients/client-appconfig/AppConfigClient.ts +++ b/clients/client-appconfig/AppConfigClient.ts @@ -116,6 +116,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -126,6 +127,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -245,11 +247,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -291,6 +288,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AppConfigClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -299,8 +302,8 @@ export type AppConfigClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AppConfigClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -308,8 +311,8 @@ export type AppConfigClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS AppConfig @@ -379,16 +382,16 @@ export class AppConfigClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-appconfig/runtimeConfig.browser.ts b/clients/client-appconfig/runtimeConfig.browser.ts index 2cf27d1514fa7..70c3399964a3e 100644 --- a/clients/client-appconfig/runtimeConfig.browser.ts +++ b/clients/client-appconfig/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-appconfig/runtimeConfig.native.ts b/clients/client-appconfig/runtimeConfig.native.ts index af56e0576fd67..7437c5e8815b0 100644 --- a/clients/client-appconfig/runtimeConfig.native.ts +++ b/clients/client-appconfig/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AppConfigClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-appconfig/runtimeConfig.ts b/clients/client-appconfig/runtimeConfig.ts index 489ae088f3867..0eb9c14b61800 100644 --- a/clients/client-appconfig/runtimeConfig.ts +++ b/clients/client-appconfig/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-appflow/AppflowClient.ts b/clients/client-appflow/AppflowClient.ts index eeeec77bc817e..2968f827d7473 100644 --- a/clients/client-appflow/AppflowClient.ts +++ b/clients/client-appflow/AppflowClient.ts @@ -77,6 +77,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -87,6 +88,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -176,11 +178,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -222,6 +219,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AppflowClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -230,8 +233,8 @@ export type AppflowClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AppflowClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -239,8 +242,8 @@ export type AppflowClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Welcome to the Amazon AppFlow API reference. This guide is for developers who need detailed information about the Amazon AppFlow API operations, data types, and errors.

@@ -292,16 +295,16 @@ export class AppflowClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-appflow/runtimeConfig.browser.ts b/clients/client-appflow/runtimeConfig.browser.ts index 7ea6f6d852d17..07716d2d9cf81 100644 --- a/clients/client-appflow/runtimeConfig.browser.ts +++ b/clients/client-appflow/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-appflow/runtimeConfig.native.ts b/clients/client-appflow/runtimeConfig.native.ts index 42e5f2fe5fbe1..854e00b753671 100644 --- a/clients/client-appflow/runtimeConfig.native.ts +++ b/clients/client-appflow/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AppflowClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-appflow/runtimeConfig.ts b/clients/client-appflow/runtimeConfig.ts index 1a315f3cf68cb..af75cc10fb4f8 100644 --- a/clients/client-appflow/runtimeConfig.ts +++ b/clients/client-appflow/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-appintegrations/AppIntegrationsClient.ts b/clients/client-appintegrations/AppIntegrationsClient.ts index f9aa5a5b5da06..8703731fd5e9a 100644 --- a/clients/client-appintegrations/AppIntegrationsClient.ts +++ b/clients/client-appintegrations/AppIntegrationsClient.ts @@ -65,6 +65,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -75,6 +76,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -146,11 +148,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -192,6 +189,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AppIntegrationsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -200,8 +203,8 @@ export type AppIntegrationsClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AppIntegrationsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -209,8 +212,8 @@ export type AppIntegrationsClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The Amazon AppIntegrations APIs are in preview release and are subject to change.

@@ -235,16 +238,16 @@ export class AppIntegrationsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-appintegrations/runtimeConfig.browser.ts b/clients/client-appintegrations/runtimeConfig.browser.ts index f8911bb4e7304..bf3d02b583b09 100644 --- a/clients/client-appintegrations/runtimeConfig.browser.ts +++ b/clients/client-appintegrations/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-appintegrations/runtimeConfig.native.ts b/clients/client-appintegrations/runtimeConfig.native.ts index 9dddd1281d4e9..e54eac06d5bce 100644 --- a/clients/client-appintegrations/runtimeConfig.native.ts +++ b/clients/client-appintegrations/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AppIntegrationsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-appintegrations/runtimeConfig.ts b/clients/client-appintegrations/runtimeConfig.ts index facdeb033815a..c6154ae215b47 100644 --- a/clients/client-appintegrations/runtimeConfig.ts +++ b/clients/client-appintegrations/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-application-auto-scaling/ApplicationAutoScalingClient.ts b/clients/client-application-auto-scaling/ApplicationAutoScalingClient.ts index 5fd6341b8b824..8a35c613ee0bf 100644 --- a/clients/client-application-auto-scaling/ApplicationAutoScalingClient.ts +++ b/clients/client-application-auto-scaling/ApplicationAutoScalingClient.ts @@ -69,6 +69,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -79,6 +80,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -152,11 +154,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -198,6 +195,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ApplicationAutoScalingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -206,8 +209,8 @@ export type ApplicationAutoScalingClientConfig = Partial<__SmithyConfiguration<_ EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ApplicationAutoScalingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -215,8 +218,8 @@ export type ApplicationAutoScalingClientResolvedConfig = __SmithyResolvedConfigu EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

With Application Auto Scaling, you can configure automatic scaling for the following @@ -305,16 +308,16 @@ export class ApplicationAutoScalingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-application-auto-scaling/runtimeConfig.browser.ts b/clients/client-application-auto-scaling/runtimeConfig.browser.ts index ba86a5f99019d..672c67f8c32f6 100644 --- a/clients/client-application-auto-scaling/runtimeConfig.browser.ts +++ b/clients/client-application-auto-scaling/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-application-auto-scaling/runtimeConfig.native.ts b/clients/client-application-auto-scaling/runtimeConfig.native.ts index 13d98e31c487f..e649ea552238f 100644 --- a/clients/client-application-auto-scaling/runtimeConfig.native.ts +++ b/clients/client-application-auto-scaling/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ApplicationAutoScalingClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-application-auto-scaling/runtimeConfig.ts b/clients/client-application-auto-scaling/runtimeConfig.ts index 6dfa2648669f2..27a1cb9b71c5c 100644 --- a/clients/client-application-auto-scaling/runtimeConfig.ts +++ b/clients/client-application-auto-scaling/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-application-discovery-service/ApplicationDiscoveryServiceClient.ts b/clients/client-application-discovery-service/ApplicationDiscoveryServiceClient.ts index 39bc42bae53c2..603270fbc9b66 100644 --- a/clients/client-application-discovery-service/ApplicationDiscoveryServiceClient.ts +++ b/clients/client-application-discovery-service/ApplicationDiscoveryServiceClient.ts @@ -105,6 +105,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -115,6 +116,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -218,11 +220,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -264,6 +261,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ApplicationDiscoveryServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -272,8 +275,8 @@ export type ApplicationDiscoveryServiceClientConfig = Partial<__SmithyConfigurat EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ApplicationDiscoveryServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -281,8 +284,8 @@ export type ApplicationDiscoveryServiceClientResolvedConfig = __SmithyResolvedCo EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Application Discovery Service @@ -430,16 +433,16 @@ export class ApplicationDiscoveryServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-application-discovery-service/runtimeConfig.browser.ts b/clients/client-application-discovery-service/runtimeConfig.browser.ts index ce53f6ccf93d8..62063888123c2 100644 --- a/clients/client-application-discovery-service/runtimeConfig.browser.ts +++ b/clients/client-application-discovery-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-application-discovery-service/runtimeConfig.native.ts b/clients/client-application-discovery-service/runtimeConfig.native.ts index 476ab3fc9198f..f7f13bac556d1 100644 --- a/clients/client-application-discovery-service/runtimeConfig.native.ts +++ b/clients/client-application-discovery-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ApplicationDiscoveryServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-application-discovery-service/runtimeConfig.ts b/clients/client-application-discovery-service/runtimeConfig.ts index 80c7f1f04d63a..5b066dca02311 100644 --- a/clients/client-application-discovery-service/runtimeConfig.ts +++ b/clients/client-application-discovery-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-application-insights/ApplicationInsightsClient.ts b/clients/client-application-insights/ApplicationInsightsClient.ts index bfbf8a8e32601..3fa70ddcdd7ce 100644 --- a/clients/client-application-insights/ApplicationInsightsClient.ts +++ b/clients/client-application-insights/ApplicationInsightsClient.ts @@ -86,6 +86,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -96,6 +97,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -203,11 +205,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -249,6 +246,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ApplicationInsightsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -257,8 +260,8 @@ export type ApplicationInsightsClientConfig = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ApplicationInsightsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -266,8 +269,8 @@ export type ApplicationInsightsClientResolvedConfig = __SmithyResolvedConfigurat EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon CloudWatch Application Insights @@ -301,16 +304,16 @@ export class ApplicationInsightsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-application-insights/runtimeConfig.browser.ts b/clients/client-application-insights/runtimeConfig.browser.ts index 42308c08870d7..49e66e814f903 100644 --- a/clients/client-application-insights/runtimeConfig.browser.ts +++ b/clients/client-application-insights/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-application-insights/runtimeConfig.native.ts b/clients/client-application-insights/runtimeConfig.native.ts index 6b4315ecaf555..a5e50d48a70d5 100644 --- a/clients/client-application-insights/runtimeConfig.native.ts +++ b/clients/client-application-insights/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ApplicationInsightsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-application-insights/runtimeConfig.ts b/clients/client-application-insights/runtimeConfig.ts index 3e10b86e9ddfb..93d515dbde58b 100644 --- a/clients/client-application-insights/runtimeConfig.ts +++ b/clients/client-application-insights/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-appstream/AppStreamClient.ts b/clients/client-appstream/AppStreamClient.ts index 18da3ac1171a6..ecb49a5b2d2b3 100644 --- a/clients/client-appstream/AppStreamClient.ts +++ b/clients/client-appstream/AppStreamClient.ts @@ -136,6 +136,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -146,6 +147,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -293,11 +295,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -339,6 +336,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AppStreamClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -347,8 +350,8 @@ export type AppStreamClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AppStreamClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -356,8 +359,8 @@ export type AppStreamClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon AppStream 2.0 @@ -399,16 +402,16 @@ export class AppStreamClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-appstream/runtimeConfig.browser.ts b/clients/client-appstream/runtimeConfig.browser.ts index 800136672f53e..61eb82131b712 100644 --- a/clients/client-appstream/runtimeConfig.browser.ts +++ b/clients/client-appstream/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-appstream/runtimeConfig.native.ts b/clients/client-appstream/runtimeConfig.native.ts index c2b730acd6ce1..c466709e8de18 100644 --- a/clients/client-appstream/runtimeConfig.native.ts +++ b/clients/client-appstream/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AppStreamClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-appstream/runtimeConfig.ts b/clients/client-appstream/runtimeConfig.ts index b3ab095188b32..c26f1084d8326 100644 --- a/clients/client-appstream/runtimeConfig.ts +++ b/clients/client-appstream/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-appsync/AppSyncClient.ts b/clients/client-appsync/AppSyncClient.ts index d649b1522cbf1..c74656d06fcfa 100644 --- a/clients/client-appsync/AppSyncClient.ts +++ b/clients/client-appsync/AppSyncClient.ts @@ -91,6 +91,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -101,6 +102,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -236,11 +238,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -282,6 +279,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AppSyncClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -290,8 +293,8 @@ export type AppSyncClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AppSyncClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -299,8 +302,8 @@ export type AppSyncClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS AppSync provides API actions for creating and interacting with data sources using @@ -323,16 +326,16 @@ export class AppSyncClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-appsync/runtimeConfig.browser.ts b/clients/client-appsync/runtimeConfig.browser.ts index 134b4d6e52519..80ceb4f5d2f43 100644 --- a/clients/client-appsync/runtimeConfig.browser.ts +++ b/clients/client-appsync/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-appsync/runtimeConfig.native.ts b/clients/client-appsync/runtimeConfig.native.ts index 8281561ead585..05128c0c244df 100644 --- a/clients/client-appsync/runtimeConfig.native.ts +++ b/clients/client-appsync/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AppSyncClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-appsync/runtimeConfig.ts b/clients/client-appsync/runtimeConfig.ts index f8163806f57de..eec7cf44534a9 100644 --- a/clients/client-appsync/runtimeConfig.ts +++ b/clients/client-appsync/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-athena/AthenaClient.ts b/clients/client-athena/AthenaClient.ts index cd10b0250f8c2..6dc66b2093779 100644 --- a/clients/client-athena/AthenaClient.ts +++ b/clients/client-athena/AthenaClient.ts @@ -75,6 +75,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -85,6 +86,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -194,11 +196,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -240,6 +237,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AthenaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -248,8 +251,8 @@ export type AthenaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AthenaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -257,8 +260,8 @@ export type AthenaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Athena is an interactive query service that lets you use standard SQL to @@ -292,16 +295,16 @@ export class AthenaClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-athena/runtimeConfig.browser.ts b/clients/client-athena/runtimeConfig.browser.ts index 688953830511d..41065604cf9a7 100644 --- a/clients/client-athena/runtimeConfig.browser.ts +++ b/clients/client-athena/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-athena/runtimeConfig.native.ts b/clients/client-athena/runtimeConfig.native.ts index 57a7464b2c07f..1df4f8e427f82 100644 --- a/clients/client-athena/runtimeConfig.native.ts +++ b/clients/client-athena/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AthenaClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-athena/runtimeConfig.ts b/clients/client-athena/runtimeConfig.ts index 2970ab64cd811..79f8cc940682f 100644 --- a/clients/client-athena/runtimeConfig.ts +++ b/clients/client-athena/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-auditmanager/AuditManagerClient.ts b/clients/client-auditmanager/AuditManagerClient.ts index edacc451bb473..5d8d4b2ef77e1 100644 --- a/clients/client-auditmanager/AuditManagerClient.ts +++ b/clients/client-auditmanager/AuditManagerClient.ts @@ -170,6 +170,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -180,6 +181,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -335,11 +337,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -381,6 +378,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AuditManagerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -389,8 +392,8 @@ export type AuditManagerClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AuditManagerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -398,8 +401,8 @@ export type AuditManagerClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Welcome to the AWS Audit Manager API reference. This guide is for developers who need detailed information about the AWS Audit Manager API operations, data types, and errors.

@@ -451,16 +454,16 @@ export class AuditManagerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-auditmanager/runtimeConfig.browser.ts b/clients/client-auditmanager/runtimeConfig.browser.ts index afb410dded2d3..27b62c42ae955 100644 --- a/clients/client-auditmanager/runtimeConfig.browser.ts +++ b/clients/client-auditmanager/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-auditmanager/runtimeConfig.native.ts b/clients/client-auditmanager/runtimeConfig.native.ts index 4685edfe7fe9e..d227113c6e503 100644 --- a/clients/client-auditmanager/runtimeConfig.native.ts +++ b/clients/client-auditmanager/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AuditManagerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-auditmanager/runtimeConfig.ts b/clients/client-auditmanager/runtimeConfig.ts index e562162bb8bfc..bbdac9e098531 100644 --- a/clients/client-auditmanager/runtimeConfig.ts +++ b/clients/client-auditmanager/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-auto-scaling-plans/AutoScalingPlansClient.ts b/clients/client-auto-scaling-plans/AutoScalingPlansClient.ts index 3c9aa934fa14e..30e5c493f5cb7 100644 --- a/clients/client-auto-scaling-plans/AutoScalingPlansClient.ts +++ b/clients/client-auto-scaling-plans/AutoScalingPlansClient.ts @@ -50,6 +50,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -60,6 +61,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -125,11 +127,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -171,6 +168,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AutoScalingPlansClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -179,8 +182,8 @@ export type AutoScalingPlansClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AutoScalingPlansClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -188,8 +191,8 @@ export type AutoScalingPlansClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Auto Scaling @@ -218,16 +221,16 @@ export class AutoScalingPlansClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-auto-scaling-plans/runtimeConfig.browser.ts b/clients/client-auto-scaling-plans/runtimeConfig.browser.ts index e186de94b36ae..b8f212f413728 100644 --- a/clients/client-auto-scaling-plans/runtimeConfig.browser.ts +++ b/clients/client-auto-scaling-plans/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-auto-scaling-plans/runtimeConfig.native.ts b/clients/client-auto-scaling-plans/runtimeConfig.native.ts index ec8c0f0136d32..ffb1458f9d347 100644 --- a/clients/client-auto-scaling-plans/runtimeConfig.native.ts +++ b/clients/client-auto-scaling-plans/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AutoScalingPlansClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-auto-scaling-plans/runtimeConfig.ts b/clients/client-auto-scaling-plans/runtimeConfig.ts index 7d1e7564adeb6..08b2bae415357 100644 --- a/clients/client-auto-scaling-plans/runtimeConfig.ts +++ b/clients/client-auto-scaling-plans/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-auto-scaling/AutoScalingClient.ts b/clients/client-auto-scaling/AutoScalingClient.ts index a91d682fb91f6..3baac786b8aaf 100644 --- a/clients/client-auto-scaling/AutoScalingClient.ts +++ b/clients/client-auto-scaling/AutoScalingClient.ts @@ -215,6 +215,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -225,6 +226,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -392,11 +394,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -438,6 +435,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AutoScalingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -446,8 +449,8 @@ export type AutoScalingClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AutoScalingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -455,8 +458,8 @@ export type AutoScalingClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon EC2 Auto Scaling @@ -484,16 +487,16 @@ export class AutoScalingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-auto-scaling/runtimeConfig.browser.ts b/clients/client-auto-scaling/runtimeConfig.browser.ts index fcfd7609814b8..14b11b9884082 100644 --- a/clients/client-auto-scaling/runtimeConfig.browser.ts +++ b/clients/client-auto-scaling/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-auto-scaling/runtimeConfig.native.ts b/clients/client-auto-scaling/runtimeConfig.native.ts index 0b3e0d6849ef4..fd94fcca939c5 100644 --- a/clients/client-auto-scaling/runtimeConfig.native.ts +++ b/clients/client-auto-scaling/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AutoScalingClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-auto-scaling/runtimeConfig.ts b/clients/client-auto-scaling/runtimeConfig.ts index 0ead5f163d7d4..7ba2b348b8c79 100644 --- a/clients/client-auto-scaling/runtimeConfig.ts +++ b/clients/client-auto-scaling/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-backup/BackupClient.ts b/clients/client-backup/BackupClient.ts index 7a7fbfd06fb78..41afd4606d3b2 100644 --- a/clients/client-backup/BackupClient.ts +++ b/clients/client-backup/BackupClient.ts @@ -169,6 +169,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -179,6 +180,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -332,11 +334,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -378,6 +375,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type BackupClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -386,8 +389,8 @@ export type BackupClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type BackupClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -395,8 +398,8 @@ export type BackupClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Backup @@ -421,16 +424,16 @@ export class BackupClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-backup/runtimeConfig.browser.ts b/clients/client-backup/runtimeConfig.browser.ts index 20fc2f3c06716..3c04da688cc2f 100644 --- a/clients/client-backup/runtimeConfig.browser.ts +++ b/clients/client-backup/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-backup/runtimeConfig.native.ts b/clients/client-backup/runtimeConfig.native.ts index bfd353d687195..4371a7a73ebbe 100644 --- a/clients/client-backup/runtimeConfig.native.ts +++ b/clients/client-backup/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./BackupClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-backup/runtimeConfig.ts b/clients/client-backup/runtimeConfig.ts index 6fcb94473f6df..1201043911d65 100644 --- a/clients/client-backup/runtimeConfig.ts +++ b/clients/client-backup/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-batch/BatchClient.ts b/clients/client-batch/BatchClient.ts index 691a2bc37497b..961271802dfd7 100644 --- a/clients/client-batch/BatchClient.ts +++ b/clients/client-batch/BatchClient.ts @@ -78,6 +78,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -88,6 +89,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -179,11 +181,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -225,6 +222,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type BatchClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -233,8 +236,8 @@ export type BatchClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type BatchClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -242,8 +245,8 @@ export type BatchClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Using AWS Batch, you can run batch computing workloads on the AWS Cloud. Batch computing is a common means for @@ -274,16 +277,16 @@ export class BatchClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-batch/runtimeConfig.browser.ts b/clients/client-batch/runtimeConfig.browser.ts index 8099a7dea94bb..6452870bc5d03 100644 --- a/clients/client-batch/runtimeConfig.browser.ts +++ b/clients/client-batch/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-batch/runtimeConfig.native.ts b/clients/client-batch/runtimeConfig.native.ts index 2c6f27b10bf30..d53318dbf968e 100644 --- a/clients/client-batch/runtimeConfig.native.ts +++ b/clients/client-batch/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./BatchClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-batch/runtimeConfig.ts b/clients/client-batch/runtimeConfig.ts index fd3d7c489a8af..923dc4cb2cb3f 100644 --- a/clients/client-batch/runtimeConfig.ts +++ b/clients/client-batch/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-braket/BraketClient.ts b/clients/client-braket/BraketClient.ts index 2e7d2a5a2ad4b..65de29601b452 100644 --- a/clients/client-braket/BraketClient.ts +++ b/clients/client-braket/BraketClient.ts @@ -41,6 +41,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -51,6 +52,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -116,11 +118,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -162,6 +159,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type BraketClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -170,8 +173,8 @@ export type BraketClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type BraketClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -179,8 +182,8 @@ export type BraketClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The Amazon Braket API Reference provides information about the operations and structures supported in Amazon Braket.

@@ -202,16 +205,16 @@ export class BraketClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-braket/runtimeConfig.browser.ts b/clients/client-braket/runtimeConfig.browser.ts index c2dc763f049bd..d484004a6a5a6 100644 --- a/clients/client-braket/runtimeConfig.browser.ts +++ b/clients/client-braket/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-braket/runtimeConfig.native.ts b/clients/client-braket/runtimeConfig.native.ts index f10724dc05f05..e8d73bb9e6243 100644 --- a/clients/client-braket/runtimeConfig.native.ts +++ b/clients/client-braket/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./BraketClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-braket/runtimeConfig.ts b/clients/client-braket/runtimeConfig.ts index d97bd40c278dd..eb4cbe3e144bb 100644 --- a/clients/client-braket/runtimeConfig.ts +++ b/clients/client-braket/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-budgets/BudgetsClient.ts b/clients/client-budgets/BudgetsClient.ts index d454cd98094b5..ff6c65bdff75e 100644 --- a/clients/client-budgets/BudgetsClient.ts +++ b/clients/client-budgets/BudgetsClient.ts @@ -81,6 +81,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -91,6 +92,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -188,11 +190,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -234,6 +231,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type BudgetsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -242,8 +245,8 @@ export type BudgetsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type BudgetsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -251,8 +254,8 @@ export type BudgetsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The AWS Budgets API enables you to use AWS Budgets to plan your service usage, service costs, and instance reservations. The API reference provides descriptions, syntax, and usage examples for each of the actions and data types for AWS Budgets.

@@ -316,16 +319,16 @@ export class BudgetsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-budgets/runtimeConfig.browser.ts b/clients/client-budgets/runtimeConfig.browser.ts index 28528ee7c7b2f..62aeae2b5d24c 100644 --- a/clients/client-budgets/runtimeConfig.browser.ts +++ b/clients/client-budgets/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-budgets/runtimeConfig.native.ts b/clients/client-budgets/runtimeConfig.native.ts index 8f5eeae7675c8..3278370473d9f 100644 --- a/clients/client-budgets/runtimeConfig.native.ts +++ b/clients/client-budgets/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./BudgetsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-budgets/runtimeConfig.ts b/clients/client-budgets/runtimeConfig.ts index 14782fb1ba9a3..569fa37dce2e2 100644 --- a/clients/client-budgets/runtimeConfig.ts +++ b/clients/client-budgets/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-chime/ChimeClient.ts b/clients/client-chime/ChimeClient.ts index 2f185513876b9..52afda6689ad8 100644 --- a/clients/client-chime/ChimeClient.ts +++ b/clients/client-chime/ChimeClient.ts @@ -531,6 +531,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -541,6 +542,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -956,11 +958,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -1002,6 +999,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ChimeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -1010,8 +1013,8 @@ export type ChimeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ChimeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -1019,8 +1022,8 @@ export type ChimeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The Amazon Chime API (application programming interface) is designed for developers to @@ -1080,16 +1083,16 @@ export class ChimeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-chime/runtimeConfig.browser.ts b/clients/client-chime/runtimeConfig.browser.ts index 63562750f1b96..ad19e700cd2d4 100644 --- a/clients/client-chime/runtimeConfig.browser.ts +++ b/clients/client-chime/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-chime/runtimeConfig.native.ts b/clients/client-chime/runtimeConfig.native.ts index f4841fdb69c7b..f0316d22048a7 100644 --- a/clients/client-chime/runtimeConfig.native.ts +++ b/clients/client-chime/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ChimeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-chime/runtimeConfig.ts b/clients/client-chime/runtimeConfig.ts index fadd77f299b39..81cdfc0c8bae7 100644 --- a/clients/client-chime/runtimeConfig.ts +++ b/clients/client-chime/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloud9/Cloud9Client.ts b/clients/client-cloud9/Cloud9Client.ts index 7ec692732ccfa..722393cf52a6f 100644 --- a/clients/client-cloud9/Cloud9Client.ts +++ b/clients/client-cloud9/Cloud9Client.ts @@ -72,6 +72,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -82,6 +83,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -161,11 +163,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -207,6 +204,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type Cloud9ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -215,8 +218,8 @@ export type Cloud9ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type Cloud9ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -224,8 +227,8 @@ export type Cloud9ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Cloud9 @@ -304,16 +307,16 @@ export class Cloud9Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloud9/runtimeConfig.browser.ts b/clients/client-cloud9/runtimeConfig.browser.ts index 6bd17f48efdc8..ccce50f41d0af 100644 --- a/clients/client-cloud9/runtimeConfig.browser.ts +++ b/clients/client-cloud9/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloud9/runtimeConfig.native.ts b/clients/client-cloud9/runtimeConfig.native.ts index 0991da279ce75..ef11a033b5066 100644 --- a/clients/client-cloud9/runtimeConfig.native.ts +++ b/clients/client-cloud9/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./Cloud9Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloud9/runtimeConfig.ts b/clients/client-cloud9/runtimeConfig.ts index 2287cb2d4e26e..0ffa3ba946f1a 100644 --- a/clients/client-cloud9/runtimeConfig.ts +++ b/clients/client-cloud9/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-clouddirectory/CloudDirectoryClient.ts b/clients/client-clouddirectory/CloudDirectoryClient.ts index 9eac936b7b7d4..033bce269a8bc 100644 --- a/clients/client-clouddirectory/CloudDirectoryClient.ts +++ b/clients/client-clouddirectory/CloudDirectoryClient.ts @@ -179,6 +179,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -189,6 +190,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -374,11 +376,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -420,6 +417,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudDirectoryClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -428,8 +431,8 @@ export type CloudDirectoryClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudDirectoryClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -437,8 +440,8 @@ export type CloudDirectoryClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Cloud Directory @@ -465,16 +468,16 @@ export class CloudDirectoryClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-clouddirectory/runtimeConfig.browser.ts b/clients/client-clouddirectory/runtimeConfig.browser.ts index 784991fb10fd1..f1329da68e89c 100644 --- a/clients/client-clouddirectory/runtimeConfig.browser.ts +++ b/clients/client-clouddirectory/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-clouddirectory/runtimeConfig.native.ts b/clients/client-clouddirectory/runtimeConfig.native.ts index d581d4dbda97a..df92245a81875 100644 --- a/clients/client-clouddirectory/runtimeConfig.native.ts +++ b/clients/client-clouddirectory/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudDirectoryClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-clouddirectory/runtimeConfig.ts b/clients/client-clouddirectory/runtimeConfig.ts index 165c823c950f1..32a7732687bba 100644 --- a/clients/client-clouddirectory/runtimeConfig.ts +++ b/clients/client-clouddirectory/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudformation/CloudFormationClient.ts b/clients/client-cloudformation/CloudFormationClient.ts index 29d94f6946c38..013038aaca887 100644 --- a/clients/client-cloudformation/CloudFormationClient.ts +++ b/clients/client-cloudformation/CloudFormationClient.ts @@ -159,6 +159,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -169,6 +170,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -332,11 +334,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -378,6 +375,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudFormationClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -386,8 +389,8 @@ export type CloudFormationClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudFormationClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -395,8 +398,8 @@ export type CloudFormationClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CloudFormation @@ -432,16 +435,16 @@ export class CloudFormationClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudformation/runtimeConfig.browser.ts b/clients/client-cloudformation/runtimeConfig.browser.ts index 2608f64837d93..49bb84829d39e 100644 --- a/clients/client-cloudformation/runtimeConfig.browser.ts +++ b/clients/client-cloudformation/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudformation/runtimeConfig.native.ts b/clients/client-cloudformation/runtimeConfig.native.ts index 061a5f34e3469..813fdb72926bd 100644 --- a/clients/client-cloudformation/runtimeConfig.native.ts +++ b/clients/client-cloudformation/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudFormationClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudformation/runtimeConfig.ts b/clients/client-cloudformation/runtimeConfig.ts index 6a76dc14bd67a..328cda274e524 100644 --- a/clients/client-cloudformation/runtimeConfig.ts +++ b/clients/client-cloudformation/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudfront/CloudFrontClient.ts b/clients/client-cloudfront/CloudFrontClient.ts index c4439a9ee3e15..cda5c5f13b1de 100644 --- a/clients/client-cloudfront/CloudFrontClient.ts +++ b/clients/client-cloudfront/CloudFrontClient.ts @@ -254,6 +254,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -264,6 +265,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -467,11 +469,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -513,6 +510,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudFrontClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -521,8 +524,8 @@ export type CloudFrontClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudFrontClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -530,8 +533,8 @@ export type CloudFrontClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon CloudFront @@ -555,16 +558,16 @@ export class CloudFrontClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudfront/runtimeConfig.browser.ts b/clients/client-cloudfront/runtimeConfig.browser.ts index 9229b4403ae72..d55467186b683 100644 --- a/clients/client-cloudfront/runtimeConfig.browser.ts +++ b/clients/client-cloudfront/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudfront/runtimeConfig.native.ts b/clients/client-cloudfront/runtimeConfig.native.ts index 9bc6666c384a5..efa94494b6f47 100644 --- a/clients/client-cloudfront/runtimeConfig.native.ts +++ b/clients/client-cloudfront/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudFrontClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudfront/runtimeConfig.ts b/clients/client-cloudfront/runtimeConfig.ts index 576ce1f413bac..a7f3f1aee5d3d 100644 --- a/clients/client-cloudfront/runtimeConfig.ts +++ b/clients/client-cloudfront/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudhsm-v2/CloudHSMV2Client.ts b/clients/client-cloudhsm-v2/CloudHSMV2Client.ts index 08678390b7c63..f48b07f666cf2 100644 --- a/clients/client-cloudhsm-v2/CloudHSMV2Client.ts +++ b/clients/client-cloudhsm-v2/CloudHSMV2Client.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -146,11 +148,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -192,6 +189,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudHSMV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -200,8 +203,8 @@ export type CloudHSMV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudHSMV2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -209,8 +212,8 @@ export type CloudHSMV2ClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

For more information about AWS CloudHSM, see AWS CloudHSM and the AWS @@ -233,16 +236,16 @@ export class CloudHSMV2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudhsm-v2/runtimeConfig.browser.ts b/clients/client-cloudhsm-v2/runtimeConfig.browser.ts index c1d051d6d1f86..144968a4090cf 100644 --- a/clients/client-cloudhsm-v2/runtimeConfig.browser.ts +++ b/clients/client-cloudhsm-v2/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudhsm-v2/runtimeConfig.native.ts b/clients/client-cloudhsm-v2/runtimeConfig.native.ts index de306dbe83369..cb4541187049d 100644 --- a/clients/client-cloudhsm-v2/runtimeConfig.native.ts +++ b/clients/client-cloudhsm-v2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudHSMV2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudhsm-v2/runtimeConfig.ts b/clients/client-cloudhsm-v2/runtimeConfig.ts index 58ad9e65a94e5..944c365a6e507 100644 --- a/clients/client-cloudhsm-v2/runtimeConfig.ts +++ b/clients/client-cloudhsm-v2/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudhsm/CloudHSMClient.ts b/clients/client-cloudhsm/CloudHSMClient.ts index dfdd061ee05f2..ffabd4be6ba42 100644 --- a/clients/client-cloudhsm/CloudHSMClient.ts +++ b/clients/client-cloudhsm/CloudHSMClient.ts @@ -61,6 +61,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -71,6 +72,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -164,11 +166,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -210,6 +207,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudHSMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -218,8 +221,8 @@ export type CloudHSMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudHSMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -227,8 +230,8 @@ export type CloudHSMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CloudHSM Service @@ -260,16 +263,16 @@ export class CloudHSMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudhsm/runtimeConfig.browser.ts b/clients/client-cloudhsm/runtimeConfig.browser.ts index d55671208cc6a..3bb7bda68b8b2 100644 --- a/clients/client-cloudhsm/runtimeConfig.browser.ts +++ b/clients/client-cloudhsm/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudhsm/runtimeConfig.native.ts b/clients/client-cloudhsm/runtimeConfig.native.ts index 6f9ef25a258f0..522df75579378 100644 --- a/clients/client-cloudhsm/runtimeConfig.native.ts +++ b/clients/client-cloudhsm/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudHSMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudhsm/runtimeConfig.ts b/clients/client-cloudhsm/runtimeConfig.ts index 2d4541c9b76ac..caba4ae7bdb7c 100644 --- a/clients/client-cloudhsm/runtimeConfig.ts +++ b/clients/client-cloudhsm/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudsearch-domain/CloudSearchDomainClient.ts b/clients/client-cloudsearch-domain/CloudSearchDomainClient.ts index 9e9d7c088a941..d2020900ead8b 100644 --- a/clients/client-cloudsearch-domain/CloudSearchDomainClient.ts +++ b/clients/client-cloudsearch-domain/CloudSearchDomainClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = SearchCommandInput | SuggestCommandInput | UploadDocumentsCommandInput; @@ -101,11 +103,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -147,6 +144,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudSearchDomainClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -155,8 +158,8 @@ export type CloudSearchDomainClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudSearchDomainClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -164,8 +167,8 @@ export type CloudSearchDomainClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

You use the AmazonCloudSearch2013 API to upload documents to a search domain and search those documents.

@@ -190,16 +193,16 @@ export class CloudSearchDomainClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudsearch-domain/runtimeConfig.browser.ts b/clients/client-cloudsearch-domain/runtimeConfig.browser.ts index b3e8f0ee43373..2694787f9e6b7 100644 --- a/clients/client-cloudsearch-domain/runtimeConfig.browser.ts +++ b/clients/client-cloudsearch-domain/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudsearch-domain/runtimeConfig.native.ts b/clients/client-cloudsearch-domain/runtimeConfig.native.ts index 8494fa28e0352..c6bbd7f137e34 100644 --- a/clients/client-cloudsearch-domain/runtimeConfig.native.ts +++ b/clients/client-cloudsearch-domain/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudSearchDomainClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudsearch-domain/runtimeConfig.ts b/clients/client-cloudsearch-domain/runtimeConfig.ts index 7ccb0e83414d9..5bcf87522cb07 100644 --- a/clients/client-cloudsearch-domain/runtimeConfig.ts +++ b/clients/client-cloudsearch-domain/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudsearch/CloudSearchClient.ts b/clients/client-cloudsearch/CloudSearchClient.ts index 88c84a97c80c0..4b1782992ac87 100644 --- a/clients/client-cloudsearch/CloudSearchClient.ts +++ b/clients/client-cloudsearch/CloudSearchClient.ts @@ -100,6 +100,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -110,6 +111,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -215,11 +217,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -261,6 +258,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudSearchClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -269,8 +272,8 @@ export type CloudSearchClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudSearchClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -278,8 +281,8 @@ export type CloudSearchClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon CloudSearch Configuration Service @@ -307,16 +310,16 @@ export class CloudSearchClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudsearch/runtimeConfig.browser.ts b/clients/client-cloudsearch/runtimeConfig.browser.ts index 3f83cfbfa4280..f2889ae257311 100644 --- a/clients/client-cloudsearch/runtimeConfig.browser.ts +++ b/clients/client-cloudsearch/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudsearch/runtimeConfig.native.ts b/clients/client-cloudsearch/runtimeConfig.native.ts index 0e1972d5cffd2..f6d8caa780a2a 100644 --- a/clients/client-cloudsearch/runtimeConfig.native.ts +++ b/clients/client-cloudsearch/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudSearchClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudsearch/runtimeConfig.ts b/clients/client-cloudsearch/runtimeConfig.ts index 5a461c56038a2..542ffe9d685ae 100644 --- a/clients/client-cloudsearch/runtimeConfig.ts +++ b/clients/client-cloudsearch/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudtrail/CloudTrailClient.ts b/clients/client-cloudtrail/CloudTrailClient.ts index 74471dbb097db..71ba8546ca124 100644 --- a/clients/client-cloudtrail/CloudTrailClient.ts +++ b/clients/client-cloudtrail/CloudTrailClient.ts @@ -59,6 +59,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -69,6 +70,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -158,11 +160,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -204,6 +201,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudTrailClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -212,8 +215,8 @@ export type CloudTrailClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudTrailClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -221,8 +224,8 @@ export type CloudTrailClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CloudTrail @@ -258,16 +261,16 @@ export class CloudTrailClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudtrail/runtimeConfig.browser.ts b/clients/client-cloudtrail/runtimeConfig.browser.ts index ea7b936f2eb70..2c16e643a3304 100644 --- a/clients/client-cloudtrail/runtimeConfig.browser.ts +++ b/clients/client-cloudtrail/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudtrail/runtimeConfig.native.ts b/clients/client-cloudtrail/runtimeConfig.native.ts index b16ddb69ae2a8..d1c8d93bc36b1 100644 --- a/clients/client-cloudtrail/runtimeConfig.native.ts +++ b/clients/client-cloudtrail/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudTrailClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudtrail/runtimeConfig.ts b/clients/client-cloudtrail/runtimeConfig.ts index 8164591d03169..4d9070eba55eb 100644 --- a/clients/client-cloudtrail/runtimeConfig.ts +++ b/clients/client-cloudtrail/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudwatch-events/CloudWatchEventsClient.ts b/clients/client-cloudwatch-events/CloudWatchEventsClient.ts index aa8d15f8bd01b..671413d2de51f 100644 --- a/clients/client-cloudwatch-events/CloudWatchEventsClient.ts +++ b/clients/client-cloudwatch-events/CloudWatchEventsClient.ts @@ -105,6 +105,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -115,6 +116,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -248,11 +250,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -294,6 +291,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudWatchEventsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -302,8 +305,8 @@ export type CloudWatchEventsClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudWatchEventsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -311,8 +314,8 @@ export type CloudWatchEventsClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon EventBridge helps you to respond to state changes in your AWS resources. @@ -355,16 +358,16 @@ export class CloudWatchEventsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudwatch-events/runtimeConfig.browser.ts b/clients/client-cloudwatch-events/runtimeConfig.browser.ts index 396c11b774255..5332bdc0a9f42 100644 --- a/clients/client-cloudwatch-events/runtimeConfig.browser.ts +++ b/clients/client-cloudwatch-events/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudwatch-events/runtimeConfig.native.ts b/clients/client-cloudwatch-events/runtimeConfig.native.ts index e042819f13241..e67184f838927 100644 --- a/clients/client-cloudwatch-events/runtimeConfig.native.ts +++ b/clients/client-cloudwatch-events/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudWatchEventsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudwatch-events/runtimeConfig.ts b/clients/client-cloudwatch-events/runtimeConfig.ts index 13dbab5b5226f..e7561fd407f6e 100644 --- a/clients/client-cloudwatch-events/runtimeConfig.ts +++ b/clients/client-cloudwatch-events/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudwatch-logs/CloudWatchLogsClient.ts b/clients/client-cloudwatch-logs/CloudWatchLogsClient.ts index 8cb692001c793..5267d3be3ef43 100644 --- a/clients/client-cloudwatch-logs/CloudWatchLogsClient.ts +++ b/clients/client-cloudwatch-logs/CloudWatchLogsClient.ts @@ -113,6 +113,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -123,6 +124,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -260,11 +262,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -306,6 +303,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudWatchLogsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -314,8 +317,8 @@ export type CloudWatchLogsClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudWatchLogsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -323,8 +326,8 @@ export type CloudWatchLogsClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

You can use Amazon CloudWatch Logs to monitor, store, and access your log files from @@ -379,16 +382,16 @@ export class CloudWatchLogsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudwatch-logs/runtimeConfig.browser.ts b/clients/client-cloudwatch-logs/runtimeConfig.browser.ts index 654fea3e6e316..6ae79aae4f415 100644 --- a/clients/client-cloudwatch-logs/runtimeConfig.browser.ts +++ b/clients/client-cloudwatch-logs/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudwatch-logs/runtimeConfig.native.ts b/clients/client-cloudwatch-logs/runtimeConfig.native.ts index 1bb795a06c169..51c69acdb6890 100644 --- a/clients/client-cloudwatch-logs/runtimeConfig.native.ts +++ b/clients/client-cloudwatch-logs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudWatchLogsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudwatch-logs/runtimeConfig.ts b/clients/client-cloudwatch-logs/runtimeConfig.ts index 6780fe5741d63..8775531f639a8 100644 --- a/clients/client-cloudwatch-logs/runtimeConfig.ts +++ b/clients/client-cloudwatch-logs/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudwatch/CloudWatchClient.ts b/clients/client-cloudwatch/CloudWatchClient.ts index 9efb0d5cdb4e6..8e6cbde9a469a 100644 --- a/clients/client-cloudwatch/CloudWatchClient.ts +++ b/clients/client-cloudwatch/CloudWatchClient.ts @@ -98,6 +98,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -108,6 +109,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -221,11 +223,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -267,6 +264,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudWatchClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -275,8 +278,8 @@ export type CloudWatchClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudWatchClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -284,8 +287,8 @@ export type CloudWatchClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon CloudWatch monitors your Amazon Web Services (AWS) resources and the @@ -321,16 +324,16 @@ export class CloudWatchClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudwatch/runtimeConfig.browser.ts b/clients/client-cloudwatch/runtimeConfig.browser.ts index 930f159ba383c..7b5639bad5d6a 100644 --- a/clients/client-cloudwatch/runtimeConfig.browser.ts +++ b/clients/client-cloudwatch/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudwatch/runtimeConfig.native.ts b/clients/client-cloudwatch/runtimeConfig.native.ts index 3b3da3e46f946..062d28f7b3889 100644 --- a/clients/client-cloudwatch/runtimeConfig.native.ts +++ b/clients/client-cloudwatch/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudWatchClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudwatch/runtimeConfig.ts b/clients/client-cloudwatch/runtimeConfig.ts index 9309e714846bc..13c847ef37b55 100644 --- a/clients/client-cloudwatch/runtimeConfig.ts +++ b/clients/client-cloudwatch/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codeartifact/CodeartifactClient.ts b/clients/client-codeartifact/CodeartifactClient.ts index 89d31446c6378..1905e79c8d9ea 100644 --- a/clients/client-codeartifact/CodeartifactClient.ts +++ b/clients/client-codeartifact/CodeartifactClient.ts @@ -135,6 +135,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -145,6 +146,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -266,11 +268,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -312,6 +309,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodeartifactClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -320,8 +323,8 @@ export type CodeartifactClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeartifactClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -329,8 +332,8 @@ export type CodeartifactClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS CodeArtifact is a fully managed artifact repository compatible with language-native @@ -627,16 +630,16 @@ export class CodeartifactClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codeartifact/runtimeConfig.browser.ts b/clients/client-codeartifact/runtimeConfig.browser.ts index db03607571dc4..8b2a1a02f2b6a 100644 --- a/clients/client-codeartifact/runtimeConfig.browser.ts +++ b/clients/client-codeartifact/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codeartifact/runtimeConfig.native.ts b/clients/client-codeartifact/runtimeConfig.native.ts index 3898b2fe38000..0b860f18c4824 100644 --- a/clients/client-codeartifact/runtimeConfig.native.ts +++ b/clients/client-codeartifact/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeartifactClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codeartifact/runtimeConfig.ts b/clients/client-codeartifact/runtimeConfig.ts index a75635fb4066e..f51a753ea3b01 100644 --- a/clients/client-codeartifact/runtimeConfig.ts +++ b/clients/client-codeartifact/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codebuild/CodeBuildClient.ts b/clients/client-codebuild/CodeBuildClient.ts index 302c54f9eaf96..59ccb8b22c337 100644 --- a/clients/client-codebuild/CodeBuildClient.ts +++ b/clients/client-codebuild/CodeBuildClient.ts @@ -121,6 +121,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -131,6 +132,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -272,11 +274,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -318,6 +315,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodeBuildClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -326,8 +329,8 @@ export type CodeBuildClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeBuildClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -335,8 +338,8 @@ export type CodeBuildClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CodeBuild @@ -542,16 +545,16 @@ export class CodeBuildClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codebuild/runtimeConfig.browser.ts b/clients/client-codebuild/runtimeConfig.browser.ts index f98a337451d0f..633b77f1b86eb 100644 --- a/clients/client-codebuild/runtimeConfig.browser.ts +++ b/clients/client-codebuild/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codebuild/runtimeConfig.native.ts b/clients/client-codebuild/runtimeConfig.native.ts index ebf6dcb961b85..7535c90ed473c 100644 --- a/clients/client-codebuild/runtimeConfig.native.ts +++ b/clients/client-codebuild/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeBuildClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codebuild/runtimeConfig.ts b/clients/client-codebuild/runtimeConfig.ts index 241b28f1a9a4a..dc6c23eb61e26 100644 --- a/clients/client-codebuild/runtimeConfig.ts +++ b/clients/client-codebuild/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codecommit/CodeCommitClient.ts b/clients/client-codecommit/CodeCommitClient.ts index 61a7e9b7cc8bf..445f0e72909dd 100644 --- a/clients/client-codecommit/CodeCommitClient.ts +++ b/clients/client-codecommit/CodeCommitClient.ts @@ -256,6 +256,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -266,6 +267,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -473,11 +475,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -519,6 +516,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodeCommitClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -527,8 +530,8 @@ export type CodeCommitClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeCommitClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -536,8 +539,8 @@ export type CodeCommitClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CodeCommit @@ -955,16 +958,16 @@ export class CodeCommitClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codecommit/runtimeConfig.browser.ts b/clients/client-codecommit/runtimeConfig.browser.ts index b0fe76fabddaa..03571d0791454 100644 --- a/clients/client-codecommit/runtimeConfig.browser.ts +++ b/clients/client-codecommit/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codecommit/runtimeConfig.native.ts b/clients/client-codecommit/runtimeConfig.native.ts index 22af34073883e..aa2ef6de18668 100644 --- a/clients/client-codecommit/runtimeConfig.native.ts +++ b/clients/client-codecommit/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeCommitClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codecommit/runtimeConfig.ts b/clients/client-codecommit/runtimeConfig.ts index 67f897187efd8..d22eba6183515 100644 --- a/clients/client-codecommit/runtimeConfig.ts +++ b/clients/client-codecommit/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codedeploy/CodeDeployClient.ts b/clients/client-codedeploy/CodeDeployClient.ts index f5545b49a38a8..660341dbcc927 100644 --- a/clients/client-codedeploy/CodeDeployClient.ts +++ b/clients/client-codedeploy/CodeDeployClient.ts @@ -184,6 +184,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -194,6 +195,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -341,11 +343,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -387,6 +384,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodeDeployClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -395,8 +398,8 @@ export type CodeDeployClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeDeployClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -404,8 +407,8 @@ export type CodeDeployClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CodeDeploy @@ -526,16 +529,16 @@ export class CodeDeployClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codedeploy/runtimeConfig.browser.ts b/clients/client-codedeploy/runtimeConfig.browser.ts index 79dc845fadbe7..a6341af9c966c 100644 --- a/clients/client-codedeploy/runtimeConfig.browser.ts +++ b/clients/client-codedeploy/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codedeploy/runtimeConfig.native.ts b/clients/client-codedeploy/runtimeConfig.native.ts index dab024883e226..e2b10ba330763 100644 --- a/clients/client-codedeploy/runtimeConfig.native.ts +++ b/clients/client-codedeploy/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeDeployClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codedeploy/runtimeConfig.ts b/clients/client-codedeploy/runtimeConfig.ts index 768be9eff8024..6a914eed69263 100644 --- a/clients/client-codedeploy/runtimeConfig.ts +++ b/clients/client-codedeploy/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codeguru-reviewer/CodeGuruReviewerClient.ts b/clients/client-codeguru-reviewer/CodeGuruReviewerClient.ts index 8366c6377a22d..1ede809c10757 100644 --- a/clients/client-codeguru-reviewer/CodeGuruReviewerClient.ts +++ b/clients/client-codeguru-reviewer/CodeGuruReviewerClient.ts @@ -76,6 +76,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -86,6 +87,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -167,11 +169,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -213,6 +210,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodeGuruReviewerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -221,8 +224,8 @@ export type CodeGuruReviewerClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeGuruReviewerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -230,8 +233,8 @@ export type CodeGuruReviewerClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This section provides documentation for the Amazon CodeGuru Reviewer API operations. CodeGuru Reviewer is a service @@ -268,16 +271,16 @@ export class CodeGuruReviewerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codeguru-reviewer/runtimeConfig.browser.ts b/clients/client-codeguru-reviewer/runtimeConfig.browser.ts index 4cdd6b918c6fc..1d0495c14761c 100644 --- a/clients/client-codeguru-reviewer/runtimeConfig.browser.ts +++ b/clients/client-codeguru-reviewer/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codeguru-reviewer/runtimeConfig.native.ts b/clients/client-codeguru-reviewer/runtimeConfig.native.ts index bf811af49660d..8300083647b66 100644 --- a/clients/client-codeguru-reviewer/runtimeConfig.native.ts +++ b/clients/client-codeguru-reviewer/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeGuruReviewerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codeguru-reviewer/runtimeConfig.ts b/clients/client-codeguru-reviewer/runtimeConfig.ts index 8660ac01b7d1c..f82371128ad1e 100644 --- a/clients/client-codeguru-reviewer/runtimeConfig.ts +++ b/clients/client-codeguru-reviewer/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codeguruprofiler/CodeGuruProfilerClient.ts b/clients/client-codeguruprofiler/CodeGuruProfilerClient.ts index 351ab3250787f..f3d07529dea6c 100644 --- a/clients/client-codeguruprofiler/CodeGuruProfilerClient.ts +++ b/clients/client-codeguruprofiler/CodeGuruProfilerClient.ts @@ -63,6 +63,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -73,6 +74,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -152,11 +154,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -198,6 +195,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodeGuruProfilerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -206,8 +209,8 @@ export type CodeGuruProfilerClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeGuruProfilerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -215,8 +218,8 @@ export type CodeGuruProfilerClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This section provides documentation for the Amazon CodeGuru Profiler API operations.

@@ -238,16 +241,16 @@ export class CodeGuruProfilerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codeguruprofiler/runtimeConfig.browser.ts b/clients/client-codeguruprofiler/runtimeConfig.browser.ts index de0d8fe56f0c3..0f5f6aac70961 100644 --- a/clients/client-codeguruprofiler/runtimeConfig.browser.ts +++ b/clients/client-codeguruprofiler/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codeguruprofiler/runtimeConfig.native.ts b/clients/client-codeguruprofiler/runtimeConfig.native.ts index bb7df9fefa175..f2cc2ba24dc07 100644 --- a/clients/client-codeguruprofiler/runtimeConfig.native.ts +++ b/clients/client-codeguruprofiler/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeGuruProfilerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codeguruprofiler/runtimeConfig.ts b/clients/client-codeguruprofiler/runtimeConfig.ts index 71bb1c05f730a..b969a33804f80 100644 --- a/clients/client-codeguruprofiler/runtimeConfig.ts +++ b/clients/client-codeguruprofiler/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codepipeline/CodePipelineClient.ts b/clients/client-codepipeline/CodePipelineClient.ts index 0cf50dd2a33b1..f19f147b11906 100644 --- a/clients/client-codepipeline/CodePipelineClient.ts +++ b/clients/client-codepipeline/CodePipelineClient.ts @@ -132,6 +132,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -142,6 +143,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -269,11 +271,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -315,6 +312,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodePipelineClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -323,8 +326,8 @@ export type CodePipelineClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodePipelineClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -332,8 +335,8 @@ export type CodePipelineClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CodePipeline @@ -549,16 +552,16 @@ export class CodePipelineClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codepipeline/runtimeConfig.browser.ts b/clients/client-codepipeline/runtimeConfig.browser.ts index d5fd093ac1d1c..d2ff3b3be5874 100644 --- a/clients/client-codepipeline/runtimeConfig.browser.ts +++ b/clients/client-codepipeline/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codepipeline/runtimeConfig.native.ts b/clients/client-codepipeline/runtimeConfig.native.ts index e95574d1e7b8d..9c0999d852c55 100644 --- a/clients/client-codepipeline/runtimeConfig.native.ts +++ b/clients/client-codepipeline/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodePipelineClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codepipeline/runtimeConfig.ts b/clients/client-codepipeline/runtimeConfig.ts index 03013d23ed5b0..f5fab8e535294 100644 --- a/clients/client-codepipeline/runtimeConfig.ts +++ b/clients/client-codepipeline/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codestar-connections/CodeStarConnectionsClient.ts b/clients/client-codestar-connections/CodeStarConnectionsClient.ts index e360103dcdec7..8aff36f7e89fa 100644 --- a/clients/client-codestar-connections/CodeStarConnectionsClient.ts +++ b/clients/client-codestar-connections/CodeStarConnectionsClient.ts @@ -50,6 +50,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -60,6 +61,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -137,11 +139,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -183,6 +180,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodeStarConnectionsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -191,8 +194,8 @@ export type CodeStarConnectionsClientConfig = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeStarConnectionsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -200,8 +203,8 @@ export type CodeStarConnectionsClientResolvedConfig = __SmithyResolvedConfigurat EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CodeStar Connections @@ -302,16 +305,16 @@ export class CodeStarConnectionsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codestar-connections/runtimeConfig.browser.ts b/clients/client-codestar-connections/runtimeConfig.browser.ts index 94bd12cc1a79e..bc9a8f2984a57 100644 --- a/clients/client-codestar-connections/runtimeConfig.browser.ts +++ b/clients/client-codestar-connections/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codestar-connections/runtimeConfig.native.ts b/clients/client-codestar-connections/runtimeConfig.native.ts index d39d0e088c449..17f7b3d692507 100644 --- a/clients/client-codestar-connections/runtimeConfig.native.ts +++ b/clients/client-codestar-connections/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeStarConnectionsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codestar-connections/runtimeConfig.ts b/clients/client-codestar-connections/runtimeConfig.ts index 0c91e40220db0..aa64791b9023e 100644 --- a/clients/client-codestar-connections/runtimeConfig.ts +++ b/clients/client-codestar-connections/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codestar-notifications/CodestarNotificationsClient.ts b/clients/client-codestar-notifications/CodestarNotificationsClient.ts index ba87ec77f112a..daeccf18cf155 100644 --- a/clients/client-codestar-notifications/CodestarNotificationsClient.ts +++ b/clients/client-codestar-notifications/CodestarNotificationsClient.ts @@ -66,6 +66,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -76,6 +77,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -155,11 +157,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -201,6 +198,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodestarNotificationsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -209,8 +212,8 @@ export type CodestarNotificationsClientConfig = Partial<__SmithyConfiguration<__ EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodestarNotificationsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -218,8 +221,8 @@ export type CodestarNotificationsClientResolvedConfig = __SmithyResolvedConfigur EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This AWS CodeStar Notifications API Reference provides descriptions and usage examples of the @@ -324,16 +327,16 @@ export class CodestarNotificationsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codestar-notifications/runtimeConfig.browser.ts b/clients/client-codestar-notifications/runtimeConfig.browser.ts index 56d9f07993dbd..268551b9023d5 100644 --- a/clients/client-codestar-notifications/runtimeConfig.browser.ts +++ b/clients/client-codestar-notifications/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codestar-notifications/runtimeConfig.native.ts b/clients/client-codestar-notifications/runtimeConfig.native.ts index 688f359752ee8..9cdb5511d924a 100644 --- a/clients/client-codestar-notifications/runtimeConfig.native.ts +++ b/clients/client-codestar-notifications/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodestarNotificationsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codestar-notifications/runtimeConfig.ts b/clients/client-codestar-notifications/runtimeConfig.ts index d8690cf416d99..7e1cf8d6a7964 100644 --- a/clients/client-codestar-notifications/runtimeConfig.ts +++ b/clients/client-codestar-notifications/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codestar/CodeStarClient.ts b/clients/client-codestar/CodeStarClient.ts index 5d8aa9246b255..0d6cf06da79f5 100644 --- a/clients/client-codestar/CodeStarClient.ts +++ b/clients/client-codestar/CodeStarClient.ts @@ -62,6 +62,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -72,6 +73,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -161,11 +163,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -207,6 +204,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodeStarClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -215,8 +218,8 @@ export type CodeStarClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeStarClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -224,8 +227,8 @@ export type CodeStarClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CodeStar @@ -336,16 +339,16 @@ export class CodeStarClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codestar/runtimeConfig.browser.ts b/clients/client-codestar/runtimeConfig.browser.ts index 3f58b65fdce39..4c05dd5b66b16 100644 --- a/clients/client-codestar/runtimeConfig.browser.ts +++ b/clients/client-codestar/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codestar/runtimeConfig.native.ts b/clients/client-codestar/runtimeConfig.native.ts index 4d380d997771d..40c5bb753bf59 100644 --- a/clients/client-codestar/runtimeConfig.native.ts +++ b/clients/client-codestar/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeStarClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codestar/runtimeConfig.ts b/clients/client-codestar/runtimeConfig.ts index 86d3b1a82bb50..e31bd24475b21 100644 --- a/clients/client-codestar/runtimeConfig.ts +++ b/clients/client-codestar/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cognito-identity-provider/CognitoIdentityProviderClient.ts b/clients/client-cognito-identity-provider/CognitoIdentityProviderClient.ts index efd4ac3c9df79..078332960b56f 100644 --- a/clients/client-cognito-identity-provider/CognitoIdentityProviderClient.ts +++ b/clients/client-cognito-identity-provider/CognitoIdentityProviderClient.ts @@ -298,6 +298,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -308,6 +309,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -561,11 +563,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -607,6 +604,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CognitoIdentityProviderClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -615,8 +618,8 @@ export type CognitoIdentityProviderClientConfig = Partial<__SmithyConfiguration< EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CognitoIdentityProviderClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -624,8 +627,8 @@ export type CognitoIdentityProviderClientResolvedConfig = __SmithyResolvedConfig EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Using the Amazon Cognito User Pools API, you can create a user pool to manage @@ -652,15 +655,15 @@ export class CognitoIdentityProviderClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cognito-identity-provider/runtimeConfig.browser.ts b/clients/client-cognito-identity-provider/runtimeConfig.browser.ts index 7621eec4c8278..472a323f1a676 100644 --- a/clients/client-cognito-identity-provider/runtimeConfig.browser.ts +++ b/clients/client-cognito-identity-provider/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cognito-identity-provider/runtimeConfig.native.ts b/clients/client-cognito-identity-provider/runtimeConfig.native.ts index 402aecead4539..3026a60425b39 100644 --- a/clients/client-cognito-identity-provider/runtimeConfig.native.ts +++ b/clients/client-cognito-identity-provider/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CognitoIdentityProviderClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cognito-identity-provider/runtimeConfig.ts b/clients/client-cognito-identity-provider/runtimeConfig.ts index e001c79a04e91..3242e7a8e33ee 100644 --- a/clients/client-cognito-identity-provider/runtimeConfig.ts +++ b/clients/client-cognito-identity-provider/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cognito-identity/CognitoIdentityClient.ts b/clients/client-cognito-identity/CognitoIdentityClient.ts index 7d35ee6a04ce4..3836a427c8009 100644 --- a/clients/client-cognito-identity/CognitoIdentityClient.ts +++ b/clients/client-cognito-identity/CognitoIdentityClient.ts @@ -78,6 +78,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -88,6 +89,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -183,11 +185,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -229,6 +226,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CognitoIdentityClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -237,8 +240,8 @@ export type CognitoIdentityClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CognitoIdentityClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -246,8 +249,8 @@ export type CognitoIdentityClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Cognito Federated Identities @@ -282,15 +285,15 @@ export class CognitoIdentityClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cognito-identity/runtimeConfig.browser.ts b/clients/client-cognito-identity/runtimeConfig.browser.ts index 69f1637cb22c5..e3f589a52f54d 100644 --- a/clients/client-cognito-identity/runtimeConfig.browser.ts +++ b/clients/client-cognito-identity/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cognito-identity/runtimeConfig.native.ts b/clients/client-cognito-identity/runtimeConfig.native.ts index 870131af0bef5..f33e0dec2ccfd 100644 --- a/clients/client-cognito-identity/runtimeConfig.native.ts +++ b/clients/client-cognito-identity/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CognitoIdentityClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cognito-identity/runtimeConfig.ts b/clients/client-cognito-identity/runtimeConfig.ts index d236052526af1..5fedb2fe7564d 100644 --- a/clients/client-cognito-identity/runtimeConfig.ts +++ b/clients/client-cognito-identity/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cognito-sync/CognitoSyncClient.ts b/clients/client-cognito-sync/CognitoSyncClient.ts index 8e6817f04555b..6680c926cb10e 100644 --- a/clients/client-cognito-sync/CognitoSyncClient.ts +++ b/clients/client-cognito-sync/CognitoSyncClient.ts @@ -73,6 +73,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -83,6 +84,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CognitoSyncClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +227,8 @@ export type CognitoSyncClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CognitoSyncClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +236,8 @@ export type CognitoSyncClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Cognito Sync @@ -262,16 +265,16 @@ export class CognitoSyncClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cognito-sync/runtimeConfig.browser.ts b/clients/client-cognito-sync/runtimeConfig.browser.ts index 87d48c6c1cfa6..004eb46a6b63b 100644 --- a/clients/client-cognito-sync/runtimeConfig.browser.ts +++ b/clients/client-cognito-sync/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cognito-sync/runtimeConfig.native.ts b/clients/client-cognito-sync/runtimeConfig.native.ts index f7a473853ce85..d6bc203a42bb0 100644 --- a/clients/client-cognito-sync/runtimeConfig.native.ts +++ b/clients/client-cognito-sync/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CognitoSyncClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cognito-sync/runtimeConfig.ts b/clients/client-cognito-sync/runtimeConfig.ts index b0c6f72106f30..5535603f0a32a 100644 --- a/clients/client-cognito-sync/runtimeConfig.ts +++ b/clients/client-cognito-sync/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-comprehend/ComprehendClient.ts b/clients/client-comprehend/ComprehendClient.ts index 908fb280a975c..54e66e41c59d4 100644 --- a/clients/client-comprehend/ComprehendClient.ts +++ b/clients/client-comprehend/ComprehendClient.ts @@ -233,6 +233,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -243,6 +244,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -416,11 +418,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -462,6 +459,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ComprehendClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -470,8 +473,8 @@ export type ComprehendClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ComprehendClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -479,8 +482,8 @@ export type ComprehendClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Comprehend is an AWS service for gaining insight into the content of documents. @@ -505,16 +508,16 @@ export class ComprehendClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-comprehend/runtimeConfig.browser.ts b/clients/client-comprehend/runtimeConfig.browser.ts index 616dd876ba9be..af1800d92e0a6 100644 --- a/clients/client-comprehend/runtimeConfig.browser.ts +++ b/clients/client-comprehend/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-comprehend/runtimeConfig.native.ts b/clients/client-comprehend/runtimeConfig.native.ts index d7dc348aebc58..521b67e7a5358 100644 --- a/clients/client-comprehend/runtimeConfig.native.ts +++ b/clients/client-comprehend/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ComprehendClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-comprehend/runtimeConfig.ts b/clients/client-comprehend/runtimeConfig.ts index 919aefc24d03e..a79969b1f8f4c 100644 --- a/clients/client-comprehend/runtimeConfig.ts +++ b/clients/client-comprehend/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-comprehendmedical/ComprehendMedicalClient.ts b/clients/client-comprehendmedical/ComprehendMedicalClient.ts index 26901c7756e33..18395a0ca849e 100644 --- a/clients/client-comprehendmedical/ComprehendMedicalClient.ts +++ b/clients/client-comprehendmedical/ComprehendMedicalClient.ts @@ -104,6 +104,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -114,6 +115,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -209,11 +211,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -255,6 +252,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ComprehendMedicalClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -263,8 +266,8 @@ export type ComprehendMedicalClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ComprehendMedicalClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -272,8 +275,8 @@ export type ComprehendMedicalClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Comprehend Medical extracts structured information from unstructured clinical text. Use these actions @@ -296,16 +299,16 @@ export class ComprehendMedicalClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-comprehendmedical/runtimeConfig.browser.ts b/clients/client-comprehendmedical/runtimeConfig.browser.ts index 611752e1ac17c..4c343f29435a9 100644 --- a/clients/client-comprehendmedical/runtimeConfig.browser.ts +++ b/clients/client-comprehendmedical/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-comprehendmedical/runtimeConfig.native.ts b/clients/client-comprehendmedical/runtimeConfig.native.ts index c2386c7cccdf0..8e1a180c85c83 100644 --- a/clients/client-comprehendmedical/runtimeConfig.native.ts +++ b/clients/client-comprehendmedical/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ComprehendMedicalClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-comprehendmedical/runtimeConfig.ts b/clients/client-comprehendmedical/runtimeConfig.ts index 1437a913e54ac..6d477a0c29787 100644 --- a/clients/client-comprehendmedical/runtimeConfig.ts +++ b/clients/client-comprehendmedical/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-compute-optimizer/ComputeOptimizerClient.ts b/clients/client-compute-optimizer/ComputeOptimizerClient.ts index cb5135c63890c..9e20adb58a39e 100644 --- a/clients/client-compute-optimizer/ComputeOptimizerClient.ts +++ b/clients/client-compute-optimizer/ComputeOptimizerClient.ts @@ -75,6 +75,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -85,6 +86,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -158,11 +160,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -204,6 +201,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ComputeOptimizerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -212,8 +215,8 @@ export type ComputeOptimizerClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ComputeOptimizerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -221,8 +224,8 @@ export type ComputeOptimizerClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Compute Optimizer is a service that analyzes the configuration and utilization metrics of your @@ -253,16 +256,16 @@ export class ComputeOptimizerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-compute-optimizer/runtimeConfig.browser.ts b/clients/client-compute-optimizer/runtimeConfig.browser.ts index de4cb581cee77..fde4656cc1472 100644 --- a/clients/client-compute-optimizer/runtimeConfig.browser.ts +++ b/clients/client-compute-optimizer/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-compute-optimizer/runtimeConfig.native.ts b/clients/client-compute-optimizer/runtimeConfig.native.ts index e9fd73c91ecd3..0bf60a2374bfc 100644 --- a/clients/client-compute-optimizer/runtimeConfig.native.ts +++ b/clients/client-compute-optimizer/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ComputeOptimizerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-compute-optimizer/runtimeConfig.ts b/clients/client-compute-optimizer/runtimeConfig.ts index 9cdedb63ec698..05ac7e8560ad8 100644 --- a/clients/client-compute-optimizer/runtimeConfig.ts +++ b/clients/client-compute-optimizer/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-config-service/ConfigServiceClient.ts b/clients/client-config-service/ConfigServiceClient.ts index 67d1dc807665f..1dfa822bdee74 100644 --- a/clients/client-config-service/ConfigServiceClient.ts +++ b/clients/client-config-service/ConfigServiceClient.ts @@ -327,6 +327,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -337,6 +338,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -548,11 +550,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -594,6 +591,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ConfigServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -602,8 +605,8 @@ export type ConfigServiceClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ConfigServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -611,8 +614,8 @@ export type ConfigServiceClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Config @@ -657,16 +660,16 @@ export class ConfigServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-config-service/runtimeConfig.browser.ts b/clients/client-config-service/runtimeConfig.browser.ts index 5d1b9935f122b..f0b1afa77a08e 100644 --- a/clients/client-config-service/runtimeConfig.browser.ts +++ b/clients/client-config-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-config-service/runtimeConfig.native.ts b/clients/client-config-service/runtimeConfig.native.ts index 865c56277d199..57b1619e574ca 100644 --- a/clients/client-config-service/runtimeConfig.native.ts +++ b/clients/client-config-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ConfigServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-config-service/runtimeConfig.ts b/clients/client-config-service/runtimeConfig.ts index fc47ea0d7f867..76197a6155442 100644 --- a/clients/client-config-service/runtimeConfig.ts +++ b/clients/client-config-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-connect-contact-lens/ConnectContactLensClient.ts b/clients/client-connect-contact-lens/ConnectContactLensClient.ts index d76e7ffca9734..edac9c7a0c5bd 100644 --- a/clients/client-connect-contact-lens/ConnectContactLensClient.ts +++ b/clients/client-connect-contact-lens/ConnectContactLensClient.ts @@ -39,6 +39,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -49,6 +50,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = ListRealtimeContactAnalysisSegmentsCommandInput; @@ -102,11 +104,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -148,6 +145,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ConnectContactLensClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -156,8 +159,8 @@ export type ConnectContactLensClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ConnectContactLensClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -165,8 +168,8 @@ export type ConnectContactLensClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Contact Lens for Amazon Connect enables you to analyze conversations between customer and agents, @@ -194,16 +197,16 @@ export class ConnectContactLensClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-connect-contact-lens/runtimeConfig.browser.ts b/clients/client-connect-contact-lens/runtimeConfig.browser.ts index 55336fef5a8e6..0a1a469fd0c6a 100644 --- a/clients/client-connect-contact-lens/runtimeConfig.browser.ts +++ b/clients/client-connect-contact-lens/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-connect-contact-lens/runtimeConfig.native.ts b/clients/client-connect-contact-lens/runtimeConfig.native.ts index 0bfb0e7b05cda..6b182dd756fd8 100644 --- a/clients/client-connect-contact-lens/runtimeConfig.native.ts +++ b/clients/client-connect-contact-lens/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ConnectContactLensClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-connect-contact-lens/runtimeConfig.ts b/clients/client-connect-contact-lens/runtimeConfig.ts index 7e47a19f4ce0e..03e36838adf85 100644 --- a/clients/client-connect-contact-lens/runtimeConfig.ts +++ b/clients/client-connect-contact-lens/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-connect/ConnectClient.ts b/clients/client-connect/ConnectClient.ts index f70ea34c4e41e..ed257d599a059 100644 --- a/clients/client-connect/ConnectClient.ts +++ b/clients/client-connect/ConnectClient.ts @@ -282,6 +282,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -292,6 +293,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -509,11 +511,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -555,6 +552,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ConnectClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -563,8 +566,8 @@ export type ConnectClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ConnectClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -572,8 +575,8 @@ export type ConnectClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Connect is a cloud-based contact center solution that makes it easy to set up and manage a @@ -608,16 +611,16 @@ export class ConnectClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-connect/runtimeConfig.browser.ts b/clients/client-connect/runtimeConfig.browser.ts index 4e2c2e16f6a02..7c410928f7cc8 100644 --- a/clients/client-connect/runtimeConfig.browser.ts +++ b/clients/client-connect/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-connect/runtimeConfig.native.ts b/clients/client-connect/runtimeConfig.native.ts index b3dab48b2ae7a..f07ce4c7c8ff8 100644 --- a/clients/client-connect/runtimeConfig.native.ts +++ b/clients/client-connect/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ConnectClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-connect/runtimeConfig.ts b/clients/client-connect/runtimeConfig.ts index 49f908e3a2769..206482c2f6265 100644 --- a/clients/client-connect/runtimeConfig.ts +++ b/clients/client-connect/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-connectparticipant/ConnectParticipantClient.ts b/clients/client-connectparticipant/ConnectParticipantClient.ts index ebc7f2c064897..898d4a5be8c8f 100644 --- a/clients/client-connectparticipant/ConnectParticipantClient.ts +++ b/clients/client-connectparticipant/ConnectParticipantClient.ts @@ -46,6 +46,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -56,6 +57,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -119,11 +121,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -165,6 +162,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ConnectParticipantClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -173,8 +176,8 @@ export type ConnectParticipantClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ConnectParticipantClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -182,8 +185,8 @@ export type ConnectParticipantClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Connect is a cloud-based contact center solution that makes it easy to set up and manage @@ -210,16 +213,16 @@ export class ConnectParticipantClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-connectparticipant/runtimeConfig.browser.ts b/clients/client-connectparticipant/runtimeConfig.browser.ts index 0ce59f46c95e5..70752ee89876d 100644 --- a/clients/client-connectparticipant/runtimeConfig.browser.ts +++ b/clients/client-connectparticipant/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-connectparticipant/runtimeConfig.native.ts b/clients/client-connectparticipant/runtimeConfig.native.ts index 8db6b6e6a5afc..8ee1e2943c1b5 100644 --- a/clients/client-connectparticipant/runtimeConfig.native.ts +++ b/clients/client-connectparticipant/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ConnectParticipantClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-connectparticipant/runtimeConfig.ts b/clients/client-connectparticipant/runtimeConfig.ts index 3369c8941a800..68e335ffd5f4d 100644 --- a/clients/client-connectparticipant/runtimeConfig.ts +++ b/clients/client-connectparticipant/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cost-and-usage-report-service/CostAndUsageReportServiceClient.ts b/clients/client-cost-and-usage-report-service/CostAndUsageReportServiceClient.ts index 21eff09eba3c5..eafbaa6c65a1e 100644 --- a/clients/client-cost-and-usage-report-service/CostAndUsageReportServiceClient.ts +++ b/clients/client-cost-and-usage-report-service/CostAndUsageReportServiceClient.ts @@ -51,6 +51,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -61,6 +62,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -122,11 +124,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -168,6 +165,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CostAndUsageReportServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -176,8 +179,8 @@ export type CostAndUsageReportServiceClientConfig = Partial<__SmithyConfiguratio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CostAndUsageReportServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -185,8 +188,8 @@ export type CostAndUsageReportServiceClientResolvedConfig = __SmithyResolvedConf EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The AWS Cost and Usage Report API enables you to programmatically create, query, and delete @@ -226,16 +229,16 @@ export class CostAndUsageReportServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cost-and-usage-report-service/runtimeConfig.browser.ts b/clients/client-cost-and-usage-report-service/runtimeConfig.browser.ts index e7c31d6031ba3..21c8ead8353e0 100644 --- a/clients/client-cost-and-usage-report-service/runtimeConfig.browser.ts +++ b/clients/client-cost-and-usage-report-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cost-and-usage-report-service/runtimeConfig.native.ts b/clients/client-cost-and-usage-report-service/runtimeConfig.native.ts index d92776d084ff6..020e837c44f45 100644 --- a/clients/client-cost-and-usage-report-service/runtimeConfig.native.ts +++ b/clients/client-cost-and-usage-report-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CostAndUsageReportServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cost-and-usage-report-service/runtimeConfig.ts b/clients/client-cost-and-usage-report-service/runtimeConfig.ts index d96a57092627b..299ed76687b09 100644 --- a/clients/client-cost-and-usage-report-service/runtimeConfig.ts +++ b/clients/client-cost-and-usage-report-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cost-explorer/CostExplorerClient.ts b/clients/client-cost-explorer/CostExplorerClient.ts index 1c931237d28ac..663841e09d372 100644 --- a/clients/client-cost-explorer/CostExplorerClient.ts +++ b/clients/client-cost-explorer/CostExplorerClient.ts @@ -130,6 +130,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -140,6 +141,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -251,11 +253,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -297,6 +294,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CostExplorerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -305,8 +308,8 @@ export type CostExplorerClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CostExplorerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -314,8 +317,8 @@ export type CostExplorerClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The Cost Explorer API enables you to programmatically query your cost and usage data. You can query for aggregated data @@ -350,16 +353,16 @@ export class CostExplorerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cost-explorer/runtimeConfig.browser.ts b/clients/client-cost-explorer/runtimeConfig.browser.ts index 8f3344350f8fb..c71ce08faa8c9 100644 --- a/clients/client-cost-explorer/runtimeConfig.browser.ts +++ b/clients/client-cost-explorer/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cost-explorer/runtimeConfig.native.ts b/clients/client-cost-explorer/runtimeConfig.native.ts index 76c2d7c94281a..10aadf852c4ff 100644 --- a/clients/client-cost-explorer/runtimeConfig.native.ts +++ b/clients/client-cost-explorer/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CostExplorerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cost-explorer/runtimeConfig.ts b/clients/client-cost-explorer/runtimeConfig.ts index 56a478efe7867..e19ccfd9c3687 100644 --- a/clients/client-cost-explorer/runtimeConfig.ts +++ b/clients/client-cost-explorer/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-customer-profiles/CustomerProfilesClient.ts b/clients/client-customer-profiles/CustomerProfilesClient.ts index e1b5ac4573c5e..9046542c4cbfd 100644 --- a/clients/client-customer-profiles/CustomerProfilesClient.ts +++ b/clients/client-customer-profiles/CustomerProfilesClient.ts @@ -90,6 +90,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -100,6 +101,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -209,11 +211,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -255,6 +252,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CustomerProfilesClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -263,8 +266,8 @@ export type CustomerProfilesClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CustomerProfilesClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -272,8 +275,8 @@ export type CustomerProfilesClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Connect Customer Profiles @@ -304,16 +307,16 @@ export class CustomerProfilesClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-customer-profiles/runtimeConfig.browser.ts b/clients/client-customer-profiles/runtimeConfig.browser.ts index 316fd99724463..a2df749fde289 100644 --- a/clients/client-customer-profiles/runtimeConfig.browser.ts +++ b/clients/client-customer-profiles/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-customer-profiles/runtimeConfig.native.ts b/clients/client-customer-profiles/runtimeConfig.native.ts index 0be66651c368d..e502d4e012b5e 100644 --- a/clients/client-customer-profiles/runtimeConfig.native.ts +++ b/clients/client-customer-profiles/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CustomerProfilesClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-customer-profiles/runtimeConfig.ts b/clients/client-customer-profiles/runtimeConfig.ts index 5b2c73cdbf089..9efc526fae9e4 100644 --- a/clients/client-customer-profiles/runtimeConfig.ts +++ b/clients/client-customer-profiles/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-data-pipeline/DataPipelineClient.ts b/clients/client-data-pipeline/DataPipelineClient.ts index bfebb99163f9f..9fd6baa34803d 100644 --- a/clients/client-data-pipeline/DataPipelineClient.ts +++ b/clients/client-data-pipeline/DataPipelineClient.ts @@ -66,6 +66,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -76,6 +77,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -167,11 +169,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -213,6 +210,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DataPipelineClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -221,8 +224,8 @@ export type DataPipelineClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DataPipelineClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -230,8 +233,8 @@ export type DataPipelineClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Data Pipeline configures and manages a data-driven workflow called a pipeline. AWS Data Pipeline handles the details of scheduling and ensuring that data dependencies are met so that your application can focus on processing the data.

@@ -257,16 +260,16 @@ export class DataPipelineClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-data-pipeline/runtimeConfig.browser.ts b/clients/client-data-pipeline/runtimeConfig.browser.ts index 613353f22c2b1..1e77ced302657 100644 --- a/clients/client-data-pipeline/runtimeConfig.browser.ts +++ b/clients/client-data-pipeline/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-data-pipeline/runtimeConfig.native.ts b/clients/client-data-pipeline/runtimeConfig.native.ts index d29208f6198c2..53680a0299427 100644 --- a/clients/client-data-pipeline/runtimeConfig.native.ts +++ b/clients/client-data-pipeline/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DataPipelineClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-data-pipeline/runtimeConfig.ts b/clients/client-data-pipeline/runtimeConfig.ts index b3bde8d16c6c7..d059d8a30cc17 100644 --- a/clients/client-data-pipeline/runtimeConfig.ts +++ b/clients/client-data-pipeline/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-database-migration-service/DatabaseMigrationServiceClient.ts b/clients/client-database-migration-service/DatabaseMigrationServiceClient.ts index a4453abdbd7fa..93931266ad59d 100644 --- a/clients/client-database-migration-service/DatabaseMigrationServiceClient.ts +++ b/clients/client-database-migration-service/DatabaseMigrationServiceClient.ts @@ -212,6 +212,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -222,6 +223,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -383,11 +385,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -429,6 +426,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DatabaseMigrationServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -437,8 +440,8 @@ export type DatabaseMigrationServiceClientConfig = Partial<__SmithyConfiguration EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DatabaseMigrationServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -446,8 +449,8 @@ export type DatabaseMigrationServiceClientResolvedConfig = __SmithyResolvedConfi EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Database Migration Service @@ -478,16 +481,16 @@ export class DatabaseMigrationServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-database-migration-service/runtimeConfig.browser.ts b/clients/client-database-migration-service/runtimeConfig.browser.ts index ea13446b6c9ae..58c4380c89dd4 100644 --- a/clients/client-database-migration-service/runtimeConfig.browser.ts +++ b/clients/client-database-migration-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-database-migration-service/runtimeConfig.native.ts b/clients/client-database-migration-service/runtimeConfig.native.ts index 9cad9050d511b..ae7ea57e683eb 100644 --- a/clients/client-database-migration-service/runtimeConfig.native.ts +++ b/clients/client-database-migration-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DatabaseMigrationServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-database-migration-service/runtimeConfig.ts b/clients/client-database-migration-service/runtimeConfig.ts index 385a6d603237a..53648735faeee 100644 --- a/clients/client-database-migration-service/runtimeConfig.ts +++ b/clients/client-database-migration-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-databrew/DataBrewClient.ts b/clients/client-databrew/DataBrewClient.ts index 3e76f942ef8d2..6dc2e7e7aa8c7 100644 --- a/clients/client-databrew/DataBrewClient.ts +++ b/clients/client-databrew/DataBrewClient.ts @@ -88,6 +88,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -98,6 +99,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -227,11 +229,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -273,6 +270,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DataBrewClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -281,8 +284,8 @@ export type DataBrewClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DataBrewClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -290,8 +293,8 @@ export type DataBrewClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Glue DataBrew is a visual, cloud-scale data-preparation service. DataBrew @@ -316,16 +319,16 @@ export class DataBrewClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-databrew/runtimeConfig.browser.ts b/clients/client-databrew/runtimeConfig.browser.ts index 2844b55136af5..cc1f7256fa5a6 100644 --- a/clients/client-databrew/runtimeConfig.browser.ts +++ b/clients/client-databrew/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-databrew/runtimeConfig.native.ts b/clients/client-databrew/runtimeConfig.native.ts index fa48ccf8dc742..ed1e7c8d6f8cb 100644 --- a/clients/client-databrew/runtimeConfig.native.ts +++ b/clients/client-databrew/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DataBrewClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-databrew/runtimeConfig.ts b/clients/client-databrew/runtimeConfig.ts index f349e2a52150c..e2818435e9839 100644 --- a/clients/client-databrew/runtimeConfig.ts +++ b/clients/client-databrew/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-dataexchange/DataExchangeClient.ts b/clients/client-dataexchange/DataExchangeClient.ts index fc3025afd62d0..63162018a31c4 100644 --- a/clients/client-dataexchange/DataExchangeClient.ts +++ b/clients/client-dataexchange/DataExchangeClient.ts @@ -63,6 +63,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -73,6 +74,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DataExchangeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +227,8 @@ export type DataExchangeClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DataExchangeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +236,8 @@ export type DataExchangeClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Data Exchange is a service that makes it easy for AWS customers to exchange data in the cloud. You can use the AWS Data Exchange APIs to create, update, manage, and access file-based data set in the AWS Cloud.

As a subscriber, you can view and access the data sets that you have an entitlement to through a subscription. You can use the APIS to download or copy your entitled data sets to Amazon S3 for use across a variety of AWS analytics and machine learning services.

As a provider, you can create and manage your data sets that you would like to publish to a product. Being able to package and provide your data sets into products requires a few steps to determine eligibility. For more information, visit the AWS Data Exchange User Guide.

A data set is a collection of data that can be changed or updated over time. Data sets can be updated using revisions, which represent a new version or incremental change to a data set. A revision contains one or more assets. An asset in AWS Data Exchange is a piece of data that can be stored as an Amazon S3 object. The asset can be a structured data file, an image file, or some other data file. Jobs are asynchronous import or export operations used to create or copy assets.

@@ -256,16 +259,16 @@ export class DataExchangeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-dataexchange/runtimeConfig.browser.ts b/clients/client-dataexchange/runtimeConfig.browser.ts index dadda53b3ccd0..b752ebb2cab0f 100644 --- a/clients/client-dataexchange/runtimeConfig.browser.ts +++ b/clients/client-dataexchange/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-dataexchange/runtimeConfig.native.ts b/clients/client-dataexchange/runtimeConfig.native.ts index e255fb75e86be..303b37f5f971f 100644 --- a/clients/client-dataexchange/runtimeConfig.native.ts +++ b/clients/client-dataexchange/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DataExchangeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-dataexchange/runtimeConfig.ts b/clients/client-dataexchange/runtimeConfig.ts index 68d2306ee16fb..38dd1986de229 100644 --- a/clients/client-dataexchange/runtimeConfig.ts +++ b/clients/client-dataexchange/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-datasync/DataSyncClient.ts b/clients/client-datasync/DataSyncClient.ts index a530ee21ed51d..604a85f065c49 100644 --- a/clients/client-datasync/DataSyncClient.ts +++ b/clients/client-datasync/DataSyncClient.ts @@ -100,6 +100,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -110,6 +111,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -227,11 +229,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -273,6 +270,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DataSyncClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -281,8 +284,8 @@ export type DataSyncClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DataSyncClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -290,8 +293,8 @@ export type DataSyncClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS DataSync @@ -319,16 +322,16 @@ export class DataSyncClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-datasync/runtimeConfig.browser.ts b/clients/client-datasync/runtimeConfig.browser.ts index 5c295b330156a..86312c79d6bd9 100644 --- a/clients/client-datasync/runtimeConfig.browser.ts +++ b/clients/client-datasync/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-datasync/runtimeConfig.native.ts b/clients/client-datasync/runtimeConfig.native.ts index 54339bc051d30..e9d9c4fe1fd92 100644 --- a/clients/client-datasync/runtimeConfig.native.ts +++ b/clients/client-datasync/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DataSyncClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-datasync/runtimeConfig.ts b/clients/client-datasync/runtimeConfig.ts index 99558ff59855f..e37d79c79758d 100644 --- a/clients/client-datasync/runtimeConfig.ts +++ b/clients/client-datasync/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-dax/DAXClient.ts b/clients/client-dax/DAXClient.ts index 8e504006f327b..473c74cbe14b8 100644 --- a/clients/client-dax/DAXClient.ts +++ b/clients/client-dax/DAXClient.ts @@ -80,6 +80,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -90,6 +91,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -185,11 +187,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -231,6 +228,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DAXClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -239,8 +242,8 @@ export type DAXClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DAXClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -248,8 +251,8 @@ export type DAXClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

DAX is a managed caching service engineered for Amazon DynamoDB. DAX @@ -276,16 +279,16 @@ export class DAXClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-dax/runtimeConfig.browser.ts b/clients/client-dax/runtimeConfig.browser.ts index 2ff9968497fc9..479881e0d24b0 100644 --- a/clients/client-dax/runtimeConfig.browser.ts +++ b/clients/client-dax/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-dax/runtimeConfig.native.ts b/clients/client-dax/runtimeConfig.native.ts index 6fb187d530248..15a4a4be0299b 100644 --- a/clients/client-dax/runtimeConfig.native.ts +++ b/clients/client-dax/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DAXClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-dax/runtimeConfig.ts b/clients/client-dax/runtimeConfig.ts index e69ce75ab04f7..62c1c192d7e99 100644 --- a/clients/client-dax/runtimeConfig.ts +++ b/clients/client-dax/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-detective/DetectiveClient.ts b/clients/client-detective/DetectiveClient.ts index 910ce0013b54d..c45936bbf2336 100644 --- a/clients/client-detective/DetectiveClient.ts +++ b/clients/client-detective/DetectiveClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -140,11 +142,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -186,6 +183,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DetectiveClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -194,8 +197,8 @@ export type DetectiveClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DetectiveClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -203,8 +206,8 @@ export type DetectiveClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Detective uses machine learning and purpose-built visualizations to help you analyze and @@ -266,16 +269,16 @@ export class DetectiveClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-detective/runtimeConfig.browser.ts b/clients/client-detective/runtimeConfig.browser.ts index 0239a097a0dc6..219b9dd6966b7 100644 --- a/clients/client-detective/runtimeConfig.browser.ts +++ b/clients/client-detective/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-detective/runtimeConfig.native.ts b/clients/client-detective/runtimeConfig.native.ts index b16fad6b8cde8..ba265876a0169 100644 --- a/clients/client-detective/runtimeConfig.native.ts +++ b/clients/client-detective/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DetectiveClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-detective/runtimeConfig.ts b/clients/client-detective/runtimeConfig.ts index a46f863e1eda3..b222ffeeb9410 100644 --- a/clients/client-detective/runtimeConfig.ts +++ b/clients/client-detective/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-device-farm/DeviceFarmClient.ts b/clients/client-device-farm/DeviceFarmClient.ts index 9a545020b5def..4b9c37654cf5e 100644 --- a/clients/client-device-farm/DeviceFarmClient.ts +++ b/clients/client-device-farm/DeviceFarmClient.ts @@ -208,6 +208,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -218,6 +219,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -425,11 +427,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -471,6 +468,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DeviceFarmClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -479,8 +482,8 @@ export type DeviceFarmClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DeviceFarmClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -488,8 +491,8 @@ export type DeviceFarmClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Welcome to the AWS Device Farm API documentation, which contains APIs for:

@@ -525,16 +528,16 @@ export class DeviceFarmClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-device-farm/runtimeConfig.browser.ts b/clients/client-device-farm/runtimeConfig.browser.ts index 8b7baa2d90dd3..f414ba7f6c0db 100644 --- a/clients/client-device-farm/runtimeConfig.browser.ts +++ b/clients/client-device-farm/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-device-farm/runtimeConfig.native.ts b/clients/client-device-farm/runtimeConfig.native.ts index 50894c54866f9..855933af044d8 100644 --- a/clients/client-device-farm/runtimeConfig.native.ts +++ b/clients/client-device-farm/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DeviceFarmClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-device-farm/runtimeConfig.ts b/clients/client-device-farm/runtimeConfig.ts index 1d2df95bf0539..4fa27268382ab 100644 --- a/clients/client-device-farm/runtimeConfig.ts +++ b/clients/client-device-farm/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-devops-guru/DevOpsGuruClient.ts b/clients/client-devops-guru/DevOpsGuruClient.ts index 358483568cca4..82f024b3d3d81 100644 --- a/clients/client-devops-guru/DevOpsGuruClient.ts +++ b/clients/client-devops-guru/DevOpsGuruClient.ts @@ -89,6 +89,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -99,6 +100,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -188,11 +190,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -234,6 +231,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DevOpsGuruClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -242,8 +245,8 @@ export type DevOpsGuruClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DevOpsGuruClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -251,8 +254,8 @@ export type DevOpsGuruClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; export class DevOpsGuruClient extends __Client< __HttpHandlerOptions, @@ -271,16 +274,16 @@ export class DevOpsGuruClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-devops-guru/runtimeConfig.browser.ts b/clients/client-devops-guru/runtimeConfig.browser.ts index 3d624b5e89fed..00afcbb7c11b2 100644 --- a/clients/client-devops-guru/runtimeConfig.browser.ts +++ b/clients/client-devops-guru/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-devops-guru/runtimeConfig.native.ts b/clients/client-devops-guru/runtimeConfig.native.ts index 00208d07f98a0..19a82d284c7bc 100644 --- a/clients/client-devops-guru/runtimeConfig.native.ts +++ b/clients/client-devops-guru/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DevOpsGuruClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-devops-guru/runtimeConfig.ts b/clients/client-devops-guru/runtimeConfig.ts index 6b10468c3264c..276af2af826a2 100644 --- a/clients/client-devops-guru/runtimeConfig.ts +++ b/clients/client-devops-guru/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-direct-connect/DirectConnectClient.ts b/clients/client-direct-connect/DirectConnectClient.ts index 0bcf7630eb013..59552c3efc88c 100644 --- a/clients/client-direct-connect/DirectConnectClient.ts +++ b/clients/client-direct-connect/DirectConnectClient.ts @@ -211,6 +211,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -221,6 +222,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -386,11 +388,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -432,6 +429,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DirectConnectClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -440,8 +443,8 @@ export type DirectConnectClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DirectConnectClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -449,8 +452,8 @@ export type DirectConnectClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Direct Connect links your internal network to an AWS Direct Connect location over a standard Ethernet fiber-optic cable. @@ -477,16 +480,16 @@ export class DirectConnectClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-direct-connect/runtimeConfig.browser.ts b/clients/client-direct-connect/runtimeConfig.browser.ts index 1a709d07189c6..eed44cacf6950 100644 --- a/clients/client-direct-connect/runtimeConfig.browser.ts +++ b/clients/client-direct-connect/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-direct-connect/runtimeConfig.native.ts b/clients/client-direct-connect/runtimeConfig.native.ts index f3790d49a3e8a..1a4b98cb32c82 100644 --- a/clients/client-direct-connect/runtimeConfig.native.ts +++ b/clients/client-direct-connect/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DirectConnectClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-direct-connect/runtimeConfig.ts b/clients/client-direct-connect/runtimeConfig.ts index de45384040d4f..2217c1c6a46c1 100644 --- a/clients/client-direct-connect/runtimeConfig.ts +++ b/clients/client-direct-connect/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-directory-service/DirectoryServiceClient.ts b/clients/client-directory-service/DirectoryServiceClient.ts index c887f97f61762..06f77d7652f5b 100644 --- a/clients/client-directory-service/DirectoryServiceClient.ts +++ b/clients/client-directory-service/DirectoryServiceClient.ts @@ -178,6 +178,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -188,6 +189,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -365,11 +367,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -411,6 +408,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DirectoryServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -419,8 +422,8 @@ export type DirectoryServiceClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DirectoryServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -428,8 +431,8 @@ export type DirectoryServiceClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Directory Service @@ -456,16 +459,16 @@ export class DirectoryServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-directory-service/runtimeConfig.browser.ts b/clients/client-directory-service/runtimeConfig.browser.ts index 2c144ceb1746e..6e00eb5f0de84 100644 --- a/clients/client-directory-service/runtimeConfig.browser.ts +++ b/clients/client-directory-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-directory-service/runtimeConfig.native.ts b/clients/client-directory-service/runtimeConfig.native.ts index 1feba5c63d243..e82655bb667f9 100644 --- a/clients/client-directory-service/runtimeConfig.native.ts +++ b/clients/client-directory-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DirectoryServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-directory-service/runtimeConfig.ts b/clients/client-directory-service/runtimeConfig.ts index c14456b94afcb..b1e8271a5cc13 100644 --- a/clients/client-directory-service/runtimeConfig.ts +++ b/clients/client-directory-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-dlm/DLMClient.ts b/clients/client-dlm/DLMClient.ts index 862608dea8082..351a8328203e1 100644 --- a/clients/client-dlm/DLMClient.ts +++ b/clients/client-dlm/DLMClient.ts @@ -58,6 +58,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -68,6 +69,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -137,11 +139,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -183,6 +180,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DLMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -191,8 +194,8 @@ export type DLMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DLMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -200,8 +203,8 @@ export type DLMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Data Lifecycle Manager

With Amazon Data Lifecycle Manager, you can manage the lifecycle of your AWS resources. You create lifecycle policies, which are used to automate operations on the specified resources.

Amazon DLM supports Amazon EBS volumes and snapshots. For information about using Amazon DLM with Amazon EBS, see Automating the Amazon EBS Snapshot Lifecycle in the Amazon EC2 User Guide.

@@ -223,16 +226,16 @@ export class DLMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-dlm/runtimeConfig.browser.ts b/clients/client-dlm/runtimeConfig.browser.ts index 734d036d47500..c7d18b08674ff 100644 --- a/clients/client-dlm/runtimeConfig.browser.ts +++ b/clients/client-dlm/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-dlm/runtimeConfig.native.ts b/clients/client-dlm/runtimeConfig.native.ts index 3eb41cac64d8a..2bef215b6595a 100644 --- a/clients/client-dlm/runtimeConfig.native.ts +++ b/clients/client-dlm/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DLMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-dlm/runtimeConfig.ts b/clients/client-dlm/runtimeConfig.ts index 88be42bbdb0eb..74995b2aea80e 100644 --- a/clients/client-dlm/runtimeConfig.ts +++ b/clients/client-dlm/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-docdb/DocDBClient.ts b/clients/client-docdb/DocDBClient.ts index 29f6d45157235..9fb98b3f8f4b3 100644 --- a/clients/client-docdb/DocDBClient.ts +++ b/clients/client-docdb/DocDBClient.ts @@ -164,6 +164,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -174,6 +175,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -311,11 +313,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -357,6 +354,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DocDBClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -365,8 +368,8 @@ export type DocDBClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DocDBClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -374,8 +377,8 @@ export type DocDBClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon DocumentDB API documentation

@@ -397,16 +400,16 @@ export class DocDBClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-docdb/runtimeConfig.browser.ts b/clients/client-docdb/runtimeConfig.browser.ts index c6ce37fec65f6..b798cd4d90329 100644 --- a/clients/client-docdb/runtimeConfig.browser.ts +++ b/clients/client-docdb/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-docdb/runtimeConfig.native.ts b/clients/client-docdb/runtimeConfig.native.ts index 3ad2a39f55414..bf5339ed2558a 100644 --- a/clients/client-docdb/runtimeConfig.native.ts +++ b/clients/client-docdb/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DocDBClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-docdb/runtimeConfig.ts b/clients/client-docdb/runtimeConfig.ts index 5e82f963d1fea..e045fafaeb638 100644 --- a/clients/client-docdb/runtimeConfig.ts +++ b/clients/client-docdb/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-dynamodb-streams/DynamoDBStreamsClient.ts b/clients/client-dynamodb-streams/DynamoDBStreamsClient.ts index 2763f483a0f19..53b59d9d5a569 100644 --- a/clients/client-dynamodb-streams/DynamoDBStreamsClient.ts +++ b/clients/client-dynamodb-streams/DynamoDBStreamsClient.ts @@ -39,6 +39,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -49,6 +50,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -110,11 +112,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -156,6 +153,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DynamoDBStreamsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -164,8 +167,8 @@ export type DynamoDBStreamsClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DynamoDBStreamsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -173,8 +176,8 @@ export type DynamoDBStreamsClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon DynamoDB @@ -201,16 +204,16 @@ export class DynamoDBStreamsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-dynamodb-streams/runtimeConfig.browser.ts b/clients/client-dynamodb-streams/runtimeConfig.browser.ts index a669444fa9212..5fda2a9dc204c 100644 --- a/clients/client-dynamodb-streams/runtimeConfig.browser.ts +++ b/clients/client-dynamodb-streams/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-dynamodb-streams/runtimeConfig.native.ts b/clients/client-dynamodb-streams/runtimeConfig.native.ts index 1acb3d688fbab..9e84dfbab8f52 100644 --- a/clients/client-dynamodb-streams/runtimeConfig.native.ts +++ b/clients/client-dynamodb-streams/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DynamoDBStreamsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-dynamodb-streams/runtimeConfig.ts b/clients/client-dynamodb-streams/runtimeConfig.ts index 3338b79dcebdf..69a230c523b74 100644 --- a/clients/client-dynamodb-streams/runtimeConfig.ts +++ b/clients/client-dynamodb-streams/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-dynamodb/DynamoDBClient.ts b/clients/client-dynamodb/DynamoDBClient.ts index 9aa68921402f7..58a3aefeafa33 100644 --- a/clients/client-dynamodb/DynamoDBClient.ts +++ b/clients/client-dynamodb/DynamoDBClient.ts @@ -136,6 +136,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -146,6 +147,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -299,11 +301,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -345,6 +342,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DynamoDBClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -353,8 +356,8 @@ export type DynamoDBClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DynamoDBClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -362,8 +365,8 @@ export type DynamoDBClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon DynamoDB @@ -403,16 +406,16 @@ export class DynamoDBClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-dynamodb/runtimeConfig.browser.ts b/clients/client-dynamodb/runtimeConfig.browser.ts index 8e14698997938..093f0fc12ba80 100644 --- a/clients/client-dynamodb/runtimeConfig.browser.ts +++ b/clients/client-dynamodb/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-dynamodb/runtimeConfig.native.ts b/clients/client-dynamodb/runtimeConfig.native.ts index f015139582b9d..4435dd96ded20 100644 --- a/clients/client-dynamodb/runtimeConfig.native.ts +++ b/clients/client-dynamodb/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DynamoDBClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-dynamodb/runtimeConfig.ts b/clients/client-dynamodb/runtimeConfig.ts index 80e1f5a134398..14681c204b666 100644 --- a/clients/client-dynamodb/runtimeConfig.ts +++ b/clients/client-dynamodb/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ebs/EBSClient.ts b/clients/client-ebs/EBSClient.ts index e76e91cb964c3..5f300b2a60ece 100644 --- a/clients/client-ebs/EBSClient.ts +++ b/clients/client-ebs/EBSClient.ts @@ -41,6 +41,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -51,6 +52,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -116,11 +118,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -162,6 +159,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type EBSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -170,8 +173,8 @@ export type EBSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EBSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -179,8 +182,8 @@ export type EBSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

You can use the Amazon Elastic Block Store (Amazon EBS) direct APIs to create EBS snapshots, write data directly to @@ -221,16 +224,16 @@ export class EBSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ebs/runtimeConfig.browser.ts b/clients/client-ebs/runtimeConfig.browser.ts index 56236077f9b98..b70adb2b1f954 100644 --- a/clients/client-ebs/runtimeConfig.browser.ts +++ b/clients/client-ebs/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ebs/runtimeConfig.native.ts b/clients/client-ebs/runtimeConfig.native.ts index 45a219b271f69..d33457a7b13c4 100644 --- a/clients/client-ebs/runtimeConfig.native.ts +++ b/clients/client-ebs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EBSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ebs/runtimeConfig.ts b/clients/client-ebs/runtimeConfig.ts index 4c73edb206eae..09ab2fbae7d42 100644 --- a/clients/client-ebs/runtimeConfig.ts +++ b/clients/client-ebs/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ec2-instance-connect/EC2InstanceConnectClient.ts b/clients/client-ec2-instance-connect/EC2InstanceConnectClient.ts index 6d2832b833a15..05560eb7612b7 100644 --- a/clients/client-ec2-instance-connect/EC2InstanceConnectClient.ts +++ b/clients/client-ec2-instance-connect/EC2InstanceConnectClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = SendSSHPublicKeyCommandInput; @@ -99,11 +101,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -145,6 +142,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type EC2InstanceConnectClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -153,8 +156,8 @@ export type EC2InstanceConnectClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EC2InstanceConnectClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -162,8 +165,8 @@ export type EC2InstanceConnectClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS EC2 Connect Service is a service that enables system administrators to publish @@ -187,16 +190,16 @@ export class EC2InstanceConnectClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ec2-instance-connect/runtimeConfig.browser.ts b/clients/client-ec2-instance-connect/runtimeConfig.browser.ts index 27ffa0dacd2f8..f7cc2a8563e55 100644 --- a/clients/client-ec2-instance-connect/runtimeConfig.browser.ts +++ b/clients/client-ec2-instance-connect/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ec2-instance-connect/runtimeConfig.native.ts b/clients/client-ec2-instance-connect/runtimeConfig.native.ts index a8c90fe154563..ac0aa39a7d0a9 100644 --- a/clients/client-ec2-instance-connect/runtimeConfig.native.ts +++ b/clients/client-ec2-instance-connect/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EC2InstanceConnectClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ec2-instance-connect/runtimeConfig.ts b/clients/client-ec2-instance-connect/runtimeConfig.ts index dc88e54cfc039..d4b27beeb062b 100644 --- a/clients/client-ec2-instance-connect/runtimeConfig.ts +++ b/clients/client-ec2-instance-connect/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ec2/EC2Client.ts b/clients/client-ec2/EC2Client.ts index 9e487fd8986a4..87d9becfd0685 100644 --- a/clients/client-ec2/EC2Client.ts +++ b/clients/client-ec2/EC2Client.ts @@ -1492,6 +1492,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -1502,6 +1503,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -2435,11 +2437,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -2481,6 +2478,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type EC2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -2489,8 +2492,8 @@ export type EC2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EC2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -2498,8 +2501,8 @@ export type EC2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Elastic Compute Cloud @@ -2543,16 +2546,16 @@ export class EC2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ec2/runtimeConfig.browser.ts b/clients/client-ec2/runtimeConfig.browser.ts index f25edc10f29bd..3dc145d0bb6de 100644 --- a/clients/client-ec2/runtimeConfig.browser.ts +++ b/clients/client-ec2/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ec2/runtimeConfig.native.ts b/clients/client-ec2/runtimeConfig.native.ts index 8f7b7fcc1d8f5..8f7c4b5e69945 100644 --- a/clients/client-ec2/runtimeConfig.native.ts +++ b/clients/client-ec2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EC2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ec2/runtimeConfig.ts b/clients/client-ec2/runtimeConfig.ts index e087b571b3030..684c522fe20ce 100644 --- a/clients/client-ec2/runtimeConfig.ts +++ b/clients/client-ec2/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ecr-public/ECRPUBLICClient.ts b/clients/client-ecr-public/ECRPUBLICClient.ts index 48aa5564403f4..838a36bef7007 100644 --- a/clients/client-ecr-public/ECRPUBLICClient.ts +++ b/clients/client-ecr-public/ECRPUBLICClient.ts @@ -91,6 +91,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -101,6 +102,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -194,11 +196,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -240,6 +237,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ECRPUBLICClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -248,8 +251,8 @@ export type ECRPUBLICClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ECRPUBLICClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -257,8 +260,8 @@ export type ECRPUBLICClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Elastic Container Registry Public @@ -286,16 +289,16 @@ export class ECRPUBLICClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ecr-public/runtimeConfig.browser.ts b/clients/client-ecr-public/runtimeConfig.browser.ts index 5e3675eab6a16..29935a75d326a 100644 --- a/clients/client-ecr-public/runtimeConfig.browser.ts +++ b/clients/client-ecr-public/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ecr-public/runtimeConfig.native.ts b/clients/client-ecr-public/runtimeConfig.native.ts index 97909e5f0316d..a772a48bb7d33 100644 --- a/clients/client-ecr-public/runtimeConfig.native.ts +++ b/clients/client-ecr-public/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ECRPUBLICClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ecr-public/runtimeConfig.ts b/clients/client-ecr-public/runtimeConfig.ts index f8589fd728f51..e6f9ec1661100 100644 --- a/clients/client-ecr-public/runtimeConfig.ts +++ b/clients/client-ecr-public/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ecr/ECRClient.ts b/clients/client-ecr/ECRClient.ts index 600e6eefadf6e..325b7cad6e641 100644 --- a/clients/client-ecr/ECRClient.ts +++ b/clients/client-ecr/ECRClient.ts @@ -123,6 +123,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -133,6 +134,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -254,11 +256,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -300,6 +297,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ECRClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -308,8 +311,8 @@ export type ECRClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ECRClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -317,8 +320,8 @@ export type ECRClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Elastic Container Registry @@ -346,16 +349,16 @@ export class ECRClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ecr/runtimeConfig.browser.ts b/clients/client-ecr/runtimeConfig.browser.ts index c200a5e3fd9da..e395d392ca813 100644 --- a/clients/client-ecr/runtimeConfig.browser.ts +++ b/clients/client-ecr/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ecr/runtimeConfig.native.ts b/clients/client-ecr/runtimeConfig.native.ts index eef2372a336c2..a4e6e46a060ff 100644 --- a/clients/client-ecr/runtimeConfig.native.ts +++ b/clients/client-ecr/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ECRClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ecr/runtimeConfig.ts b/clients/client-ecr/runtimeConfig.ts index 2bad181d3b209..43f649852ff0c 100644 --- a/clients/client-ecr/runtimeConfig.ts +++ b/clients/client-ecr/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ecs/ECSClient.ts b/clients/client-ecs/ECSClient.ts index 400c917f0fb45..8a76fc3a75a69 100644 --- a/clients/client-ecs/ECSClient.ts +++ b/clients/client-ecs/ECSClient.ts @@ -163,6 +163,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -173,6 +174,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -326,11 +328,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -372,6 +369,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ECSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -380,8 +383,8 @@ export type ECSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ECSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -389,8 +392,8 @@ export type ECSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Elastic Container Service @@ -426,16 +429,16 @@ export class ECSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ecs/runtimeConfig.browser.ts b/clients/client-ecs/runtimeConfig.browser.ts index 308e028f2e72c..f21c330e793a1 100644 --- a/clients/client-ecs/runtimeConfig.browser.ts +++ b/clients/client-ecs/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ecs/runtimeConfig.native.ts b/clients/client-ecs/runtimeConfig.native.ts index 0339c7eae4a8a..f7fadafb32190 100644 --- a/clients/client-ecs/runtimeConfig.native.ts +++ b/clients/client-ecs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ECSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ecs/runtimeConfig.ts b/clients/client-ecs/runtimeConfig.ts index d519403c91b5c..6ca77ee96dbbb 100644 --- a/clients/client-ecs/runtimeConfig.ts +++ b/clients/client-ecs/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-efs/EFSClient.ts b/clients/client-efs/EFSClient.ts index 0559eeac3e123..0f7e7a343aa3d 100644 --- a/clients/client-efs/EFSClient.ts +++ b/clients/client-efs/EFSClient.ts @@ -96,6 +96,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -106,6 +107,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -209,11 +211,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -255,6 +252,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type EFSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -263,8 +266,8 @@ export type EFSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EFSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -272,8 +275,8 @@ export type EFSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Elastic File System @@ -299,16 +302,16 @@ export class EFSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-efs/runtimeConfig.browser.ts b/clients/client-efs/runtimeConfig.browser.ts index 3b747ea08dd72..a0f96ef370d3d 100644 --- a/clients/client-efs/runtimeConfig.browser.ts +++ b/clients/client-efs/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-efs/runtimeConfig.native.ts b/clients/client-efs/runtimeConfig.native.ts index ad1cccea4b598..bdaa689854fe8 100644 --- a/clients/client-efs/runtimeConfig.native.ts +++ b/clients/client-efs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EFSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-efs/runtimeConfig.ts b/clients/client-efs/runtimeConfig.ts index e47ff76c0d555..a5776084f7c8d 100644 --- a/clients/client-efs/runtimeConfig.ts +++ b/clients/client-efs/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-eks/EKSClient.ts b/clients/client-eks/EKSClient.ts index 22b8b403ddfa2..0ff62f5dabe88 100644 --- a/clients/client-eks/EKSClient.ts +++ b/clients/client-eks/EKSClient.ts @@ -92,6 +92,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -102,6 +103,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -209,11 +211,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -255,6 +252,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type EKSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -263,8 +266,8 @@ export type EKSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EKSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -272,8 +275,8 @@ export type EKSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Elastic Kubernetes Service (Amazon EKS) is a managed service that makes it easy for you to run Kubernetes on @@ -304,16 +307,16 @@ export class EKSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-eks/runtimeConfig.browser.ts b/clients/client-eks/runtimeConfig.browser.ts index 075359b1e4ac1..18bdde866615b 100644 --- a/clients/client-eks/runtimeConfig.browser.ts +++ b/clients/client-eks/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-eks/runtimeConfig.native.ts b/clients/client-eks/runtimeConfig.native.ts index c24b5017a2823..25e1dd3904258 100644 --- a/clients/client-eks/runtimeConfig.native.ts +++ b/clients/client-eks/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EKSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-eks/runtimeConfig.ts b/clients/client-eks/runtimeConfig.ts index 679ea0f0c8753..0eb66798a8458 100644 --- a/clients/client-eks/runtimeConfig.ts +++ b/clients/client-eks/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elastic-beanstalk/ElasticBeanstalkClient.ts b/clients/client-elastic-beanstalk/ElasticBeanstalkClient.ts index 5693c39f3bd6c..834bb4397ecc0 100644 --- a/clients/client-elastic-beanstalk/ElasticBeanstalkClient.ts +++ b/clients/client-elastic-beanstalk/ElasticBeanstalkClient.ts @@ -199,6 +199,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -209,6 +210,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -356,11 +358,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -402,6 +399,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ElasticBeanstalkClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -410,8 +413,8 @@ export type ElasticBeanstalkClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElasticBeanstalkClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -419,8 +422,8 @@ export type ElasticBeanstalkClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Elastic Beanstalk @@ -456,16 +459,16 @@ export class ElasticBeanstalkClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elastic-beanstalk/runtimeConfig.browser.ts b/clients/client-elastic-beanstalk/runtimeConfig.browser.ts index c3d616c549fec..64f164662460d 100644 --- a/clients/client-elastic-beanstalk/runtimeConfig.browser.ts +++ b/clients/client-elastic-beanstalk/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elastic-beanstalk/runtimeConfig.native.ts b/clients/client-elastic-beanstalk/runtimeConfig.native.ts index 848ae9a1aa504..b51ffcdb93fe5 100644 --- a/clients/client-elastic-beanstalk/runtimeConfig.native.ts +++ b/clients/client-elastic-beanstalk/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElasticBeanstalkClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elastic-beanstalk/runtimeConfig.ts b/clients/client-elastic-beanstalk/runtimeConfig.ts index a22e1a8cb295e..1ef80ff67beca 100644 --- a/clients/client-elastic-beanstalk/runtimeConfig.ts +++ b/clients/client-elastic-beanstalk/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elastic-inference/ElasticInferenceClient.ts b/clients/client-elastic-inference/ElasticInferenceClient.ts index 81cd7e208243a..9ab50794b955f 100644 --- a/clients/client-elastic-inference/ElasticInferenceClient.ts +++ b/clients/client-elastic-inference/ElasticInferenceClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -128,11 +130,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -174,6 +171,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ElasticInferenceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -182,8 +185,8 @@ export type ElasticInferenceClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElasticInferenceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -191,8 +194,8 @@ export type ElasticInferenceClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -216,16 +219,16 @@ export class ElasticInferenceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elastic-inference/runtimeConfig.browser.ts b/clients/client-elastic-inference/runtimeConfig.browser.ts index b87fe5e3bc676..e3ecfb81266ae 100644 --- a/clients/client-elastic-inference/runtimeConfig.browser.ts +++ b/clients/client-elastic-inference/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elastic-inference/runtimeConfig.native.ts b/clients/client-elastic-inference/runtimeConfig.native.ts index f11ac3fdcf14c..ffa246b21f4d1 100644 --- a/clients/client-elastic-inference/runtimeConfig.native.ts +++ b/clients/client-elastic-inference/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElasticInferenceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elastic-inference/runtimeConfig.ts b/clients/client-elastic-inference/runtimeConfig.ts index a5ed0615a7290..bb011ced5b636 100644 --- a/clients/client-elastic-inference/runtimeConfig.ts +++ b/clients/client-elastic-inference/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elastic-load-balancing-v2/ElasticLoadBalancingV2Client.ts b/clients/client-elastic-load-balancing-v2/ElasticLoadBalancingV2Client.ts index 3df53c955dabf..5fecbd8e3c93f 100644 --- a/clients/client-elastic-load-balancing-v2/ElasticLoadBalancingV2Client.ts +++ b/clients/client-elastic-load-balancing-v2/ElasticLoadBalancingV2Client.ts @@ -105,6 +105,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -115,6 +116,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -236,11 +238,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -282,6 +279,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ElasticLoadBalancingV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -290,8 +293,8 @@ export type ElasticLoadBalancingV2ClientConfig = Partial<__SmithyConfiguration<_ EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElasticLoadBalancingV2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -299,8 +302,8 @@ export type ElasticLoadBalancingV2ClientResolvedConfig = __SmithyResolvedConfigu EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Elastic Load Balancing @@ -357,16 +360,16 @@ export class ElasticLoadBalancingV2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elastic-load-balancing-v2/runtimeConfig.browser.ts b/clients/client-elastic-load-balancing-v2/runtimeConfig.browser.ts index 58ba193eaf5ac..5df8844376630 100644 --- a/clients/client-elastic-load-balancing-v2/runtimeConfig.browser.ts +++ b/clients/client-elastic-load-balancing-v2/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elastic-load-balancing-v2/runtimeConfig.native.ts b/clients/client-elastic-load-balancing-v2/runtimeConfig.native.ts index d52871de013ab..2597bd5ec8483 100644 --- a/clients/client-elastic-load-balancing-v2/runtimeConfig.native.ts +++ b/clients/client-elastic-load-balancing-v2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElasticLoadBalancingV2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elastic-load-balancing-v2/runtimeConfig.ts b/clients/client-elastic-load-balancing-v2/runtimeConfig.ts index c3a2a71bef9a3..05db6ebf3a752 100644 --- a/clients/client-elastic-load-balancing-v2/runtimeConfig.ts +++ b/clients/client-elastic-load-balancing-v2/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elastic-load-balancing/ElasticLoadBalancingClient.ts b/clients/client-elastic-load-balancing/ElasticLoadBalancingClient.ts index b6be7c06db5ec..7f5cf74a6b8bd 100644 --- a/clients/client-elastic-load-balancing/ElasticLoadBalancingClient.ts +++ b/clients/client-elastic-load-balancing/ElasticLoadBalancingClient.ts @@ -136,6 +136,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -146,6 +147,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -257,11 +259,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -303,6 +300,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ElasticLoadBalancingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -311,8 +314,8 @@ export type ElasticLoadBalancingClientConfig = Partial<__SmithyConfiguration<__H EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElasticLoadBalancingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -320,8 +323,8 @@ export type ElasticLoadBalancingClientResolvedConfig = __SmithyResolvedConfigura EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Elastic Load Balancing @@ -363,16 +366,16 @@ export class ElasticLoadBalancingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elastic-load-balancing/runtimeConfig.browser.ts b/clients/client-elastic-load-balancing/runtimeConfig.browser.ts index da5081073853b..38a78b1d37fa9 100644 --- a/clients/client-elastic-load-balancing/runtimeConfig.browser.ts +++ b/clients/client-elastic-load-balancing/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elastic-load-balancing/runtimeConfig.native.ts b/clients/client-elastic-load-balancing/runtimeConfig.native.ts index e19210d6be4be..059b51de5f3b1 100644 --- a/clients/client-elastic-load-balancing/runtimeConfig.native.ts +++ b/clients/client-elastic-load-balancing/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElasticLoadBalancingClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elastic-load-balancing/runtimeConfig.ts b/clients/client-elastic-load-balancing/runtimeConfig.ts index 7df45914a3cb4..491bd5a3d3b21 100644 --- a/clients/client-elastic-load-balancing/runtimeConfig.ts +++ b/clients/client-elastic-load-balancing/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elastic-transcoder/ElasticTranscoderClient.ts b/clients/client-elastic-transcoder/ElasticTranscoderClient.ts index f8066930c345c..ce21d89b50162 100644 --- a/clients/client-elastic-transcoder/ElasticTranscoderClient.ts +++ b/clients/client-elastic-transcoder/ElasticTranscoderClient.ts @@ -58,6 +58,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -68,6 +69,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -155,11 +157,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -201,6 +198,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ElasticTranscoderClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -209,8 +212,8 @@ export type ElasticTranscoderClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElasticTranscoderClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -218,8 +221,8 @@ export type ElasticTranscoderClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Elastic Transcoder Service @@ -242,16 +245,16 @@ export class ElasticTranscoderClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elastic-transcoder/runtimeConfig.browser.ts b/clients/client-elastic-transcoder/runtimeConfig.browser.ts index a4f866dab231b..f042639ee7cb5 100644 --- a/clients/client-elastic-transcoder/runtimeConfig.browser.ts +++ b/clients/client-elastic-transcoder/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elastic-transcoder/runtimeConfig.native.ts b/clients/client-elastic-transcoder/runtimeConfig.native.ts index 5420df3ac78bb..7508161f44110 100644 --- a/clients/client-elastic-transcoder/runtimeConfig.native.ts +++ b/clients/client-elastic-transcoder/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElasticTranscoderClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elastic-transcoder/runtimeConfig.ts b/clients/client-elastic-transcoder/runtimeConfig.ts index a401f1692959c..beb232943384d 100644 --- a/clients/client-elastic-transcoder/runtimeConfig.ts +++ b/clients/client-elastic-transcoder/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elasticache/ElastiCacheClient.ts b/clients/client-elasticache/ElastiCacheClient.ts index 43530a2d25e33..487710dc9a6b8 100644 --- a/clients/client-elasticache/ElastiCacheClient.ts +++ b/clients/client-elasticache/ElastiCacheClient.ts @@ -232,6 +232,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -242,6 +243,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -425,11 +427,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -471,6 +468,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ElastiCacheClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -479,8 +482,8 @@ export type ElastiCacheClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElastiCacheClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -488,8 +491,8 @@ export type ElastiCacheClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon ElastiCache @@ -520,16 +523,16 @@ export class ElastiCacheClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elasticache/runtimeConfig.browser.ts b/clients/client-elasticache/runtimeConfig.browser.ts index f4b6fcd4a184d..53ab8ea46797c 100644 --- a/clients/client-elasticache/runtimeConfig.browser.ts +++ b/clients/client-elasticache/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elasticache/runtimeConfig.native.ts b/clients/client-elasticache/runtimeConfig.native.ts index 8e7ad69a6ef2a..5a2513da9eb91 100644 --- a/clients/client-elasticache/runtimeConfig.native.ts +++ b/clients/client-elasticache/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElastiCacheClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elasticache/runtimeConfig.ts b/clients/client-elasticache/runtimeConfig.ts index a16e31a99c422..ae388c85f8095 100644 --- a/clients/client-elasticache/runtimeConfig.ts +++ b/clients/client-elasticache/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elasticsearch-service/ElasticsearchServiceClient.ts b/clients/client-elasticsearch-service/ElasticsearchServiceClient.ts index baadc5e34cde0..aba7112e22443 100644 --- a/clients/client-elasticsearch-service/ElasticsearchServiceClient.ts +++ b/clients/client-elasticsearch-service/ElasticsearchServiceClient.ts @@ -155,6 +155,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -165,6 +166,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -296,11 +298,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -342,6 +339,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ElasticsearchServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -350,8 +353,8 @@ export type ElasticsearchServiceClientConfig = Partial<__SmithyConfiguration<__H EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElasticsearchServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -359,8 +362,8 @@ export type ElasticsearchServiceClientResolvedConfig = __SmithyResolvedConfigura EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Elasticsearch Configuration Service @@ -388,16 +391,16 @@ export class ElasticsearchServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elasticsearch-service/runtimeConfig.browser.ts b/clients/client-elasticsearch-service/runtimeConfig.browser.ts index 5d127229beea5..370d87d917370 100644 --- a/clients/client-elasticsearch-service/runtimeConfig.browser.ts +++ b/clients/client-elasticsearch-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elasticsearch-service/runtimeConfig.native.ts b/clients/client-elasticsearch-service/runtimeConfig.native.ts index 263f5a6fc63ca..a3c881d65a177 100644 --- a/clients/client-elasticsearch-service/runtimeConfig.native.ts +++ b/clients/client-elasticsearch-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElasticsearchServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elasticsearch-service/runtimeConfig.ts b/clients/client-elasticsearch-service/runtimeConfig.ts index eae4a9f996ed6..e13164eaf863b 100644 --- a/clients/client-elasticsearch-service/runtimeConfig.ts +++ b/clients/client-elasticsearch-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-emr-containers/EMRContainersClient.ts b/clients/client-emr-containers/EMRContainersClient.ts index ddbead9ea10de..2d688e4f9b24e 100644 --- a/clients/client-emr-containers/EMRContainersClient.ts +++ b/clients/client-emr-containers/EMRContainersClient.ts @@ -77,6 +77,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -87,6 +88,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type EMRContainersClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +227,8 @@ export type EMRContainersClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EMRContainersClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +236,8 @@ export type EMRContainersClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon EMR on EKS provides a deployment option for Amazon EMR that allows you to run @@ -277,16 +280,16 @@ export class EMRContainersClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-emr-containers/runtimeConfig.browser.ts b/clients/client-emr-containers/runtimeConfig.browser.ts index 8260c2acd9180..3f4b5cb15c733 100644 --- a/clients/client-emr-containers/runtimeConfig.browser.ts +++ b/clients/client-emr-containers/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-emr-containers/runtimeConfig.native.ts b/clients/client-emr-containers/runtimeConfig.native.ts index a106dbb795dc4..622b9b9b986ca 100644 --- a/clients/client-emr-containers/runtimeConfig.native.ts +++ b/clients/client-emr-containers/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EMRContainersClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-emr-containers/runtimeConfig.ts b/clients/client-emr-containers/runtimeConfig.ts index 1cc9bddbe4fe2..da96716ffe2d0 100644 --- a/clients/client-emr-containers/runtimeConfig.ts +++ b/clients/client-emr-containers/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-emr/EMRClient.ts b/clients/client-emr/EMRClient.ts index 2e43d3ff4e38a..fa4ba173112e6 100644 --- a/clients/client-emr/EMRClient.ts +++ b/clients/client-emr/EMRClient.ts @@ -156,6 +156,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -166,6 +167,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -311,11 +313,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -357,6 +354,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type EMRClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -365,8 +368,8 @@ export type EMRClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EMRClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -374,8 +377,8 @@ export type EMRClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon EMR is a web service that makes it easier to process large amounts of data @@ -400,16 +403,16 @@ export class EMRClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-emr/runtimeConfig.browser.ts b/clients/client-emr/runtimeConfig.browser.ts index 394b91541f3b9..7c3cad005a10b 100644 --- a/clients/client-emr/runtimeConfig.browser.ts +++ b/clients/client-emr/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-emr/runtimeConfig.native.ts b/clients/client-emr/runtimeConfig.native.ts index baf9056f41d2d..5c15ca853b4a4 100644 --- a/clients/client-emr/runtimeConfig.native.ts +++ b/clients/client-emr/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EMRClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-emr/runtimeConfig.ts b/clients/client-emr/runtimeConfig.ts index 29b1438f6c255..3c11e1b39eeee 100644 --- a/clients/client-emr/runtimeConfig.ts +++ b/clients/client-emr/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-eventbridge/EventBridgeClient.ts b/clients/client-eventbridge/EventBridgeClient.ts index 699424f30b108..7cdd24db70ad3 100644 --- a/clients/client-eventbridge/EventBridgeClient.ts +++ b/clients/client-eventbridge/EventBridgeClient.ts @@ -105,6 +105,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -115,6 +116,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -248,11 +250,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -294,6 +291,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type EventBridgeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -302,8 +305,8 @@ export type EventBridgeClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EventBridgeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -311,8 +314,8 @@ export type EventBridgeClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon EventBridge helps you to respond to state changes in your AWS resources. @@ -355,16 +358,16 @@ export class EventBridgeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-eventbridge/runtimeConfig.browser.ts b/clients/client-eventbridge/runtimeConfig.browser.ts index 52c92b281eebf..1cc11b027edb0 100644 --- a/clients/client-eventbridge/runtimeConfig.browser.ts +++ b/clients/client-eventbridge/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-eventbridge/runtimeConfig.native.ts b/clients/client-eventbridge/runtimeConfig.native.ts index 0e5f70f3a1488..11ea8c3096291 100644 --- a/clients/client-eventbridge/runtimeConfig.native.ts +++ b/clients/client-eventbridge/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EventBridgeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-eventbridge/runtimeConfig.ts b/clients/client-eventbridge/runtimeConfig.ts index 49ab30278bb46..020563b9044b6 100644 --- a/clients/client-eventbridge/runtimeConfig.ts +++ b/clients/client-eventbridge/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-firehose/FirehoseClient.ts b/clients/client-firehose/FirehoseClient.ts index 6cbe7c6f6d1a5..df04fb67ab080 100644 --- a/clients/client-firehose/FirehoseClient.ts +++ b/clients/client-firehose/FirehoseClient.ts @@ -71,6 +71,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -81,6 +82,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -158,11 +160,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -204,6 +201,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type FirehoseClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -212,8 +215,8 @@ export type FirehoseClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type FirehoseClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -221,8 +224,8 @@ export type FirehoseClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Kinesis Data Firehose API Reference @@ -247,16 +250,16 @@ export class FirehoseClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-firehose/runtimeConfig.browser.ts b/clients/client-firehose/runtimeConfig.browser.ts index 14b92e169ad6d..4055fed137ae8 100644 --- a/clients/client-firehose/runtimeConfig.browser.ts +++ b/clients/client-firehose/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-firehose/runtimeConfig.native.ts b/clients/client-firehose/runtimeConfig.native.ts index 56e99155daabf..85ff7de04da06 100644 --- a/clients/client-firehose/runtimeConfig.native.ts +++ b/clients/client-firehose/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./FirehoseClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-firehose/runtimeConfig.ts b/clients/client-firehose/runtimeConfig.ts index 53ec05d589dbe..69e3291faf572 100644 --- a/clients/client-firehose/runtimeConfig.ts +++ b/clients/client-firehose/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-fms/FMSClient.ts b/clients/client-fms/FMSClient.ts index 83254b13b24a0..2a4d8270d117b 100644 --- a/clients/client-fms/FMSClient.ts +++ b/clients/client-fms/FMSClient.ts @@ -94,6 +94,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -104,6 +105,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -209,11 +211,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -255,6 +252,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type FMSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -263,8 +266,8 @@ export type FMSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type FMSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -272,8 +275,8 @@ export type FMSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Firewall Manager @@ -302,16 +305,16 @@ export class FMSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-fms/runtimeConfig.browser.ts b/clients/client-fms/runtimeConfig.browser.ts index 86365b3512e99..d37950073f386 100644 --- a/clients/client-fms/runtimeConfig.browser.ts +++ b/clients/client-fms/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-fms/runtimeConfig.native.ts b/clients/client-fms/runtimeConfig.native.ts index 2881bc1eeb16c..06fae71ba3bf9 100644 --- a/clients/client-fms/runtimeConfig.native.ts +++ b/clients/client-fms/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./FMSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-fms/runtimeConfig.ts b/clients/client-fms/runtimeConfig.ts index 73908a670ecf8..274b16144f9d1 100644 --- a/clients/client-fms/runtimeConfig.ts +++ b/clients/client-fms/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-forecast/ForecastClient.ts b/clients/client-forecast/ForecastClient.ts index 421dda3d183df..f22437f7aa1b4 100644 --- a/clients/client-forecast/ForecastClient.ts +++ b/clients/client-forecast/ForecastClient.ts @@ -110,6 +110,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -120,6 +121,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -239,11 +241,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -285,6 +282,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ForecastClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -293,8 +296,8 @@ export type ForecastClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ForecastClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -302,8 +305,8 @@ export type ForecastClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Provides APIs for creating and managing Amazon Forecast resources.

@@ -325,16 +328,16 @@ export class ForecastClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-forecast/runtimeConfig.browser.ts b/clients/client-forecast/runtimeConfig.browser.ts index 761e437655209..eadbbca2134c8 100644 --- a/clients/client-forecast/runtimeConfig.browser.ts +++ b/clients/client-forecast/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-forecast/runtimeConfig.native.ts b/clients/client-forecast/runtimeConfig.native.ts index 152d020ae81c3..8fc2abba31ea2 100644 --- a/clients/client-forecast/runtimeConfig.native.ts +++ b/clients/client-forecast/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ForecastClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-forecast/runtimeConfig.ts b/clients/client-forecast/runtimeConfig.ts index 21856457fadc0..7b5ea3dfdd9ff 100644 --- a/clients/client-forecast/runtimeConfig.ts +++ b/clients/client-forecast/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-forecastquery/ForecastqueryClient.ts b/clients/client-forecastquery/ForecastqueryClient.ts index 38503bdb5c2ab..015f3d7578eb4 100644 --- a/clients/client-forecastquery/ForecastqueryClient.ts +++ b/clients/client-forecastquery/ForecastqueryClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = QueryForecastCommandInput; @@ -99,11 +101,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -145,6 +142,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ForecastqueryClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -153,8 +156,8 @@ export type ForecastqueryClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ForecastqueryClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -162,8 +165,8 @@ export type ForecastqueryClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Provides APIs for creating and managing Amazon Forecast resources.

@@ -185,16 +188,16 @@ export class ForecastqueryClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-forecastquery/runtimeConfig.browser.ts b/clients/client-forecastquery/runtimeConfig.browser.ts index 8156913b6fdf0..68db5d5a774dc 100644 --- a/clients/client-forecastquery/runtimeConfig.browser.ts +++ b/clients/client-forecastquery/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-forecastquery/runtimeConfig.native.ts b/clients/client-forecastquery/runtimeConfig.native.ts index 98bec5c1d37f3..5a99514c36bfc 100644 --- a/clients/client-forecastquery/runtimeConfig.native.ts +++ b/clients/client-forecastquery/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ForecastqueryClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-forecastquery/runtimeConfig.ts b/clients/client-forecastquery/runtimeConfig.ts index 1de92622a3d40..d72cd6e6dedf3 100644 --- a/clients/client-forecastquery/runtimeConfig.ts +++ b/clients/client-forecastquery/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-frauddetector/FraudDetectorClient.ts b/clients/client-frauddetector/FraudDetectorClient.ts index 4e3749f0e5bc7..35deff79a605d 100644 --- a/clients/client-frauddetector/FraudDetectorClient.ts +++ b/clients/client-frauddetector/FraudDetectorClient.ts @@ -124,6 +124,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -134,6 +135,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -293,11 +295,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -339,6 +336,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type FraudDetectorClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -347,8 +350,8 @@ export type FraudDetectorClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type FraudDetectorClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -356,8 +359,8 @@ export type FraudDetectorClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This is the Amazon Fraud Detector API Reference. This guide is for developers who need @@ -381,16 +384,16 @@ export class FraudDetectorClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-frauddetector/runtimeConfig.browser.ts b/clients/client-frauddetector/runtimeConfig.browser.ts index 142e9e3b8098a..1909b62ecccf3 100644 --- a/clients/client-frauddetector/runtimeConfig.browser.ts +++ b/clients/client-frauddetector/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-frauddetector/runtimeConfig.native.ts b/clients/client-frauddetector/runtimeConfig.native.ts index ed6f21b6f56a2..ffeddbcfa5587 100644 --- a/clients/client-frauddetector/runtimeConfig.native.ts +++ b/clients/client-frauddetector/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./FraudDetectorClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-frauddetector/runtimeConfig.ts b/clients/client-frauddetector/runtimeConfig.ts index 8c169c22c4637..f81aeea6b0cd1 100644 --- a/clients/client-frauddetector/runtimeConfig.ts +++ b/clients/client-frauddetector/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-fsx/FSxClient.ts b/clients/client-fsx/FSxClient.ts index e499b7221bc79..093996384cfdc 100644 --- a/clients/client-fsx/FSxClient.ts +++ b/clients/client-fsx/FSxClient.ts @@ -79,6 +79,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -89,6 +90,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -176,11 +178,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -222,6 +219,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type FSxClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -230,8 +233,8 @@ export type FSxClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type FSxClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -239,8 +242,8 @@ export type FSxClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon FSx is a fully managed service that makes it easy for storage and @@ -263,16 +266,16 @@ export class FSxClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-fsx/runtimeConfig.browser.ts b/clients/client-fsx/runtimeConfig.browser.ts index 7f485db76e085..656d5f2ecfadc 100644 --- a/clients/client-fsx/runtimeConfig.browser.ts +++ b/clients/client-fsx/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-fsx/runtimeConfig.native.ts b/clients/client-fsx/runtimeConfig.native.ts index e48c057da2410..667d2d75c5832 100644 --- a/clients/client-fsx/runtimeConfig.native.ts +++ b/clients/client-fsx/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./FSxClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-fsx/runtimeConfig.ts b/clients/client-fsx/runtimeConfig.ts index 94f668bfffc11..295dbf41cce2a 100644 --- a/clients/client-fsx/runtimeConfig.ts +++ b/clients/client-fsx/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-gamelift/GameLiftClient.ts b/clients/client-gamelift/GameLiftClient.ts index dcc0f31d56f80..5edc463cc9d66 100644 --- a/clients/client-gamelift/GameLiftClient.ts +++ b/clients/client-gamelift/GameLiftClient.ts @@ -281,6 +281,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -291,6 +292,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -524,11 +526,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -570,6 +567,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type GameLiftClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -578,8 +581,8 @@ export type GameLiftClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GameLiftClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -587,8 +590,8 @@ export type GameLiftClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon GameLift Service @@ -660,16 +663,16 @@ export class GameLiftClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-gamelift/runtimeConfig.browser.ts b/clients/client-gamelift/runtimeConfig.browser.ts index f478c90dc94c7..2db1887920f76 100644 --- a/clients/client-gamelift/runtimeConfig.browser.ts +++ b/clients/client-gamelift/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-gamelift/runtimeConfig.native.ts b/clients/client-gamelift/runtimeConfig.native.ts index 2180707fe0555..d7c948f5a4702 100644 --- a/clients/client-gamelift/runtimeConfig.native.ts +++ b/clients/client-gamelift/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GameLiftClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-gamelift/runtimeConfig.ts b/clients/client-gamelift/runtimeConfig.ts index 30d6766730089..3df467d66969c 100644 --- a/clients/client-gamelift/runtimeConfig.ts +++ b/clients/client-gamelift/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-glacier/GlacierClient.ts b/clients/client-glacier/GlacierClient.ts index fadbc8211ed09..8a687b7cee92d 100644 --- a/clients/client-glacier/GlacierClient.ts +++ b/clients/client-glacier/GlacierClient.ts @@ -117,6 +117,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -128,6 +129,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -247,11 +249,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -301,6 +298,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ request: __HttpRequest, options: { sha256: __HashConstructor; utf8Decoder: __Decoder } ) => Promise<[string, string]>; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type GlacierClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -309,8 +312,8 @@ export type GlacierClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GlacierClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -318,8 +321,8 @@ export type GlacierClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon S3 Glacier (Glacier) is a storage solution for "cold data."

@@ -378,17 +381,17 @@ export class GlacierClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getGlacierPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-glacier/runtimeConfig.browser.ts b/clients/client-glacier/runtimeConfig.browser.ts index b3f2a0e9414fc..7cea1de95be08 100644 --- a/clients/client-glacier/runtimeConfig.browser.ts +++ b/clients/client-glacier/runtimeConfig.browser.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { bodyChecksumGenerator, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-glacier/runtimeConfig.native.ts b/clients/client-glacier/runtimeConfig.native.ts index 4ec7e88ba2315..d9be63dceac03 100644 --- a/clients/client-glacier/runtimeConfig.native.ts +++ b/clients/client-glacier/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GlacierClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-glacier/runtimeConfig.ts b/clients/client-glacier/runtimeConfig.ts index 86a45687b07a2..05e3d9bd597cd 100644 --- a/clients/client-glacier/runtimeConfig.ts +++ b/clients/client-glacier/runtimeConfig.ts @@ -26,7 +26,10 @@ export const ClientDefaultValues: Required = { bodyChecksumGenerator, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-global-accelerator/GlobalAcceleratorClient.ts b/clients/client-global-accelerator/GlobalAcceleratorClient.ts index 8e82f5563942b..9f1a581bc6bd3 100644 --- a/clients/client-global-accelerator/GlobalAcceleratorClient.ts +++ b/clients/client-global-accelerator/GlobalAcceleratorClient.ts @@ -175,6 +175,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -185,6 +186,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -332,11 +334,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -378,6 +375,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type GlobalAcceleratorClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -386,8 +389,8 @@ export type GlobalAcceleratorClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GlobalAcceleratorClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -395,8 +398,8 @@ export type GlobalAcceleratorClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Global Accelerator @@ -565,16 +568,16 @@ export class GlobalAcceleratorClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-global-accelerator/runtimeConfig.browser.ts b/clients/client-global-accelerator/runtimeConfig.browser.ts index 5a1f4789e0df0..2819fe76bc951 100644 --- a/clients/client-global-accelerator/runtimeConfig.browser.ts +++ b/clients/client-global-accelerator/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-global-accelerator/runtimeConfig.native.ts b/clients/client-global-accelerator/runtimeConfig.native.ts index 5255941fe136f..e88df1cf00636 100644 --- a/clients/client-global-accelerator/runtimeConfig.native.ts +++ b/clients/client-global-accelerator/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GlobalAcceleratorClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-global-accelerator/runtimeConfig.ts b/clients/client-global-accelerator/runtimeConfig.ts index e8e36b46ebd24..5929fb47bb146 100644 --- a/clients/client-global-accelerator/runtimeConfig.ts +++ b/clients/client-global-accelerator/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-glue/GlueClient.ts b/clients/client-glue/GlueClient.ts index aa999df654321..7f3acb7add8bd 100644 --- a/clients/client-glue/GlueClient.ts +++ b/clients/client-glue/GlueClient.ts @@ -333,6 +333,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -343,6 +344,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -710,11 +712,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -756,6 +753,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type GlueClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -764,8 +767,8 @@ export type GlueClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOption EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GlueClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -773,8 +776,8 @@ export type GlueClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandl EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Glue @@ -797,16 +800,16 @@ export class GlueClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-glue/runtimeConfig.browser.ts b/clients/client-glue/runtimeConfig.browser.ts index 6de537f2e151e..8d710ddd44669 100644 --- a/clients/client-glue/runtimeConfig.browser.ts +++ b/clients/client-glue/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-glue/runtimeConfig.native.ts b/clients/client-glue/runtimeConfig.native.ts index cfaeac2fcf549..02a5755960942 100644 --- a/clients/client-glue/runtimeConfig.native.ts +++ b/clients/client-glue/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GlueClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-glue/runtimeConfig.ts b/clients/client-glue/runtimeConfig.ts index 57795af494f82..510af72737e1c 100644 --- a/clients/client-glue/runtimeConfig.ts +++ b/clients/client-glue/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-greengrass/GreengrassClient.ts b/clients/client-greengrass/GreengrassClient.ts index 01e9243cd2a8e..70f7c64b7a044 100644 --- a/clients/client-greengrass/GreengrassClient.ts +++ b/clients/client-greengrass/GreengrassClient.ts @@ -355,6 +355,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -365,6 +366,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -602,11 +604,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -648,6 +645,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type GreengrassClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -656,8 +659,8 @@ export type GreengrassClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GreengrassClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -665,8 +668,8 @@ export type GreengrassClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS IoT Greengrass seamlessly extends AWS onto physical devices so they can act locally on the data they generate, while still using the cloud for management, analytics, and durable storage. AWS IoT Greengrass ensures your devices can respond quickly to local events and operate with intermittent connectivity. AWS IoT Greengrass minimizes the cost of transmitting data to the cloud by allowing you to author AWS Lambda functions that execute locally. @@ -688,16 +691,16 @@ export class GreengrassClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-greengrass/runtimeConfig.browser.ts b/clients/client-greengrass/runtimeConfig.browser.ts index 7863e3490661f..db04ddb05b6a2 100644 --- a/clients/client-greengrass/runtimeConfig.browser.ts +++ b/clients/client-greengrass/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-greengrass/runtimeConfig.native.ts b/clients/client-greengrass/runtimeConfig.native.ts index 37cafa18bc80c..a87dc5ee17b04 100644 --- a/clients/client-greengrass/runtimeConfig.native.ts +++ b/clients/client-greengrass/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GreengrassClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-greengrass/runtimeConfig.ts b/clients/client-greengrass/runtimeConfig.ts index 3dee4468021ef..4207efcc191de 100644 --- a/clients/client-greengrass/runtimeConfig.ts +++ b/clients/client-greengrass/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-groundstation/GroundStationClient.ts b/clients/client-groundstation/GroundStationClient.ts index aa23e6be190be..8ab7a6a28d16a 100644 --- a/clients/client-groundstation/GroundStationClient.ts +++ b/clients/client-groundstation/GroundStationClient.ts @@ -87,6 +87,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -97,6 +98,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -200,11 +202,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -246,6 +243,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type GroundStationClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -254,8 +257,8 @@ export type GroundStationClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GroundStationClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -263,8 +266,8 @@ export type GroundStationClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Welcome to the AWS Ground Station API Reference. AWS Ground Station is a fully managed service that @@ -289,16 +292,16 @@ export class GroundStationClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-groundstation/runtimeConfig.browser.ts b/clients/client-groundstation/runtimeConfig.browser.ts index 47cb7d5f0ce73..63ce249eec936 100644 --- a/clients/client-groundstation/runtimeConfig.browser.ts +++ b/clients/client-groundstation/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-groundstation/runtimeConfig.native.ts b/clients/client-groundstation/runtimeConfig.native.ts index 3475909505162..52aa8d6e84559 100644 --- a/clients/client-groundstation/runtimeConfig.native.ts +++ b/clients/client-groundstation/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GroundStationClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-groundstation/runtimeConfig.ts b/clients/client-groundstation/runtimeConfig.ts index 132b23b9b6e67..d0973ebe24e47 100644 --- a/clients/client-groundstation/runtimeConfig.ts +++ b/clients/client-groundstation/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-guardduty/GuardDutyClient.ts b/clients/client-guardduty/GuardDutyClient.ts index 9ebea17d47ef7..1c1f69599cfc5 100644 --- a/clients/client-guardduty/GuardDutyClient.ts +++ b/clients/client-guardduty/GuardDutyClient.ts @@ -165,6 +165,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -175,6 +176,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -344,11 +346,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -390,6 +387,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type GuardDutyClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -398,8 +401,8 @@ export type GuardDutyClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GuardDutyClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -407,8 +410,8 @@ export type GuardDutyClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon GuardDuty is a continuous security monitoring service that analyzes and processes @@ -446,16 +449,16 @@ export class GuardDutyClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-guardduty/runtimeConfig.browser.ts b/clients/client-guardduty/runtimeConfig.browser.ts index 222af394850f1..42daae6239f55 100644 --- a/clients/client-guardduty/runtimeConfig.browser.ts +++ b/clients/client-guardduty/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-guardduty/runtimeConfig.native.ts b/clients/client-guardduty/runtimeConfig.native.ts index e17adf04da27d..9267548ef2638 100644 --- a/clients/client-guardduty/runtimeConfig.native.ts +++ b/clients/client-guardduty/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GuardDutyClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-guardduty/runtimeConfig.ts b/clients/client-guardduty/runtimeConfig.ts index fd1af1067c3eb..0384f0376b403 100644 --- a/clients/client-guardduty/runtimeConfig.ts +++ b/clients/client-guardduty/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-health/HealthClient.ts b/clients/client-health/HealthClient.ts index cf6ca6604c766..321ee6c83dd24 100644 --- a/clients/client-health/HealthClient.ts +++ b/clients/client-health/HealthClient.ts @@ -81,6 +81,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -91,6 +92,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type HealthClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +227,8 @@ export type HealthClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type HealthClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +236,8 @@ export type HealthClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Health @@ -293,16 +296,16 @@ export class HealthClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-health/runtimeConfig.browser.ts b/clients/client-health/runtimeConfig.browser.ts index 0b3ebc6dd73a3..f240e86f78ad1 100644 --- a/clients/client-health/runtimeConfig.browser.ts +++ b/clients/client-health/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-health/runtimeConfig.native.ts b/clients/client-health/runtimeConfig.native.ts index 6abcd5288a07d..1134bd9e518d3 100644 --- a/clients/client-health/runtimeConfig.native.ts +++ b/clients/client-health/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./HealthClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-health/runtimeConfig.ts b/clients/client-health/runtimeConfig.ts index 4674df4347074..6b44381d49147 100644 --- a/clients/client-health/runtimeConfig.ts +++ b/clients/client-health/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-healthlake/HealthLakeClient.ts b/clients/client-healthlake/HealthLakeClient.ts index 36e8c7f57e9e6..2061c0a6acd51 100644 --- a/clients/client-healthlake/HealthLakeClient.ts +++ b/clients/client-healthlake/HealthLakeClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -128,11 +130,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -174,6 +171,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type HealthLakeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -182,8 +185,8 @@ export type HealthLakeClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type HealthLakeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -191,8 +194,8 @@ export type HealthLakeClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon HealthLake is a HIPAA eligibile service that allows customers to store, @@ -215,16 +218,16 @@ export class HealthLakeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-healthlake/runtimeConfig.browser.ts b/clients/client-healthlake/runtimeConfig.browser.ts index f13a36c320bc7..c4159dbce380b 100644 --- a/clients/client-healthlake/runtimeConfig.browser.ts +++ b/clients/client-healthlake/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-healthlake/runtimeConfig.native.ts b/clients/client-healthlake/runtimeConfig.native.ts index f1bf34725bff0..4ae36a662ffc4 100644 --- a/clients/client-healthlake/runtimeConfig.native.ts +++ b/clients/client-healthlake/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./HealthLakeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-healthlake/runtimeConfig.ts b/clients/client-healthlake/runtimeConfig.ts index f746e7bdbabab..6d913c7aca0fb 100644 --- a/clients/client-healthlake/runtimeConfig.ts +++ b/clients/client-healthlake/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-honeycode/HoneycodeClient.ts b/clients/client-honeycode/HoneycodeClient.ts index 00ae63a57c3b8..9049a13b396dc 100644 --- a/clients/client-honeycode/HoneycodeClient.ts +++ b/clients/client-honeycode/HoneycodeClient.ts @@ -68,6 +68,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -78,6 +79,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -155,11 +157,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -201,6 +198,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type HoneycodeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -209,8 +212,8 @@ export type HoneycodeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type HoneycodeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -218,8 +221,8 @@ export type HoneycodeClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -245,16 +248,16 @@ export class HoneycodeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-honeycode/runtimeConfig.browser.ts b/clients/client-honeycode/runtimeConfig.browser.ts index 2e4c76f329921..637b3d4e203a2 100644 --- a/clients/client-honeycode/runtimeConfig.browser.ts +++ b/clients/client-honeycode/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-honeycode/runtimeConfig.native.ts b/clients/client-honeycode/runtimeConfig.native.ts index 44dbb946ab270..58470e9f41cd3 100644 --- a/clients/client-honeycode/runtimeConfig.native.ts +++ b/clients/client-honeycode/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./HoneycodeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-honeycode/runtimeConfig.ts b/clients/client-honeycode/runtimeConfig.ts index 7bb6c92a8d222..4360401c55593 100644 --- a/clients/client-honeycode/runtimeConfig.ts +++ b/clients/client-honeycode/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iam/IAMClient.ts b/clients/client-iam/IAMClient.ts index 1f4a9f712288f..a47bbca1b95ee 100644 --- a/clients/client-iam/IAMClient.ts +++ b/clients/client-iam/IAMClient.ts @@ -373,6 +373,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -383,6 +384,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -716,11 +718,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -762,6 +759,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IAMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -770,8 +773,8 @@ export type IAMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IAMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -779,8 +782,8 @@ export type IAMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Identity and Access Management @@ -806,16 +809,16 @@ export class IAMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iam/runtimeConfig.browser.ts b/clients/client-iam/runtimeConfig.browser.ts index 8101d3b6dd293..50a2cf2e3bf28 100644 --- a/clients/client-iam/runtimeConfig.browser.ts +++ b/clients/client-iam/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iam/runtimeConfig.native.ts b/clients/client-iam/runtimeConfig.native.ts index 106f9305b8347..f15d8cf5ef8de 100644 --- a/clients/client-iam/runtimeConfig.native.ts +++ b/clients/client-iam/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IAMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iam/runtimeConfig.ts b/clients/client-iam/runtimeConfig.ts index c89b77e118c7b..35d5c8c0e38a1 100644 --- a/clients/client-iam/runtimeConfig.ts +++ b/clients/client-iam/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-identitystore/IdentitystoreClient.ts b/clients/client-identitystore/IdentitystoreClient.ts index 665627767456b..5f0f6c09b3281 100644 --- a/clients/client-identitystore/IdentitystoreClient.ts +++ b/clients/client-identitystore/IdentitystoreClient.ts @@ -39,6 +39,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -49,6 +50,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -110,11 +112,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -156,6 +153,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IdentitystoreClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -164,8 +167,8 @@ export type IdentitystoreClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IdentitystoreClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -173,8 +176,8 @@ export type IdentitystoreClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; export class IdentitystoreClient extends __Client< __HttpHandlerOptions, @@ -193,16 +196,16 @@ export class IdentitystoreClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-identitystore/runtimeConfig.browser.ts b/clients/client-identitystore/runtimeConfig.browser.ts index 5fd83a0895882..d8a2cadaa5805 100644 --- a/clients/client-identitystore/runtimeConfig.browser.ts +++ b/clients/client-identitystore/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-identitystore/runtimeConfig.native.ts b/clients/client-identitystore/runtimeConfig.native.ts index b19b8146668ff..614b2deec4960 100644 --- a/clients/client-identitystore/runtimeConfig.native.ts +++ b/clients/client-identitystore/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IdentitystoreClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-identitystore/runtimeConfig.ts b/clients/client-identitystore/runtimeConfig.ts index 17f04bfe149d8..a11e26c35853b 100644 --- a/clients/client-identitystore/runtimeConfig.ts +++ b/clients/client-identitystore/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-imagebuilder/ImagebuilderClient.ts b/clients/client-imagebuilder/ImagebuilderClient.ts index 3c9d326e037f4..29b5359d10608 100644 --- a/clients/client-imagebuilder/ImagebuilderClient.ts +++ b/clients/client-imagebuilder/ImagebuilderClient.ts @@ -140,6 +140,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -150,6 +151,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -287,11 +289,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -333,6 +330,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ImagebuilderClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -341,8 +344,8 @@ export type ImagebuilderClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ImagebuilderClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -350,8 +353,8 @@ export type ImagebuilderClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

EC2 Image Builder is a fully managed AWS service that makes it easier to automate the creation, management, and deployment of customized, secure, and up-to-date “golden” server images that are pre-installed and pre-configured with software and settings to meet specific IT standards.

@@ -373,16 +376,16 @@ export class ImagebuilderClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-imagebuilder/runtimeConfig.browser.ts b/clients/client-imagebuilder/runtimeConfig.browser.ts index ee32dda920d77..b6306f2ab833e 100644 --- a/clients/client-imagebuilder/runtimeConfig.browser.ts +++ b/clients/client-imagebuilder/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-imagebuilder/runtimeConfig.native.ts b/clients/client-imagebuilder/runtimeConfig.native.ts index 6b13e01d7af4c..3f695e2f0715d 100644 --- a/clients/client-imagebuilder/runtimeConfig.native.ts +++ b/clients/client-imagebuilder/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ImagebuilderClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-imagebuilder/runtimeConfig.ts b/clients/client-imagebuilder/runtimeConfig.ts index 840a8b42e4d98..0727f6902aa10 100644 --- a/clients/client-imagebuilder/runtimeConfig.ts +++ b/clients/client-imagebuilder/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-inspector/InspectorClient.ts b/clients/client-inspector/InspectorClient.ts index 49331db397bf3..f048693e14406 100644 --- a/clients/client-inspector/InspectorClient.ts +++ b/clients/client-inspector/InspectorClient.ts @@ -150,6 +150,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -160,6 +161,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -287,11 +289,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -333,6 +330,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type InspectorClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -341,8 +344,8 @@ export type InspectorClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type InspectorClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -350,8 +353,8 @@ export type InspectorClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Inspector @@ -376,16 +379,16 @@ export class InspectorClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-inspector/runtimeConfig.browser.ts b/clients/client-inspector/runtimeConfig.browser.ts index 5a01db88c24ad..1f5d3b0db130e 100644 --- a/clients/client-inspector/runtimeConfig.browser.ts +++ b/clients/client-inspector/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-inspector/runtimeConfig.native.ts b/clients/client-inspector/runtimeConfig.native.ts index d8d382462da9d..925dd30f5e86c 100644 --- a/clients/client-inspector/runtimeConfig.native.ts +++ b/clients/client-inspector/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./InspectorClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-inspector/runtimeConfig.ts b/clients/client-inspector/runtimeConfig.ts index 96a508aadadd4..7ef1a40da6af6 100644 --- a/clients/client-inspector/runtimeConfig.ts +++ b/clients/client-inspector/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot-1click-devices-service/IoT1ClickDevicesServiceClient.ts b/clients/client-iot-1click-devices-service/IoT1ClickDevicesServiceClient.ts index 2960f82f53864..70ee5dbfc8fce 100644 --- a/clients/client-iot-1click-devices-service/IoT1ClickDevicesServiceClient.ts +++ b/clients/client-iot-1click-devices-service/IoT1ClickDevicesServiceClient.ts @@ -60,6 +60,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -70,6 +71,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -149,11 +151,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -195,6 +192,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoT1ClickDevicesServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -203,8 +206,8 @@ export type IoT1ClickDevicesServiceClientConfig = Partial<__SmithyConfiguration< EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoT1ClickDevicesServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -212,8 +215,8 @@ export type IoT1ClickDevicesServiceClientResolvedConfig = __SmithyResolvedConfig EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Describes all of the AWS IoT 1-Click device-related API operations for the service. @@ -237,16 +240,16 @@ export class IoT1ClickDevicesServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot-1click-devices-service/runtimeConfig.browser.ts b/clients/client-iot-1click-devices-service/runtimeConfig.browser.ts index 5657814d55c23..25b6583ea85a2 100644 --- a/clients/client-iot-1click-devices-service/runtimeConfig.browser.ts +++ b/clients/client-iot-1click-devices-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot-1click-devices-service/runtimeConfig.native.ts b/clients/client-iot-1click-devices-service/runtimeConfig.native.ts index f86e6e9dce990..aa8a1e5bc3774 100644 --- a/clients/client-iot-1click-devices-service/runtimeConfig.native.ts +++ b/clients/client-iot-1click-devices-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoT1ClickDevicesServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot-1click-devices-service/runtimeConfig.ts b/clients/client-iot-1click-devices-service/runtimeConfig.ts index 5ee39c34cfd09..6065d59bea9f7 100644 --- a/clients/client-iot-1click-devices-service/runtimeConfig.ts +++ b/clients/client-iot-1click-devices-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot-1click-projects/IoT1ClickProjectsClient.ts b/clients/client-iot-1click-projects/IoT1ClickProjectsClient.ts index 60cf49887d711..5bde8a3a7a81e 100644 --- a/clients/client-iot-1click-projects/IoT1ClickProjectsClient.ts +++ b/clients/client-iot-1click-projects/IoT1ClickProjectsClient.ts @@ -63,6 +63,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -73,6 +74,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -158,11 +160,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -204,6 +201,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoT1ClickProjectsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -212,8 +215,8 @@ export type IoT1ClickProjectsClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoT1ClickProjectsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -221,8 +224,8 @@ export type IoT1ClickProjectsClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The AWS IoT 1-Click Projects API Reference

@@ -244,16 +247,16 @@ export class IoT1ClickProjectsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot-1click-projects/runtimeConfig.browser.ts b/clients/client-iot-1click-projects/runtimeConfig.browser.ts index 74eda9ea83265..faf186a8ecc33 100644 --- a/clients/client-iot-1click-projects/runtimeConfig.browser.ts +++ b/clients/client-iot-1click-projects/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot-1click-projects/runtimeConfig.native.ts b/clients/client-iot-1click-projects/runtimeConfig.native.ts index a5bd4ffe1fc08..ed52b2091d019 100644 --- a/clients/client-iot-1click-projects/runtimeConfig.native.ts +++ b/clients/client-iot-1click-projects/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoT1ClickProjectsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot-1click-projects/runtimeConfig.ts b/clients/client-iot-1click-projects/runtimeConfig.ts index c336965ae3902..7035d8943f0a9 100644 --- a/clients/client-iot-1click-projects/runtimeConfig.ts +++ b/clients/client-iot-1click-projects/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot-data-plane/IoTDataPlaneClient.ts b/clients/client-iot-data-plane/IoTDataPlaneClient.ts index 7c4475f674cae..d367ad632c807 100644 --- a/clients/client-iot-data-plane/IoTDataPlaneClient.ts +++ b/clients/client-iot-data-plane/IoTDataPlaneClient.ts @@ -43,6 +43,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -53,6 +54,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -116,11 +118,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -162,6 +159,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoTDataPlaneClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -170,8 +173,8 @@ export type IoTDataPlaneClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTDataPlaneClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -179,8 +182,8 @@ export type IoTDataPlaneClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS IoT @@ -212,16 +215,16 @@ export class IoTDataPlaneClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot-data-plane/runtimeConfig.browser.ts b/clients/client-iot-data-plane/runtimeConfig.browser.ts index a0282f592e89f..194deddffebf8 100644 --- a/clients/client-iot-data-plane/runtimeConfig.browser.ts +++ b/clients/client-iot-data-plane/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot-data-plane/runtimeConfig.native.ts b/clients/client-iot-data-plane/runtimeConfig.native.ts index f667ec0e62316..4e4ea28faab2c 100644 --- a/clients/client-iot-data-plane/runtimeConfig.native.ts +++ b/clients/client-iot-data-plane/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTDataPlaneClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot-data-plane/runtimeConfig.ts b/clients/client-iot-data-plane/runtimeConfig.ts index b9d051dce059b..f10ae51162513 100644 --- a/clients/client-iot-data-plane/runtimeConfig.ts +++ b/clients/client-iot-data-plane/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot-events-data/IoTEventsDataClient.ts b/clients/client-iot-events-data/IoTEventsDataClient.ts index 47b1dffda2e85..d7700ef085635 100644 --- a/clients/client-iot-events-data/IoTEventsDataClient.ts +++ b/clients/client-iot-events-data/IoTEventsDataClient.ts @@ -42,6 +42,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -52,6 +53,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -113,11 +115,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -159,6 +156,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoTEventsDataClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -167,8 +170,8 @@ export type IoTEventsDataClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTEventsDataClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -176,8 +179,8 @@ export type IoTEventsDataClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS IoT Events monitors your equipment or device fleets for failures or changes in operation, @@ -201,16 +204,16 @@ export class IoTEventsDataClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot-events-data/runtimeConfig.browser.ts b/clients/client-iot-events-data/runtimeConfig.browser.ts index 1b65ea8766662..01eb8f57b9c5e 100644 --- a/clients/client-iot-events-data/runtimeConfig.browser.ts +++ b/clients/client-iot-events-data/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot-events-data/runtimeConfig.native.ts b/clients/client-iot-events-data/runtimeConfig.native.ts index 78149a851e496..0aeb7db1ce3cb 100644 --- a/clients/client-iot-events-data/runtimeConfig.native.ts +++ b/clients/client-iot-events-data/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTEventsDataClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot-events-data/runtimeConfig.ts b/clients/client-iot-events-data/runtimeConfig.ts index f6b6214026111..e6ba6e800c882 100644 --- a/clients/client-iot-events-data/runtimeConfig.ts +++ b/clients/client-iot-events-data/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot-events/IoTEventsClient.ts b/clients/client-iot-events/IoTEventsClient.ts index eca0d490de8a9..a98378b1b27da 100644 --- a/clients/client-iot-events/IoTEventsClient.ts +++ b/clients/client-iot-events/IoTEventsClient.ts @@ -72,6 +72,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -82,6 +83,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -167,11 +169,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -213,6 +210,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoTEventsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -221,8 +224,8 @@ export type IoTEventsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTEventsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -230,8 +233,8 @@ export type IoTEventsClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS IoT Events monitors your equipment or device fleets for failures or changes in operation, and @@ -255,16 +258,16 @@ export class IoTEventsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot-events/runtimeConfig.browser.ts b/clients/client-iot-events/runtimeConfig.browser.ts index c23b7156601c6..804b7eb724731 100644 --- a/clients/client-iot-events/runtimeConfig.browser.ts +++ b/clients/client-iot-events/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot-events/runtimeConfig.native.ts b/clients/client-iot-events/runtimeConfig.native.ts index 2f1a3ebeef314..eaa85451d4b6f 100644 --- a/clients/client-iot-events/runtimeConfig.native.ts +++ b/clients/client-iot-events/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTEventsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot-events/runtimeConfig.ts b/clients/client-iot-events/runtimeConfig.ts index 0246c2690c054..12b412636e5a8 100644 --- a/clients/client-iot-events/runtimeConfig.ts +++ b/clients/client-iot-events/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot-jobs-data-plane/IoTJobsDataPlaneClient.ts b/clients/client-iot-jobs-data-plane/IoTJobsDataPlaneClient.ts index b234757cda311..840837f3d30a9 100644 --- a/clients/client-iot-jobs-data-plane/IoTJobsDataPlaneClient.ts +++ b/clients/client-iot-jobs-data-plane/IoTJobsDataPlaneClient.ts @@ -48,6 +48,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -58,6 +59,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -119,11 +121,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -165,6 +162,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoTJobsDataPlaneClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -173,8 +176,8 @@ export type IoTJobsDataPlaneClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTJobsDataPlaneClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -182,8 +185,8 @@ export type IoTJobsDataPlaneClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS IoT Jobs is a service that allows you to define a set of jobs — remote operations that are sent to @@ -215,16 +218,16 @@ export class IoTJobsDataPlaneClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot-jobs-data-plane/runtimeConfig.browser.ts b/clients/client-iot-jobs-data-plane/runtimeConfig.browser.ts index 2fbc727eac35b..31f147e2cddb9 100644 --- a/clients/client-iot-jobs-data-plane/runtimeConfig.browser.ts +++ b/clients/client-iot-jobs-data-plane/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot-jobs-data-plane/runtimeConfig.native.ts b/clients/client-iot-jobs-data-plane/runtimeConfig.native.ts index 923cfbf906623..abad19f8dc8da 100644 --- a/clients/client-iot-jobs-data-plane/runtimeConfig.native.ts +++ b/clients/client-iot-jobs-data-plane/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTJobsDataPlaneClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot-jobs-data-plane/runtimeConfig.ts b/clients/client-iot-jobs-data-plane/runtimeConfig.ts index a9963712a96f2..165ab5067b599 100644 --- a/clients/client-iot-jobs-data-plane/runtimeConfig.ts +++ b/clients/client-iot-jobs-data-plane/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot/IoTClient.ts b/clients/client-iot/IoTClient.ts index bc693d2c2aaec..95f5041781764 100644 --- a/clients/client-iot/IoTClient.ts +++ b/clients/client-iot/IoTClient.ts @@ -616,6 +616,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -626,6 +627,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -1103,11 +1105,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -1149,6 +1146,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoTClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -1157,8 +1160,8 @@ export type IoTClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -1166,8 +1169,8 @@ export type IoTClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS IoT @@ -1204,16 +1207,16 @@ export class IoTClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot/runtimeConfig.browser.ts b/clients/client-iot/runtimeConfig.browser.ts index 22885b57e5813..5e9d55556e859 100644 --- a/clients/client-iot/runtimeConfig.browser.ts +++ b/clients/client-iot/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot/runtimeConfig.native.ts b/clients/client-iot/runtimeConfig.native.ts index 6198932a1074d..defb8198e3d54 100644 --- a/clients/client-iot/runtimeConfig.native.ts +++ b/clients/client-iot/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot/runtimeConfig.ts b/clients/client-iot/runtimeConfig.ts index a4a6bcd600008..a32b9249b455d 100644 --- a/clients/client-iot/runtimeConfig.ts +++ b/clients/client-iot/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iotanalytics/IoTAnalyticsClient.ts b/clients/client-iotanalytics/IoTAnalyticsClient.ts index 8ae72a8de38f3..51b4717b99bad 100644 --- a/clients/client-iotanalytics/IoTAnalyticsClient.ts +++ b/clients/client-iotanalytics/IoTAnalyticsClient.ts @@ -93,6 +93,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -103,6 +104,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -224,11 +226,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -270,6 +267,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoTAnalyticsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -278,8 +281,8 @@ export type IoTAnalyticsClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTAnalyticsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -287,8 +290,8 @@ export type IoTAnalyticsClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS IoT Analytics allows you to collect large amounts of device data, process messages, and store them. @@ -328,16 +331,16 @@ export class IoTAnalyticsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iotanalytics/runtimeConfig.browser.ts b/clients/client-iotanalytics/runtimeConfig.browser.ts index ebce7964af708..0d538cb77aabe 100644 --- a/clients/client-iotanalytics/runtimeConfig.browser.ts +++ b/clients/client-iotanalytics/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iotanalytics/runtimeConfig.native.ts b/clients/client-iotanalytics/runtimeConfig.native.ts index 117a38577fedc..23b40c4c11684 100644 --- a/clients/client-iotanalytics/runtimeConfig.native.ts +++ b/clients/client-iotanalytics/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTAnalyticsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iotanalytics/runtimeConfig.ts b/clients/client-iotanalytics/runtimeConfig.ts index 737120b902969..94fee36290ded 100644 --- a/clients/client-iotanalytics/runtimeConfig.ts +++ b/clients/client-iotanalytics/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iotsecuretunneling/IoTSecureTunnelingClient.ts b/clients/client-iotsecuretunneling/IoTSecureTunnelingClient.ts index 598f6a650e4aa..b9da0d65480e0 100644 --- a/clients/client-iotsecuretunneling/IoTSecureTunnelingClient.ts +++ b/clients/client-iotsecuretunneling/IoTSecureTunnelingClient.ts @@ -45,6 +45,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -55,6 +56,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -122,11 +124,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -168,6 +165,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoTSecureTunnelingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -176,8 +179,8 @@ export type IoTSecureTunnelingClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTSecureTunnelingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -185,8 +188,8 @@ export type IoTSecureTunnelingClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS IoT Secure Tunneling @@ -212,16 +215,16 @@ export class IoTSecureTunnelingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iotsecuretunneling/runtimeConfig.browser.ts b/clients/client-iotsecuretunneling/runtimeConfig.browser.ts index e052690091069..a283dc531b8af 100644 --- a/clients/client-iotsecuretunneling/runtimeConfig.browser.ts +++ b/clients/client-iotsecuretunneling/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iotsecuretunneling/runtimeConfig.native.ts b/clients/client-iotsecuretunneling/runtimeConfig.native.ts index 6ebdb592cf139..775e2c3dfe3f7 100644 --- a/clients/client-iotsecuretunneling/runtimeConfig.native.ts +++ b/clients/client-iotsecuretunneling/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTSecureTunnelingClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iotsecuretunneling/runtimeConfig.ts b/clients/client-iotsecuretunneling/runtimeConfig.ts index 5c767909f1e2a..2b1313e03c3ca 100644 --- a/clients/client-iotsecuretunneling/runtimeConfig.ts +++ b/clients/client-iotsecuretunneling/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iotsitewise/IoTSiteWiseClient.ts b/clients/client-iotsitewise/IoTSiteWiseClient.ts index 16dcf5574d9c6..ca6efddd21a71 100644 --- a/clients/client-iotsitewise/IoTSiteWiseClient.ts +++ b/clients/client-iotsitewise/IoTSiteWiseClient.ts @@ -143,6 +143,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -153,6 +154,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -320,11 +322,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -366,6 +363,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoTSiteWiseClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -374,8 +377,8 @@ export type IoTSiteWiseClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTSiteWiseClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -383,8 +386,8 @@ export type IoTSiteWiseClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Welcome to the AWS IoT SiteWise API Reference. AWS IoT SiteWise is an AWS service that connects Industrial Internet of Things (IIoT) devices to the power of the AWS Cloud. For more information, see the @@ -407,16 +410,16 @@ export class IoTSiteWiseClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iotsitewise/runtimeConfig.browser.ts b/clients/client-iotsitewise/runtimeConfig.browser.ts index ce1cfd4eb1a70..6cbdb8c98bcac 100644 --- a/clients/client-iotsitewise/runtimeConfig.browser.ts +++ b/clients/client-iotsitewise/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iotsitewise/runtimeConfig.native.ts b/clients/client-iotsitewise/runtimeConfig.native.ts index 9a54d295a80e6..4be83e5b64411 100644 --- a/clients/client-iotsitewise/runtimeConfig.native.ts +++ b/clients/client-iotsitewise/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTSiteWiseClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iotsitewise/runtimeConfig.ts b/clients/client-iotsitewise/runtimeConfig.ts index cfbdefac46253..6ffd6ace2c74b 100644 --- a/clients/client-iotsitewise/runtimeConfig.ts +++ b/clients/client-iotsitewise/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iotthingsgraph/IoTThingsGraphClient.ts b/clients/client-iotthingsgraph/IoTThingsGraphClient.ts index 03052b99ca83f..8212b1671651b 100644 --- a/clients/client-iotthingsgraph/IoTThingsGraphClient.ts +++ b/clients/client-iotthingsgraph/IoTThingsGraphClient.ts @@ -133,6 +133,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -143,6 +144,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -266,11 +268,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -312,6 +309,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoTThingsGraphClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -320,8 +323,8 @@ export type IoTThingsGraphClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTThingsGraphClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -329,8 +332,8 @@ export type IoTThingsGraphClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS IoT Things Graph @@ -356,16 +359,16 @@ export class IoTThingsGraphClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iotthingsgraph/runtimeConfig.browser.ts b/clients/client-iotthingsgraph/runtimeConfig.browser.ts index ab12a90c403d2..159ad6ba04c0c 100644 --- a/clients/client-iotthingsgraph/runtimeConfig.browser.ts +++ b/clients/client-iotthingsgraph/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iotthingsgraph/runtimeConfig.native.ts b/clients/client-iotthingsgraph/runtimeConfig.native.ts index 07fb9211275fd..245cc397926d1 100644 --- a/clients/client-iotthingsgraph/runtimeConfig.native.ts +++ b/clients/client-iotthingsgraph/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTThingsGraphClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iotthingsgraph/runtimeConfig.ts b/clients/client-iotthingsgraph/runtimeConfig.ts index 228ed6e4fd4b5..1ef947bdc9956 100644 --- a/clients/client-iotthingsgraph/runtimeConfig.ts +++ b/clients/client-iotthingsgraph/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ivs/IvsClient.ts b/clients/client-ivs/IvsClient.ts index 7e598fe25cb52..16a23b63c4dce 100644 --- a/clients/client-ivs/IvsClient.ts +++ b/clients/client-ivs/IvsClient.ts @@ -69,6 +69,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -79,6 +80,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -176,11 +178,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -222,6 +219,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IvsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -230,8 +233,8 @@ export type IvsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IvsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -239,8 +242,8 @@ export type IvsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -537,16 +540,16 @@ export class IvsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ivs/runtimeConfig.browser.ts b/clients/client-ivs/runtimeConfig.browser.ts index 7ab32ca29a68b..a89f8e29d34bf 100644 --- a/clients/client-ivs/runtimeConfig.browser.ts +++ b/clients/client-ivs/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ivs/runtimeConfig.native.ts b/clients/client-ivs/runtimeConfig.native.ts index a3ae4490de2d2..4b1a6f4af45ec 100644 --- a/clients/client-ivs/runtimeConfig.native.ts +++ b/clients/client-ivs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IvsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ivs/runtimeConfig.ts b/clients/client-ivs/runtimeConfig.ts index 64682c169a78d..0a12439b09342 100644 --- a/clients/client-ivs/runtimeConfig.ts +++ b/clients/client-ivs/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kafka/KafkaClient.ts b/clients/client-kafka/KafkaClient.ts index 29b639e20a70d..c83e804a23af9 100644 --- a/clients/client-kafka/KafkaClient.ts +++ b/clients/client-kafka/KafkaClient.ts @@ -112,6 +112,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -122,6 +123,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -233,11 +235,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -279,6 +276,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type KafkaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -287,8 +290,8 @@ export type KafkaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KafkaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -296,8 +299,8 @@ export type KafkaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The operations for managing an Amazon MSK cluster.

@@ -319,16 +322,16 @@ export class KafkaClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kafka/runtimeConfig.browser.ts b/clients/client-kafka/runtimeConfig.browser.ts index 1cbf191089832..482bfddb2bc16 100644 --- a/clients/client-kafka/runtimeConfig.browser.ts +++ b/clients/client-kafka/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kafka/runtimeConfig.native.ts b/clients/client-kafka/runtimeConfig.native.ts index 68f1b5b25b893..d07a4bd8f6555 100644 --- a/clients/client-kafka/runtimeConfig.native.ts +++ b/clients/client-kafka/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KafkaClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kafka/runtimeConfig.ts b/clients/client-kafka/runtimeConfig.ts index 98d4c018d4a49..5bbe2256b6977 100644 --- a/clients/client-kafka/runtimeConfig.ts +++ b/clients/client-kafka/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kendra/KendraClient.ts b/clients/client-kendra/KendraClient.ts index 09128593a4c96..67758bcd349a8 100644 --- a/clients/client-kendra/KendraClient.ts +++ b/clients/client-kendra/KendraClient.ts @@ -79,6 +79,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -89,6 +90,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -200,11 +202,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -246,6 +243,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type KendraClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -254,8 +257,8 @@ export type KendraClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KendraClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -263,8 +266,8 @@ export type KendraClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Kendra is a service for indexing large document sets.

@@ -286,16 +289,16 @@ export class KendraClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kendra/runtimeConfig.browser.ts b/clients/client-kendra/runtimeConfig.browser.ts index 214af8a7d83e7..5de465a4dc609 100644 --- a/clients/client-kendra/runtimeConfig.browser.ts +++ b/clients/client-kendra/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kendra/runtimeConfig.native.ts b/clients/client-kendra/runtimeConfig.native.ts index ac61356eb12eb..755249dcd2339 100644 --- a/clients/client-kendra/runtimeConfig.native.ts +++ b/clients/client-kendra/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KendraClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kendra/runtimeConfig.ts b/clients/client-kendra/runtimeConfig.ts index 599c639044b69..3b185671504a0 100644 --- a/clients/client-kendra/runtimeConfig.ts +++ b/clients/client-kendra/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis-analytics-v2/KinesisAnalyticsV2Client.ts b/clients/client-kinesis-analytics-v2/KinesisAnalyticsV2Client.ts index 0d02be0f19fce..93499168e79ef 100644 --- a/clients/client-kinesis-analytics-v2/KinesisAnalyticsV2Client.ts +++ b/clients/client-kinesis-analytics-v2/KinesisAnalyticsV2Client.ts @@ -119,6 +119,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -129,6 +130,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -236,11 +238,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -282,6 +279,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type KinesisAnalyticsV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -290,8 +293,8 @@ export type KinesisAnalyticsV2ClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KinesisAnalyticsV2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -299,8 +302,8 @@ export type KinesisAnalyticsV2ClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Kinesis Data Analytics is a fully managed service that you can use to process and analyze streaming data using Java, SQL, or Scala. The service @@ -324,16 +327,16 @@ export class KinesisAnalyticsV2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis-analytics-v2/runtimeConfig.browser.ts b/clients/client-kinesis-analytics-v2/runtimeConfig.browser.ts index 937d32a94b372..20883a7973d8d 100644 --- a/clients/client-kinesis-analytics-v2/runtimeConfig.browser.ts +++ b/clients/client-kinesis-analytics-v2/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kinesis-analytics-v2/runtimeConfig.native.ts b/clients/client-kinesis-analytics-v2/runtimeConfig.native.ts index 606d5e3900cf1..99b3f7a09ee3d 100644 --- a/clients/client-kinesis-analytics-v2/runtimeConfig.native.ts +++ b/clients/client-kinesis-analytics-v2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisAnalyticsV2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis-analytics-v2/runtimeConfig.ts b/clients/client-kinesis-analytics-v2/runtimeConfig.ts index 17a51ee82a490..7c9c33b7ab47b 100644 --- a/clients/client-kinesis-analytics-v2/runtimeConfig.ts +++ b/clients/client-kinesis-analytics-v2/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis-analytics/KinesisAnalyticsClient.ts b/clients/client-kinesis-analytics/KinesisAnalyticsClient.ts index b111f393f2dc5..db54ebd2f9973 100644 --- a/clients/client-kinesis-analytics/KinesisAnalyticsClient.ts +++ b/clients/client-kinesis-analytics/KinesisAnalyticsClient.ts @@ -91,6 +91,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -101,6 +102,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -194,11 +196,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -240,6 +237,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type KinesisAnalyticsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -248,8 +251,8 @@ export type KinesisAnalyticsClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KinesisAnalyticsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -257,8 +260,8 @@ export type KinesisAnalyticsClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Kinesis Analytics @@ -289,16 +292,16 @@ export class KinesisAnalyticsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis-analytics/runtimeConfig.browser.ts b/clients/client-kinesis-analytics/runtimeConfig.browser.ts index 659d88daaccf8..5a4f7b637179a 100644 --- a/clients/client-kinesis-analytics/runtimeConfig.browser.ts +++ b/clients/client-kinesis-analytics/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kinesis-analytics/runtimeConfig.native.ts b/clients/client-kinesis-analytics/runtimeConfig.native.ts index 0b4967f929ec0..8e2002dedfb3e 100644 --- a/clients/client-kinesis-analytics/runtimeConfig.native.ts +++ b/clients/client-kinesis-analytics/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisAnalyticsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis-analytics/runtimeConfig.ts b/clients/client-kinesis-analytics/runtimeConfig.ts index f851dc8599a50..9a36a75e0f55c 100644 --- a/clients/client-kinesis-analytics/runtimeConfig.ts +++ b/clients/client-kinesis-analytics/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis-video-archived-media/KinesisVideoArchivedMediaClient.ts b/clients/client-kinesis-video-archived-media/KinesisVideoArchivedMediaClient.ts index c07c02ff7fef0..ae93bc628c97a 100644 --- a/clients/client-kinesis-video-archived-media/KinesisVideoArchivedMediaClient.ts +++ b/clients/client-kinesis-video-archived-media/KinesisVideoArchivedMediaClient.ts @@ -49,6 +49,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -59,6 +60,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -122,11 +124,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -168,6 +165,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type KinesisVideoArchivedMediaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -176,8 +179,8 @@ export type KinesisVideoArchivedMediaClientConfig = Partial<__SmithyConfiguratio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KinesisVideoArchivedMediaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -185,8 +188,8 @@ export type KinesisVideoArchivedMediaClientResolvedConfig = __SmithyResolvedConf EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -208,16 +211,16 @@ export class KinesisVideoArchivedMediaClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis-video-archived-media/runtimeConfig.browser.ts b/clients/client-kinesis-video-archived-media/runtimeConfig.browser.ts index 03046c3eafa2d..726ce434e9bc3 100644 --- a/clients/client-kinesis-video-archived-media/runtimeConfig.browser.ts +++ b/clients/client-kinesis-video-archived-media/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kinesis-video-archived-media/runtimeConfig.native.ts b/clients/client-kinesis-video-archived-media/runtimeConfig.native.ts index 35aab72b2651e..a989d29c4357b 100644 --- a/clients/client-kinesis-video-archived-media/runtimeConfig.native.ts +++ b/clients/client-kinesis-video-archived-media/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisVideoArchivedMediaClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis-video-archived-media/runtimeConfig.ts b/clients/client-kinesis-video-archived-media/runtimeConfig.ts index e04c61531cd7c..5f54109f79d4e 100644 --- a/clients/client-kinesis-video-archived-media/runtimeConfig.ts +++ b/clients/client-kinesis-video-archived-media/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis-video-media/KinesisVideoMediaClient.ts b/clients/client-kinesis-video-media/KinesisVideoMediaClient.ts index 5e37683b26082..50e44ade120e9 100644 --- a/clients/client-kinesis-video-media/KinesisVideoMediaClient.ts +++ b/clients/client-kinesis-video-media/KinesisVideoMediaClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GetMediaCommandInput; @@ -99,11 +101,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -145,6 +142,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type KinesisVideoMediaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -153,8 +156,8 @@ export type KinesisVideoMediaClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KinesisVideoMediaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -162,8 +165,8 @@ export type KinesisVideoMediaClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -185,16 +188,16 @@ export class KinesisVideoMediaClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis-video-media/runtimeConfig.browser.ts b/clients/client-kinesis-video-media/runtimeConfig.browser.ts index c3f79ca4d69bf..dc4e45085385f 100644 --- a/clients/client-kinesis-video-media/runtimeConfig.browser.ts +++ b/clients/client-kinesis-video-media/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kinesis-video-media/runtimeConfig.native.ts b/clients/client-kinesis-video-media/runtimeConfig.native.ts index 6d03ff5513a6d..d96c0cda321b2 100644 --- a/clients/client-kinesis-video-media/runtimeConfig.native.ts +++ b/clients/client-kinesis-video-media/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisVideoMediaClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis-video-media/runtimeConfig.ts b/clients/client-kinesis-video-media/runtimeConfig.ts index 7c6e92295fae1..f99959ebf39f9 100644 --- a/clients/client-kinesis-video-media/runtimeConfig.ts +++ b/clients/client-kinesis-video-media/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis-video-signaling/KinesisVideoSignalingClient.ts b/clients/client-kinesis-video-signaling/KinesisVideoSignalingClient.ts index 4c73a9b7a3f78..a7ceba404a3f3 100644 --- a/clients/client-kinesis-video-signaling/KinesisVideoSignalingClient.ts +++ b/clients/client-kinesis-video-signaling/KinesisVideoSignalingClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GetIceServerConfigCommandInput | SendAlexaOfferToMasterCommandInput; @@ -103,11 +105,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -149,6 +146,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type KinesisVideoSignalingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -157,8 +160,8 @@ export type KinesisVideoSignalingClientConfig = Partial<__SmithyConfiguration<__ EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KinesisVideoSignalingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -166,8 +169,8 @@ export type KinesisVideoSignalingClientResolvedConfig = __SmithyResolvedConfigur EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Kinesis Video Streams Signaling Service is a intermediate service that establishes a @@ -191,16 +194,16 @@ export class KinesisVideoSignalingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis-video-signaling/runtimeConfig.browser.ts b/clients/client-kinesis-video-signaling/runtimeConfig.browser.ts index cc758db8a392a..b8a4a05b10bb5 100644 --- a/clients/client-kinesis-video-signaling/runtimeConfig.browser.ts +++ b/clients/client-kinesis-video-signaling/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kinesis-video-signaling/runtimeConfig.native.ts b/clients/client-kinesis-video-signaling/runtimeConfig.native.ts index 937f52f01ab19..cad8c52fe0a27 100644 --- a/clients/client-kinesis-video-signaling/runtimeConfig.native.ts +++ b/clients/client-kinesis-video-signaling/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisVideoSignalingClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis-video-signaling/runtimeConfig.ts b/clients/client-kinesis-video-signaling/runtimeConfig.ts index 1e2930df1e8cb..41f2b8d1653ac 100644 --- a/clients/client-kinesis-video-signaling/runtimeConfig.ts +++ b/clients/client-kinesis-video-signaling/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis-video/KinesisVideoClient.ts b/clients/client-kinesis-video/KinesisVideoClient.ts index 95abff7b57743..201ea2ce307d5 100644 --- a/clients/client-kinesis-video/KinesisVideoClient.ts +++ b/clients/client-kinesis-video/KinesisVideoClient.ts @@ -78,6 +78,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -88,6 +89,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -179,11 +181,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -225,6 +222,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type KinesisVideoClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -233,8 +236,8 @@ export type KinesisVideoClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KinesisVideoClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -242,8 +245,8 @@ export type KinesisVideoClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -265,16 +268,16 @@ export class KinesisVideoClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis-video/runtimeConfig.browser.ts b/clients/client-kinesis-video/runtimeConfig.browser.ts index a0515622f4c1d..b4f7f58237858 100644 --- a/clients/client-kinesis-video/runtimeConfig.browser.ts +++ b/clients/client-kinesis-video/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kinesis-video/runtimeConfig.native.ts b/clients/client-kinesis-video/runtimeConfig.native.ts index fe63b5e9b2343..111673a8627f5 100644 --- a/clients/client-kinesis-video/runtimeConfig.native.ts +++ b/clients/client-kinesis-video/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisVideoClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis-video/runtimeConfig.ts b/clients/client-kinesis-video/runtimeConfig.ts index 21787e7efa9eb..675f608c296f3 100644 --- a/clients/client-kinesis-video/runtimeConfig.ts +++ b/clients/client-kinesis-video/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis/KinesisClient.ts b/clients/client-kinesis/KinesisClient.ts index 29fc04810df9b..5ab9ac7c0d735 100644 --- a/clients/client-kinesis/KinesisClient.ts +++ b/clients/client-kinesis/KinesisClient.ts @@ -104,6 +104,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -115,6 +116,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -224,11 +226,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -271,6 +268,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ regionInfoProvider?: RegionInfoProvider; + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + /** * The function that provides necessary utilities for generating and parsing event stream */ @@ -283,8 +286,8 @@ export type KinesisClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & HostHeaderInputConfig & + UserAgentInputConfig & EventStreamSerdeInputConfig; export type KinesisClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & @@ -293,8 +296,8 @@ export type KinesisClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & HostHeaderResolvedConfig & + UserAgentResolvedConfig & EventStreamSerdeResolvedConfig; /** @@ -319,17 +322,17 @@ export class KinesisClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); let _config_7 = resolveEventStreamSerdeConfig(_config_6); super(_config_7); this.config = _config_7; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis/runtimeConfig.browser.ts b/clients/client-kinesis/runtimeConfig.browser.ts index 1eaaa5072663d..9e50610795c8e 100644 --- a/clients/client-kinesis/runtimeConfig.browser.ts +++ b/clients/client-kinesis/runtimeConfig.browser.ts @@ -23,7 +23,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), eventStreamSerdeProvider, maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, diff --git a/clients/client-kinesis/runtimeConfig.native.ts b/clients/client-kinesis/runtimeConfig.native.ts index 2680f5dc28e39..6db24364702cb 100644 --- a/clients/client-kinesis/runtimeConfig.native.ts +++ b/clients/client-kinesis/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis/runtimeConfig.ts b/clients/client-kinesis/runtimeConfig.ts index f08804e57ff80..918ea23b8e791 100644 --- a/clients/client-kinesis/runtimeConfig.ts +++ b/clients/client-kinesis/runtimeConfig.ts @@ -25,7 +25,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), eventStreamSerdeProvider, maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), diff --git a/clients/client-kms/KMSClient.ts b/clients/client-kms/KMSClient.ts index 4b60eeb367381..57795aaf6144a 100644 --- a/clients/client-kms/KMSClient.ts +++ b/clients/client-kms/KMSClient.ts @@ -126,6 +126,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -136,6 +137,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -281,11 +283,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -327,6 +324,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type KMSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -335,8 +338,8 @@ export type KMSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KMSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -344,8 +347,8 @@ export type KMSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Key Management Service @@ -455,16 +458,16 @@ export class KMSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kms/runtimeConfig.browser.ts b/clients/client-kms/runtimeConfig.browser.ts index 6a2f63e13ccdf..e405ffcb16b90 100644 --- a/clients/client-kms/runtimeConfig.browser.ts +++ b/clients/client-kms/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kms/runtimeConfig.native.ts b/clients/client-kms/runtimeConfig.native.ts index f589702c79b6b..9f37a196e9a65 100644 --- a/clients/client-kms/runtimeConfig.native.ts +++ b/clients/client-kms/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KMSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kms/runtimeConfig.ts b/clients/client-kms/runtimeConfig.ts index fa965e1a8bd2d..2d2f1327c8370 100644 --- a/clients/client-kms/runtimeConfig.ts +++ b/clients/client-kms/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-lakeformation/LakeFormationClient.ts b/clients/client-lakeformation/LakeFormationClient.ts index bbfb99b62bda2..52d496dcaff70 100644 --- a/clients/client-lakeformation/LakeFormationClient.ts +++ b/clients/client-lakeformation/LakeFormationClient.ts @@ -63,6 +63,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -73,6 +74,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -152,11 +154,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -198,6 +195,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type LakeFormationClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -206,8 +209,8 @@ export type LakeFormationClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LakeFormationClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -215,8 +218,8 @@ export type LakeFormationClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Lake Formation @@ -239,16 +242,16 @@ export class LakeFormationClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-lakeformation/runtimeConfig.browser.ts b/clients/client-lakeformation/runtimeConfig.browser.ts index c3f4c7865c5e8..544afdc81a0bd 100644 --- a/clients/client-lakeformation/runtimeConfig.browser.ts +++ b/clients/client-lakeformation/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-lakeformation/runtimeConfig.native.ts b/clients/client-lakeformation/runtimeConfig.native.ts index 0dbe680ce5b43..cc112c3661964 100644 --- a/clients/client-lakeformation/runtimeConfig.native.ts +++ b/clients/client-lakeformation/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LakeFormationClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-lakeformation/runtimeConfig.ts b/clients/client-lakeformation/runtimeConfig.ts index dc67071f583df..28f26047522d8 100644 --- a/clients/client-lakeformation/runtimeConfig.ts +++ b/clients/client-lakeformation/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-lambda/LambdaClient.ts b/clients/client-lambda/LambdaClient.ts index fc4be790bc28a..7cd72f36b54e4 100644 --- a/clients/client-lambda/LambdaClient.ts +++ b/clients/client-lambda/LambdaClient.ts @@ -195,6 +195,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -205,6 +206,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -374,11 +376,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -420,6 +417,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type LambdaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -428,8 +431,8 @@ export type LambdaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LambdaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -437,8 +440,8 @@ export type LambdaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Lambda @@ -466,16 +469,16 @@ export class LambdaClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-lambda/runtimeConfig.browser.ts b/clients/client-lambda/runtimeConfig.browser.ts index bc489aa675a89..6eb4f52d48947 100644 --- a/clients/client-lambda/runtimeConfig.browser.ts +++ b/clients/client-lambda/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-lambda/runtimeConfig.native.ts b/clients/client-lambda/runtimeConfig.native.ts index 95427ba54a600..294305bfb6ebc 100644 --- a/clients/client-lambda/runtimeConfig.native.ts +++ b/clients/client-lambda/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LambdaClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-lambda/runtimeConfig.ts b/clients/client-lambda/runtimeConfig.ts index 57812c2d25f81..df5a968474eab 100644 --- a/clients/client-lambda/runtimeConfig.ts +++ b/clients/client-lambda/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-lex-model-building-service/LexModelBuildingServiceClient.ts b/clients/client-lex-model-building-service/LexModelBuildingServiceClient.ts index c9a278b45a5fa..55b5c263c9646 100644 --- a/clients/client-lex-model-building-service/LexModelBuildingServiceClient.ts +++ b/clients/client-lex-model-building-service/LexModelBuildingServiceClient.ts @@ -104,6 +104,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -114,6 +115,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -245,11 +247,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -291,6 +288,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type LexModelBuildingServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -299,8 +302,8 @@ export type LexModelBuildingServiceClientConfig = Partial<__SmithyConfiguration< EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LexModelBuildingServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -308,8 +311,8 @@ export type LexModelBuildingServiceClientResolvedConfig = __SmithyResolvedConfig EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Lex Build-Time Actions @@ -334,16 +337,16 @@ export class LexModelBuildingServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-lex-model-building-service/runtimeConfig.browser.ts b/clients/client-lex-model-building-service/runtimeConfig.browser.ts index 7bff2a013b34f..28692dc4c13b5 100644 --- a/clients/client-lex-model-building-service/runtimeConfig.browser.ts +++ b/clients/client-lex-model-building-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-lex-model-building-service/runtimeConfig.native.ts b/clients/client-lex-model-building-service/runtimeConfig.native.ts index efae1a69a053f..f972a1b1781e2 100644 --- a/clients/client-lex-model-building-service/runtimeConfig.native.ts +++ b/clients/client-lex-model-building-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LexModelBuildingServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-lex-model-building-service/runtimeConfig.ts b/clients/client-lex-model-building-service/runtimeConfig.ts index c06f2589364ad..8b7e4273e6072 100644 --- a/clients/client-lex-model-building-service/runtimeConfig.ts +++ b/clients/client-lex-model-building-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-lex-runtime-service/LexRuntimeServiceClient.ts b/clients/client-lex-runtime-service/LexRuntimeServiceClient.ts index 30c574f902e88..1e4465fcc45c3 100644 --- a/clients/client-lex-runtime-service/LexRuntimeServiceClient.ts +++ b/clients/client-lex-runtime-service/LexRuntimeServiceClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -113,11 +115,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -159,6 +156,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type LexRuntimeServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -167,8 +170,8 @@ export type LexRuntimeServiceClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LexRuntimeServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -176,8 +179,8 @@ export type LexRuntimeServiceClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Lex provides both build and runtime endpoints. Each endpoint provides a set of @@ -207,16 +210,16 @@ export class LexRuntimeServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-lex-runtime-service/runtimeConfig.browser.ts b/clients/client-lex-runtime-service/runtimeConfig.browser.ts index 3fee6e138d0f8..372e780aedeb5 100644 --- a/clients/client-lex-runtime-service/runtimeConfig.browser.ts +++ b/clients/client-lex-runtime-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-lex-runtime-service/runtimeConfig.native.ts b/clients/client-lex-runtime-service/runtimeConfig.native.ts index 3d97604d2104d..2dafe4e39ae01 100644 --- a/clients/client-lex-runtime-service/runtimeConfig.native.ts +++ b/clients/client-lex-runtime-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LexRuntimeServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-lex-runtime-service/runtimeConfig.ts b/clients/client-lex-runtime-service/runtimeConfig.ts index 0a67dee71d61e..934d12d5411e3 100644 --- a/clients/client-lex-runtime-service/runtimeConfig.ts +++ b/clients/client-lex-runtime-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-license-manager/LicenseManagerClient.ts b/clients/client-license-manager/LicenseManagerClient.ts index c189a024dcf17..61d712254b759 100644 --- a/clients/client-license-manager/LicenseManagerClient.ts +++ b/clients/client-license-manager/LicenseManagerClient.ts @@ -132,6 +132,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -142,6 +143,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -275,11 +277,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -321,6 +318,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type LicenseManagerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -329,8 +332,8 @@ export type LicenseManagerClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LicenseManagerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -338,8 +341,8 @@ export type LicenseManagerClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS License Manager @@ -363,16 +366,16 @@ export class LicenseManagerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-license-manager/runtimeConfig.browser.ts b/clients/client-license-manager/runtimeConfig.browser.ts index a84c699effda7..900ebefbe4234 100644 --- a/clients/client-license-manager/runtimeConfig.browser.ts +++ b/clients/client-license-manager/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-license-manager/runtimeConfig.native.ts b/clients/client-license-manager/runtimeConfig.native.ts index f2d40a1463190..40aba5fecaee0 100644 --- a/clients/client-license-manager/runtimeConfig.native.ts +++ b/clients/client-license-manager/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LicenseManagerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-license-manager/runtimeConfig.ts b/clients/client-license-manager/runtimeConfig.ts index e0698a2e9427b..4af0572dd20db 100644 --- a/clients/client-license-manager/runtimeConfig.ts +++ b/clients/client-license-manager/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-lightsail/LightsailClient.ts b/clients/client-lightsail/LightsailClient.ts index 69549b4294e09..24d603c3d1f21 100644 --- a/clients/client-lightsail/LightsailClient.ts +++ b/clients/client-lightsail/LightsailClient.ts @@ -386,6 +386,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -396,6 +397,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -731,11 +733,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -777,6 +774,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type LightsailClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -785,8 +788,8 @@ export type LightsailClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LightsailClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -794,8 +797,8 @@ export type LightsailClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Lightsail is the easiest way to get started with Amazon Web Services (AWS) for developers @@ -831,16 +834,16 @@ export class LightsailClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-lightsail/runtimeConfig.browser.ts b/clients/client-lightsail/runtimeConfig.browser.ts index 0ac4cd8d625d9..58ebf455d018f 100644 --- a/clients/client-lightsail/runtimeConfig.browser.ts +++ b/clients/client-lightsail/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-lightsail/runtimeConfig.native.ts b/clients/client-lightsail/runtimeConfig.native.ts index 5868249ab557f..591ab77bd51d9 100644 --- a/clients/client-lightsail/runtimeConfig.native.ts +++ b/clients/client-lightsail/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LightsailClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-lightsail/runtimeConfig.ts b/clients/client-lightsail/runtimeConfig.ts index fec6ffebc3c9c..48f8022b21dbe 100644 --- a/clients/client-lightsail/runtimeConfig.ts +++ b/clients/client-lightsail/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-lookoutvision/LookoutVisionClient.ts b/clients/client-lookoutvision/LookoutVisionClient.ts index f26001f1d0482..4e51c47f4a258 100644 --- a/clients/client-lookoutvision/LookoutVisionClient.ts +++ b/clients/client-lookoutvision/LookoutVisionClient.ts @@ -54,6 +54,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -64,6 +65,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -149,11 +151,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -195,6 +192,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type LookoutVisionClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -203,8 +206,8 @@ export type LookoutVisionClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LookoutVisionClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -212,8 +215,8 @@ export type LookoutVisionClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This is the Amazon Lookout for Vision API Reference. It provides descriptions of actions, @@ -241,16 +244,16 @@ export class LookoutVisionClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-lookoutvision/runtimeConfig.browser.ts b/clients/client-lookoutvision/runtimeConfig.browser.ts index 174f22a943bb1..398dcae421f13 100644 --- a/clients/client-lookoutvision/runtimeConfig.browser.ts +++ b/clients/client-lookoutvision/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-lookoutvision/runtimeConfig.native.ts b/clients/client-lookoutvision/runtimeConfig.native.ts index 9c425471e0547..dbd3e5d33f277 100644 --- a/clients/client-lookoutvision/runtimeConfig.native.ts +++ b/clients/client-lookoutvision/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LookoutVisionClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-lookoutvision/runtimeConfig.ts b/clients/client-lookoutvision/runtimeConfig.ts index 9ebb374218c66..485b5ab26e062 100644 --- a/clients/client-lookoutvision/runtimeConfig.ts +++ b/clients/client-lookoutvision/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-machine-learning/MachineLearningClient.ts b/clients/client-machine-learning/MachineLearningClient.ts index 27d5872e39fd4..ca5dc922954e4 100644 --- a/clients/client-machine-learning/MachineLearningClient.ts +++ b/clients/client-machine-learning/MachineLearningClient.ts @@ -96,6 +96,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -106,6 +107,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -215,11 +217,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -261,6 +258,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MachineLearningClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -269,8 +272,8 @@ export type MachineLearningClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MachineLearningClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -278,8 +281,8 @@ export type MachineLearningClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Definition of the public APIs @@ -302,16 +305,16 @@ export class MachineLearningClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-machine-learning/runtimeConfig.browser.ts b/clients/client-machine-learning/runtimeConfig.browser.ts index 1658535d8132b..fe9066f189ed7 100644 --- a/clients/client-machine-learning/runtimeConfig.browser.ts +++ b/clients/client-machine-learning/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-machine-learning/runtimeConfig.native.ts b/clients/client-machine-learning/runtimeConfig.native.ts index 6f46fd040c75f..b84819bb12804 100644 --- a/clients/client-machine-learning/runtimeConfig.native.ts +++ b/clients/client-machine-learning/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MachineLearningClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-machine-learning/runtimeConfig.ts b/clients/client-machine-learning/runtimeConfig.ts index 04050d943d6c2..f1f1ad56bf868 100644 --- a/clients/client-machine-learning/runtimeConfig.ts +++ b/clients/client-machine-learning/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-macie/MacieClient.ts b/clients/client-macie/MacieClient.ts index e4f88b336e2f2..6cce2fac315fe 100644 --- a/clients/client-macie/MacieClient.ts +++ b/clients/client-macie/MacieClient.ts @@ -54,6 +54,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -64,6 +65,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -131,11 +133,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -177,6 +174,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MacieClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -185,8 +188,8 @@ export type MacieClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MacieClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -194,8 +197,8 @@ export type MacieClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Macie Classic @@ -227,16 +230,16 @@ export class MacieClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-macie/runtimeConfig.browser.ts b/clients/client-macie/runtimeConfig.browser.ts index a6a89f18a7bdf..feabe5319b683 100644 --- a/clients/client-macie/runtimeConfig.browser.ts +++ b/clients/client-macie/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-macie/runtimeConfig.native.ts b/clients/client-macie/runtimeConfig.native.ts index 7177195219a5e..8af081227fcbc 100644 --- a/clients/client-macie/runtimeConfig.native.ts +++ b/clients/client-macie/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MacieClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-macie/runtimeConfig.ts b/clients/client-macie/runtimeConfig.ts index 54ae38186ed7b..314b5cda946c6 100644 --- a/clients/client-macie/runtimeConfig.ts +++ b/clients/client-macie/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-macie2/Macie2Client.ts b/clients/client-macie2/Macie2Client.ts index 819416067d5a9..2966638050249 100644 --- a/clients/client-macie2/Macie2Client.ts +++ b/clients/client-macie2/Macie2Client.ts @@ -170,6 +170,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -180,6 +181,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -335,11 +337,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -381,6 +378,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type Macie2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -389,8 +392,8 @@ export type Macie2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type Macie2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -398,8 +401,8 @@ export type Macie2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Macie is a fully managed data security and data privacy service that uses machine learning and pattern matching to discover and protect your sensitive data in AWS. Macie automates the discovery of sensitive data, such as PII and intellectual property, to provide you with insight into the data that your organization stores in AWS. Macie also provides an inventory of your Amazon S3 buckets, which it continually monitors for you. If Macie detects sensitive data or potential data access issues, it generates detailed findings for you to review and act upon as necessary.

@@ -421,16 +424,16 @@ export class Macie2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-macie2/runtimeConfig.browser.ts b/clients/client-macie2/runtimeConfig.browser.ts index a445915561154..781ab5aa9361a 100644 --- a/clients/client-macie2/runtimeConfig.browser.ts +++ b/clients/client-macie2/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-macie2/runtimeConfig.native.ts b/clients/client-macie2/runtimeConfig.native.ts index c947e3b96a933..56aa2e97b888e 100644 --- a/clients/client-macie2/runtimeConfig.native.ts +++ b/clients/client-macie2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./Macie2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-macie2/runtimeConfig.ts b/clients/client-macie2/runtimeConfig.ts index 372f10f8bbf18..2887731037011 100644 --- a/clients/client-macie2/runtimeConfig.ts +++ b/clients/client-macie2/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-managedblockchain/ManagedBlockchainClient.ts b/clients/client-managedblockchain/ManagedBlockchainClient.ts index 29c08b1a2a6b5..95791b0d50184 100644 --- a/clients/client-managedblockchain/ManagedBlockchainClient.ts +++ b/clients/client-managedblockchain/ManagedBlockchainClient.ts @@ -55,6 +55,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -65,6 +66,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -158,11 +160,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -204,6 +201,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ManagedBlockchainClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -212,8 +215,8 @@ export type ManagedBlockchainClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ManagedBlockchainClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -221,8 +224,8 @@ export type ManagedBlockchainClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -245,16 +248,16 @@ export class ManagedBlockchainClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-managedblockchain/runtimeConfig.browser.ts b/clients/client-managedblockchain/runtimeConfig.browser.ts index 0abd1eda07877..252b912df3f51 100644 --- a/clients/client-managedblockchain/runtimeConfig.browser.ts +++ b/clients/client-managedblockchain/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-managedblockchain/runtimeConfig.native.ts b/clients/client-managedblockchain/runtimeConfig.native.ts index 958e3de5d4848..faeead11e077d 100644 --- a/clients/client-managedblockchain/runtimeConfig.native.ts +++ b/clients/client-managedblockchain/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ManagedBlockchainClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-managedblockchain/runtimeConfig.ts b/clients/client-managedblockchain/runtimeConfig.ts index 6be200e1d018f..36dbcb9871cbe 100644 --- a/clients/client-managedblockchain/runtimeConfig.ts +++ b/clients/client-managedblockchain/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-marketplace-catalog/MarketplaceCatalogClient.ts b/clients/client-marketplace-catalog/MarketplaceCatalogClient.ts index da3780b62caeb..20665f2ea8eb7 100644 --- a/clients/client-marketplace-catalog/MarketplaceCatalogClient.ts +++ b/clients/client-marketplace-catalog/MarketplaceCatalogClient.ts @@ -41,6 +41,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -51,6 +52,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -116,11 +118,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -162,6 +159,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MarketplaceCatalogClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -170,8 +173,8 @@ export type MarketplaceCatalogClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MarketplaceCatalogClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -179,8 +182,8 @@ export type MarketplaceCatalogClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Catalog API actions allow you to manage your entities through list, describe, and update @@ -208,16 +211,16 @@ export class MarketplaceCatalogClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-marketplace-catalog/runtimeConfig.browser.ts b/clients/client-marketplace-catalog/runtimeConfig.browser.ts index 24faccf6ed40d..7d950c823a99d 100644 --- a/clients/client-marketplace-catalog/runtimeConfig.browser.ts +++ b/clients/client-marketplace-catalog/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-marketplace-catalog/runtimeConfig.native.ts b/clients/client-marketplace-catalog/runtimeConfig.native.ts index db977ea40f232..e2dfdfb7bd7cd 100644 --- a/clients/client-marketplace-catalog/runtimeConfig.native.ts +++ b/clients/client-marketplace-catalog/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MarketplaceCatalogClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-marketplace-catalog/runtimeConfig.ts b/clients/client-marketplace-catalog/runtimeConfig.ts index b04154ca820e8..21e9f856e8627 100644 --- a/clients/client-marketplace-catalog/runtimeConfig.ts +++ b/clients/client-marketplace-catalog/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-marketplace-commerce-analytics/MarketplaceCommerceAnalyticsClient.ts b/clients/client-marketplace-commerce-analytics/MarketplaceCommerceAnalyticsClient.ts index d51affc184459..ca166809d1ac9 100644 --- a/clients/client-marketplace-commerce-analytics/MarketplaceCommerceAnalyticsClient.ts +++ b/clients/client-marketplace-commerce-analytics/MarketplaceCommerceAnalyticsClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GenerateDataSetCommandInput | StartSupportDataExportCommandInput; @@ -103,11 +105,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -149,6 +146,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MarketplaceCommerceAnalyticsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -157,8 +160,8 @@ export type MarketplaceCommerceAnalyticsClientConfig = Partial<__SmithyConfigura EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MarketplaceCommerceAnalyticsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -166,8 +169,8 @@ export type MarketplaceCommerceAnalyticsClientResolvedConfig = __SmithyResolvedC EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Provides AWS Marketplace business intelligence data on-demand. @@ -189,16 +192,16 @@ export class MarketplaceCommerceAnalyticsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-marketplace-commerce-analytics/runtimeConfig.browser.ts b/clients/client-marketplace-commerce-analytics/runtimeConfig.browser.ts index 38c169205c460..4aa94f6bfe7d1 100644 --- a/clients/client-marketplace-commerce-analytics/runtimeConfig.browser.ts +++ b/clients/client-marketplace-commerce-analytics/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-marketplace-commerce-analytics/runtimeConfig.native.ts b/clients/client-marketplace-commerce-analytics/runtimeConfig.native.ts index 5521199facf30..1ff4198d6d666 100644 --- a/clients/client-marketplace-commerce-analytics/runtimeConfig.native.ts +++ b/clients/client-marketplace-commerce-analytics/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MarketplaceCommerceAnalyticsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-marketplace-commerce-analytics/runtimeConfig.ts b/clients/client-marketplace-commerce-analytics/runtimeConfig.ts index b53b4bb6ccd71..2441510ef22c7 100644 --- a/clients/client-marketplace-commerce-analytics/runtimeConfig.ts +++ b/clients/client-marketplace-commerce-analytics/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-marketplace-entitlement-service/MarketplaceEntitlementServiceClient.ts b/clients/client-marketplace-entitlement-service/MarketplaceEntitlementServiceClient.ts index a6bc0c100f774..d6cc3b7179967 100644 --- a/clients/client-marketplace-entitlement-service/MarketplaceEntitlementServiceClient.ts +++ b/clients/client-marketplace-entitlement-service/MarketplaceEntitlementServiceClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GetEntitlementsCommandInput; @@ -99,11 +101,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -145,6 +142,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MarketplaceEntitlementServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -153,8 +156,8 @@ export type MarketplaceEntitlementServiceClientConfig = Partial<__SmithyConfigur EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MarketplaceEntitlementServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -162,8 +165,8 @@ export type MarketplaceEntitlementServiceClientResolvedConfig = __SmithyResolved EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Marketplace Entitlement Service @@ -201,16 +204,16 @@ export class MarketplaceEntitlementServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-marketplace-entitlement-service/runtimeConfig.browser.ts b/clients/client-marketplace-entitlement-service/runtimeConfig.browser.ts index 78333b72fbff0..1c7f94b781e24 100644 --- a/clients/client-marketplace-entitlement-service/runtimeConfig.browser.ts +++ b/clients/client-marketplace-entitlement-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-marketplace-entitlement-service/runtimeConfig.native.ts b/clients/client-marketplace-entitlement-service/runtimeConfig.native.ts index cf94a1d6e5a46..9a05824b6595e 100644 --- a/clients/client-marketplace-entitlement-service/runtimeConfig.native.ts +++ b/clients/client-marketplace-entitlement-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MarketplaceEntitlementServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-marketplace-entitlement-service/runtimeConfig.ts b/clients/client-marketplace-entitlement-service/runtimeConfig.ts index 9cea2f8517bec..7ab8df9055762 100644 --- a/clients/client-marketplace-entitlement-service/runtimeConfig.ts +++ b/clients/client-marketplace-entitlement-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-marketplace-metering/MarketplaceMeteringClient.ts b/clients/client-marketplace-metering/MarketplaceMeteringClient.ts index 86597ebe23e72..e34dc8adade7c 100644 --- a/clients/client-marketplace-metering/MarketplaceMeteringClient.ts +++ b/clients/client-marketplace-metering/MarketplaceMeteringClient.ts @@ -39,6 +39,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -49,6 +50,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -110,11 +112,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -156,6 +153,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MarketplaceMeteringClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -164,8 +167,8 @@ export type MarketplaceMeteringClientConfig = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MarketplaceMeteringClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -173,8 +176,8 @@ export type MarketplaceMeteringClientResolvedConfig = __SmithyResolvedConfigurat EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Marketplace Metering Service @@ -252,16 +255,16 @@ export class MarketplaceMeteringClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-marketplace-metering/runtimeConfig.browser.ts b/clients/client-marketplace-metering/runtimeConfig.browser.ts index c41c5e38106a8..05926f90a7560 100644 --- a/clients/client-marketplace-metering/runtimeConfig.browser.ts +++ b/clients/client-marketplace-metering/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-marketplace-metering/runtimeConfig.native.ts b/clients/client-marketplace-metering/runtimeConfig.native.ts index e42dc36ff62f0..822a898b4f809 100644 --- a/clients/client-marketplace-metering/runtimeConfig.native.ts +++ b/clients/client-marketplace-metering/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MarketplaceMeteringClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-marketplace-metering/runtimeConfig.ts b/clients/client-marketplace-metering/runtimeConfig.ts index 88c43d3d14a2f..f99392ef440a2 100644 --- a/clients/client-marketplace-metering/runtimeConfig.ts +++ b/clients/client-marketplace-metering/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediaconnect/MediaConnectClient.ts b/clients/client-mediaconnect/MediaConnectClient.ts index 557df93d6ae9e..5cfa7cf351c9a 100644 --- a/clients/client-mediaconnect/MediaConnectClient.ts +++ b/clients/client-mediaconnect/MediaConnectClient.ts @@ -83,6 +83,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -93,6 +94,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -200,11 +202,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -246,6 +243,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MediaConnectClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -254,8 +257,8 @@ export type MediaConnectClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaConnectClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -263,8 +266,8 @@ export type MediaConnectClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * API for AWS Elemental MediaConnect @@ -286,16 +289,16 @@ export class MediaConnectClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediaconnect/runtimeConfig.browser.ts b/clients/client-mediaconnect/runtimeConfig.browser.ts index a7f8aa623d14a..c4e5bca28f5eb 100644 --- a/clients/client-mediaconnect/runtimeConfig.browser.ts +++ b/clients/client-mediaconnect/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediaconnect/runtimeConfig.native.ts b/clients/client-mediaconnect/runtimeConfig.native.ts index 5d0e362bb3e9b..65480d3e28657 100644 --- a/clients/client-mediaconnect/runtimeConfig.native.ts +++ b/clients/client-mediaconnect/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaConnectClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediaconnect/runtimeConfig.ts b/clients/client-mediaconnect/runtimeConfig.ts index 50ee9f024cd24..5078e3a32a8fe 100644 --- a/clients/client-mediaconnect/runtimeConfig.ts +++ b/clients/client-mediaconnect/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediaconvert/MediaConvertClient.ts b/clients/client-mediaconvert/MediaConvertClient.ts index 65e408b3b5fe1..7b55a3d904521 100644 --- a/clients/client-mediaconvert/MediaConvertClient.ts +++ b/clients/client-mediaconvert/MediaConvertClient.ts @@ -69,6 +69,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -79,6 +80,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -182,11 +184,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -228,6 +225,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MediaConvertClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -236,8 +239,8 @@ export type MediaConvertClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaConvertClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -245,8 +248,8 @@ export type MediaConvertClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Elemental MediaConvert @@ -268,16 +271,16 @@ export class MediaConvertClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediaconvert/runtimeConfig.browser.ts b/clients/client-mediaconvert/runtimeConfig.browser.ts index b431a5e74268d..0fce6306bee46 100644 --- a/clients/client-mediaconvert/runtimeConfig.browser.ts +++ b/clients/client-mediaconvert/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediaconvert/runtimeConfig.native.ts b/clients/client-mediaconvert/runtimeConfig.native.ts index 9f886f7722f6c..384cb42f0b1d7 100644 --- a/clients/client-mediaconvert/runtimeConfig.native.ts +++ b/clients/client-mediaconvert/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaConvertClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediaconvert/runtimeConfig.ts b/clients/client-mediaconvert/runtimeConfig.ts index c51e53d7ae3f2..b613a8a25a884 100644 --- a/clients/client-mediaconvert/runtimeConfig.ts +++ b/clients/client-mediaconvert/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-medialive/MediaLiveClient.ts b/clients/client-medialive/MediaLiveClient.ts index 3017f0f00fc82..dc5bdf8f26313 100644 --- a/clients/client-medialive/MediaLiveClient.ts +++ b/clients/client-medialive/MediaLiveClient.ts @@ -150,6 +150,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -160,6 +161,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -323,11 +325,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -369,6 +366,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MediaLiveClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -377,8 +380,8 @@ export type MediaLiveClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaLiveClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -386,8 +389,8 @@ export type MediaLiveClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * API for AWS Elemental MediaLive @@ -409,16 +412,16 @@ export class MediaLiveClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-medialive/runtimeConfig.browser.ts b/clients/client-medialive/runtimeConfig.browser.ts index c806ed837fdae..a9ef851ef24db 100644 --- a/clients/client-medialive/runtimeConfig.browser.ts +++ b/clients/client-medialive/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-medialive/runtimeConfig.native.ts b/clients/client-medialive/runtimeConfig.native.ts index 978431e867c87..1c811ff93104b 100644 --- a/clients/client-medialive/runtimeConfig.native.ts +++ b/clients/client-medialive/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaLiveClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-medialive/runtimeConfig.ts b/clients/client-medialive/runtimeConfig.ts index b395e847f6568..bb43c1f540910 100644 --- a/clients/client-medialive/runtimeConfig.ts +++ b/clients/client-medialive/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediapackage-vod/MediaPackageVodClient.ts b/clients/client-mediapackage-vod/MediaPackageVodClient.ts index 24a4c9f5084cc..7da2a98f96488 100644 --- a/clients/client-mediapackage-vod/MediaPackageVodClient.ts +++ b/clients/client-mediapackage-vod/MediaPackageVodClient.ts @@ -81,6 +81,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -91,6 +92,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -176,11 +178,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -222,6 +219,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MediaPackageVodClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -230,8 +233,8 @@ export type MediaPackageVodClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaPackageVodClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -239,8 +242,8 @@ export type MediaPackageVodClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Elemental MediaPackage VOD @@ -262,16 +265,16 @@ export class MediaPackageVodClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediapackage-vod/runtimeConfig.browser.ts b/clients/client-mediapackage-vod/runtimeConfig.browser.ts index c21fda55558e1..db74a22c4d591 100644 --- a/clients/client-mediapackage-vod/runtimeConfig.browser.ts +++ b/clients/client-mediapackage-vod/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediapackage-vod/runtimeConfig.native.ts b/clients/client-mediapackage-vod/runtimeConfig.native.ts index 2fb54a3a1bfa0..ebf00bea258ac 100644 --- a/clients/client-mediapackage-vod/runtimeConfig.native.ts +++ b/clients/client-mediapackage-vod/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaPackageVodClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediapackage-vod/runtimeConfig.ts b/clients/client-mediapackage-vod/runtimeConfig.ts index 7dfcfc1ccc970..d680695ae8c4a 100644 --- a/clients/client-mediapackage-vod/runtimeConfig.ts +++ b/clients/client-mediapackage-vod/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediapackage/MediaPackageClient.ts b/clients/client-mediapackage/MediaPackageClient.ts index 7334d9c98da04..52b2defa0c1a5 100644 --- a/clients/client-mediapackage/MediaPackageClient.ts +++ b/clients/client-mediapackage/MediaPackageClient.ts @@ -78,6 +78,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -88,6 +89,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -179,11 +181,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -225,6 +222,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MediaPackageClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -233,8 +236,8 @@ export type MediaPackageClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaPackageClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -242,8 +245,8 @@ export type MediaPackageClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Elemental MediaPackage @@ -265,16 +268,16 @@ export class MediaPackageClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediapackage/runtimeConfig.browser.ts b/clients/client-mediapackage/runtimeConfig.browser.ts index eb1e8310a0f4a..08bfbaeb4728f 100644 --- a/clients/client-mediapackage/runtimeConfig.browser.ts +++ b/clients/client-mediapackage/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediapackage/runtimeConfig.native.ts b/clients/client-mediapackage/runtimeConfig.native.ts index a554726da5a5f..54d8667e228c1 100644 --- a/clients/client-mediapackage/runtimeConfig.native.ts +++ b/clients/client-mediapackage/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaPackageClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediapackage/runtimeConfig.ts b/clients/client-mediapackage/runtimeConfig.ts index faed062b5b34e..a23854c3e3c37 100644 --- a/clients/client-mediapackage/runtimeConfig.ts +++ b/clients/client-mediapackage/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediastore-data/MediaStoreDataClient.ts b/clients/client-mediastore-data/MediaStoreDataClient.ts index 7838080ad64c6..6267d878f79b6 100644 --- a/clients/client-mediastore-data/MediaStoreDataClient.ts +++ b/clients/client-mediastore-data/MediaStoreDataClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -113,11 +115,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -159,6 +156,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MediaStoreDataClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -167,8 +170,8 @@ export type MediaStoreDataClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaStoreDataClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -176,8 +179,8 @@ export type MediaStoreDataClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

An AWS Elemental MediaStore asset is an object, similar to an object in the Amazon S3 @@ -201,16 +204,16 @@ export class MediaStoreDataClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediastore-data/runtimeConfig.browser.ts b/clients/client-mediastore-data/runtimeConfig.browser.ts index 958f1b4c07513..e633725eb4897 100644 --- a/clients/client-mediastore-data/runtimeConfig.browser.ts +++ b/clients/client-mediastore-data/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediastore-data/runtimeConfig.native.ts b/clients/client-mediastore-data/runtimeConfig.native.ts index f4fa4b4a5c531..45b59a450dc26 100644 --- a/clients/client-mediastore-data/runtimeConfig.native.ts +++ b/clients/client-mediastore-data/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaStoreDataClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediastore-data/runtimeConfig.ts b/clients/client-mediastore-data/runtimeConfig.ts index dc70773617c5b..299816ab913a2 100644 --- a/clients/client-mediastore-data/runtimeConfig.ts +++ b/clients/client-mediastore-data/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediastore/MediaStoreClient.ts b/clients/client-mediastore/MediaStoreClient.ts index b1b4e5aab8f73..ea74ca011bf56 100644 --- a/clients/client-mediastore/MediaStoreClient.ts +++ b/clients/client-mediastore/MediaStoreClient.ts @@ -65,6 +65,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -75,6 +76,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MediaStoreClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +227,8 @@ export type MediaStoreClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaStoreClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +236,8 @@ export type MediaStoreClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

An AWS Elemental MediaStore container is a namespace that holds folders and objects. @@ -257,16 +260,16 @@ export class MediaStoreClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediastore/runtimeConfig.browser.ts b/clients/client-mediastore/runtimeConfig.browser.ts index 1719626d88c70..d01eecf79f06f 100644 --- a/clients/client-mediastore/runtimeConfig.browser.ts +++ b/clients/client-mediastore/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediastore/runtimeConfig.native.ts b/clients/client-mediastore/runtimeConfig.native.ts index 35ed4f0e88ff2..1086d5038f189 100644 --- a/clients/client-mediastore/runtimeConfig.native.ts +++ b/clients/client-mediastore/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaStoreClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediastore/runtimeConfig.ts b/clients/client-mediastore/runtimeConfig.ts index c1ed36b0e902b..cd483c7b91271 100644 --- a/clients/client-mediastore/runtimeConfig.ts +++ b/clients/client-mediastore/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediatailor/MediaTailorClient.ts b/clients/client-mediatailor/MediaTailorClient.ts index ccdfa9fc7b3f8..d154c02d14eae 100644 --- a/clients/client-mediatailor/MediaTailorClient.ts +++ b/clients/client-mediatailor/MediaTailorClient.ts @@ -57,6 +57,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -67,6 +68,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -134,11 +136,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -180,6 +177,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MediaTailorClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -188,8 +191,8 @@ export type MediaTailorClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaTailorClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -197,8 +200,8 @@ export type MediaTailorClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Use the AWS Elemental MediaTailor SDK to configure scalable ad insertion for your live and VOD content. With AWS Elemental MediaTailor, you can serve targeted ads to viewers while maintaining broadcast quality in over-the-top (OTT) video applications. For information about using the service, including detailed information about the settings covered in this guide, see the AWS Elemental MediaTailor User Guide.

Through the SDK, you manage AWS Elemental MediaTailor configurations the same as you do through the console. For example, you specify ad insertion behavior and mapping information for the origin server and the ad decision server (ADS).

@@ -220,16 +223,16 @@ export class MediaTailorClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediatailor/runtimeConfig.browser.ts b/clients/client-mediatailor/runtimeConfig.browser.ts index b1e53b07d9081..43d481229aa91 100644 --- a/clients/client-mediatailor/runtimeConfig.browser.ts +++ b/clients/client-mediatailor/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediatailor/runtimeConfig.native.ts b/clients/client-mediatailor/runtimeConfig.native.ts index 21f532e35a469..e55085eac7ae0 100644 --- a/clients/client-mediatailor/runtimeConfig.native.ts +++ b/clients/client-mediatailor/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaTailorClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediatailor/runtimeConfig.ts b/clients/client-mediatailor/runtimeConfig.ts index cf2ac30a12ed7..663e496d7200c 100644 --- a/clients/client-mediatailor/runtimeConfig.ts +++ b/clients/client-mediatailor/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-migration-hub/MigrationHubClient.ts b/clients/client-migration-hub/MigrationHubClient.ts index 82e8e5ef89f14..454f60796692c 100644 --- a/clients/client-migration-hub/MigrationHubClient.ts +++ b/clients/client-migration-hub/MigrationHubClient.ts @@ -100,6 +100,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -110,6 +111,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -197,11 +199,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -243,6 +240,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MigrationHubClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -251,8 +254,8 @@ export type MigrationHubClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MigrationHubClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -260,8 +263,8 @@ export type MigrationHubClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The AWS Migration Hub API methods help to obtain server and application migration status @@ -288,16 +291,16 @@ export class MigrationHubClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-migration-hub/runtimeConfig.browser.ts b/clients/client-migration-hub/runtimeConfig.browser.ts index 35c86deda7346..dab14126017ff 100644 --- a/clients/client-migration-hub/runtimeConfig.browser.ts +++ b/clients/client-migration-hub/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-migration-hub/runtimeConfig.native.ts b/clients/client-migration-hub/runtimeConfig.native.ts index 3e31aa7543c65..8a79f34c301eb 100644 --- a/clients/client-migration-hub/runtimeConfig.native.ts +++ b/clients/client-migration-hub/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MigrationHubClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-migration-hub/runtimeConfig.ts b/clients/client-migration-hub/runtimeConfig.ts index 7e49564037194..7a920bd7d5fe2 100644 --- a/clients/client-migration-hub/runtimeConfig.ts +++ b/clients/client-migration-hub/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-migrationhub-config/MigrationHubConfigClient.ts b/clients/client-migrationhub-config/MigrationHubConfigClient.ts index a77acbedd6904..cf15010c69365 100644 --- a/clients/client-migrationhub-config/MigrationHubConfigClient.ts +++ b/clients/client-migrationhub-config/MigrationHubConfigClient.ts @@ -44,6 +44,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -54,6 +55,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -113,11 +115,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -159,6 +156,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MigrationHubConfigClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -167,8 +170,8 @@ export type MigrationHubConfigClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MigrationHubConfigClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -176,8 +179,8 @@ export type MigrationHubConfigClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The AWS Migration Hub home region APIs are available specifically for working with your @@ -224,16 +227,16 @@ export class MigrationHubConfigClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-migrationhub-config/runtimeConfig.browser.ts b/clients/client-migrationhub-config/runtimeConfig.browser.ts index e50d07af47750..c4b08edced939 100644 --- a/clients/client-migrationhub-config/runtimeConfig.browser.ts +++ b/clients/client-migrationhub-config/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-migrationhub-config/runtimeConfig.native.ts b/clients/client-migrationhub-config/runtimeConfig.native.ts index 8d1f21b78e315..a747856aa20dd 100644 --- a/clients/client-migrationhub-config/runtimeConfig.native.ts +++ b/clients/client-migrationhub-config/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MigrationHubConfigClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-migrationhub-config/runtimeConfig.ts b/clients/client-migrationhub-config/runtimeConfig.ts index 39dbea53eda8d..dce3549104acd 100644 --- a/clients/client-migrationhub-config/runtimeConfig.ts +++ b/clients/client-migrationhub-config/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mobile/MobileClient.ts b/clients/client-mobile/MobileClient.ts index 85b1e8eec2f2d..ad42114922d9a 100644 --- a/clients/client-mobile/MobileClient.ts +++ b/clients/client-mobile/MobileClient.ts @@ -44,6 +44,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -54,6 +55,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -125,11 +127,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -171,6 +168,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MobileClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -179,8 +182,8 @@ export type MobileClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MobileClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -188,8 +191,8 @@ export type MobileClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -215,16 +218,16 @@ export class MobileClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mobile/runtimeConfig.browser.ts b/clients/client-mobile/runtimeConfig.browser.ts index 070b80b5b7d5d..ef8542c72690e 100644 --- a/clients/client-mobile/runtimeConfig.browser.ts +++ b/clients/client-mobile/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mobile/runtimeConfig.native.ts b/clients/client-mobile/runtimeConfig.native.ts index 84ba34ab5324d..17e2209140c74 100644 --- a/clients/client-mobile/runtimeConfig.native.ts +++ b/clients/client-mobile/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MobileClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mobile/runtimeConfig.ts b/clients/client-mobile/runtimeConfig.ts index 3c4665f0c5f7c..022252616e087 100644 --- a/clients/client-mobile/runtimeConfig.ts +++ b/clients/client-mobile/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mq/MqClient.ts b/clients/client-mq/MqClient.ts index efa22e857882c..02add361288a7 100644 --- a/clients/client-mq/MqClient.ts +++ b/clients/client-mq/MqClient.ts @@ -78,6 +78,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -88,6 +89,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -185,11 +187,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -231,6 +228,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MqClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -239,8 +242,8 @@ export type MqClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions> EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MqClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -248,8 +251,8 @@ export type MqClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandler EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon MQ is a managed message broker service for Apache ActiveMQ and RabbitMQ that makes it easy to set up and operate message brokers in the cloud. A message broker allows software applications and components to communicate using various programming languages, operating systems, and formal messaging protocols. @@ -271,16 +274,16 @@ export class MqClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mq/runtimeConfig.browser.ts b/clients/client-mq/runtimeConfig.browser.ts index 8e45013929d2d..4fe8d23829f03 100644 --- a/clients/client-mq/runtimeConfig.browser.ts +++ b/clients/client-mq/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mq/runtimeConfig.native.ts b/clients/client-mq/runtimeConfig.native.ts index 0c06fe3b99b33..95a55aa5e4377 100644 --- a/clients/client-mq/runtimeConfig.native.ts +++ b/clients/client-mq/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MqClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mq/runtimeConfig.ts b/clients/client-mq/runtimeConfig.ts index 65927b97b4e73..9862396080bb1 100644 --- a/clients/client-mq/runtimeConfig.ts +++ b/clients/client-mq/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mturk/MTurkClient.ts b/clients/client-mturk/MTurkClient.ts index 0a442ef6171bc..9ef3f15597f0e 100644 --- a/clients/client-mturk/MTurkClient.ts +++ b/clients/client-mturk/MTurkClient.ts @@ -137,6 +137,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -147,6 +148,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -278,11 +280,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -324,6 +321,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MTurkClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -332,8 +335,8 @@ export type MTurkClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MTurkClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -341,8 +344,8 @@ export type MTurkClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Mechanical Turk API Reference @@ -364,16 +367,16 @@ export class MTurkClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mturk/runtimeConfig.browser.ts b/clients/client-mturk/runtimeConfig.browser.ts index 700ac5768ac72..fffa5f6f2f72b 100644 --- a/clients/client-mturk/runtimeConfig.browser.ts +++ b/clients/client-mturk/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mturk/runtimeConfig.native.ts b/clients/client-mturk/runtimeConfig.native.ts index 687ba097dc707..f87ecc7df4fa4 100644 --- a/clients/client-mturk/runtimeConfig.native.ts +++ b/clients/client-mturk/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MTurkClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mturk/runtimeConfig.ts b/clients/client-mturk/runtimeConfig.ts index 7d468769805bc..aabda4f54d983 100644 --- a/clients/client-mturk/runtimeConfig.ts +++ b/clients/client-mturk/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-neptune/NeptuneClient.ts b/clients/client-neptune/NeptuneClient.ts index d4e4907f238df..ff5ad417d634d 100644 --- a/clients/client-neptune/NeptuneClient.ts +++ b/clients/client-neptune/NeptuneClient.ts @@ -245,6 +245,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -255,6 +256,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -434,11 +436,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -480,6 +477,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type NeptuneClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -488,8 +491,8 @@ export type NeptuneClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type NeptuneClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -497,8 +500,8 @@ export type NeptuneClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Neptune @@ -537,16 +540,16 @@ export class NeptuneClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-neptune/runtimeConfig.browser.ts b/clients/client-neptune/runtimeConfig.browser.ts index cd560819dfcf4..a78e68c38ab42 100644 --- a/clients/client-neptune/runtimeConfig.browser.ts +++ b/clients/client-neptune/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-neptune/runtimeConfig.native.ts b/clients/client-neptune/runtimeConfig.native.ts index 2b8c9ce733206..72d1508cda8b9 100644 --- a/clients/client-neptune/runtimeConfig.native.ts +++ b/clients/client-neptune/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./NeptuneClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-neptune/runtimeConfig.ts b/clients/client-neptune/runtimeConfig.ts index a339deeb1e6d8..1e09d36f386b6 100644 --- a/clients/client-neptune/runtimeConfig.ts +++ b/clients/client-neptune/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-network-firewall/NetworkFirewallClient.ts b/clients/client-network-firewall/NetworkFirewallClient.ts index 5d9a7b15ccd77..53ffe5151a96d 100644 --- a/clients/client-network-firewall/NetworkFirewallClient.ts +++ b/clients/client-network-firewall/NetworkFirewallClient.ts @@ -112,6 +112,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -122,6 +123,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -233,11 +235,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -279,6 +276,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type NetworkFirewallClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -287,8 +290,8 @@ export type NetworkFirewallClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type NetworkFirewallClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -296,8 +299,8 @@ export type NetworkFirewallClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This is the API Reference for AWS Network Firewall. This guide is for developers who need @@ -398,16 +401,16 @@ export class NetworkFirewallClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-network-firewall/runtimeConfig.browser.ts b/clients/client-network-firewall/runtimeConfig.browser.ts index 181e838300cbf..db9d1c9ee76b9 100644 --- a/clients/client-network-firewall/runtimeConfig.browser.ts +++ b/clients/client-network-firewall/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-network-firewall/runtimeConfig.native.ts b/clients/client-network-firewall/runtimeConfig.native.ts index 9080a99499d2b..de9e7ea510f2b 100644 --- a/clients/client-network-firewall/runtimeConfig.native.ts +++ b/clients/client-network-firewall/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./NetworkFirewallClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-network-firewall/runtimeConfig.ts b/clients/client-network-firewall/runtimeConfig.ts index e4bd0276e1fc3..7b1d2e26f1f23 100644 --- a/clients/client-network-firewall/runtimeConfig.ts +++ b/clients/client-network-firewall/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-networkmanager/NetworkManagerClient.ts b/clients/client-networkmanager/NetworkManagerClient.ts index 21c1507c1d247..e0ec87004f843 100644 --- a/clients/client-networkmanager/NetworkManagerClient.ts +++ b/clients/client-networkmanager/NetworkManagerClient.ts @@ -115,6 +115,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -125,6 +126,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -248,11 +250,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -294,6 +291,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type NetworkManagerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -302,8 +305,8 @@ export type NetworkManagerClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type NetworkManagerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -311,8 +314,8 @@ export type NetworkManagerClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Transit Gateway Network Manager (Network Manager) enables you to create a global network, in which you can monitor your @@ -336,16 +339,16 @@ export class NetworkManagerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-networkmanager/runtimeConfig.browser.ts b/clients/client-networkmanager/runtimeConfig.browser.ts index 118482dbb6788..5107e027a7294 100644 --- a/clients/client-networkmanager/runtimeConfig.browser.ts +++ b/clients/client-networkmanager/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-networkmanager/runtimeConfig.native.ts b/clients/client-networkmanager/runtimeConfig.native.ts index 2dad3f50694e3..9f36f057a7a62 100644 --- a/clients/client-networkmanager/runtimeConfig.native.ts +++ b/clients/client-networkmanager/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./NetworkManagerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-networkmanager/runtimeConfig.ts b/clients/client-networkmanager/runtimeConfig.ts index e0b69d70634fd..e2d52d6a5a049 100644 --- a/clients/client-networkmanager/runtimeConfig.ts +++ b/clients/client-networkmanager/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-opsworks/OpsWorksClient.ts b/clients/client-opsworks/OpsWorksClient.ts index bb373592a0c2d..57fccb06490bf 100644 --- a/clients/client-opsworks/OpsWorksClient.ts +++ b/clients/client-opsworks/OpsWorksClient.ts @@ -187,6 +187,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -197,6 +198,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -398,11 +400,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -444,6 +441,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type OpsWorksClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -452,8 +455,8 @@ export type OpsWorksClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type OpsWorksClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -461,8 +464,8 @@ export type OpsWorksClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS OpsWorks @@ -598,16 +601,16 @@ export class OpsWorksClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-opsworks/runtimeConfig.browser.ts b/clients/client-opsworks/runtimeConfig.browser.ts index a8485afee0192..4057c7787d369 100644 --- a/clients/client-opsworks/runtimeConfig.browser.ts +++ b/clients/client-opsworks/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-opsworks/runtimeConfig.native.ts b/clients/client-opsworks/runtimeConfig.native.ts index 190be7c51134f..4e1e13b3eebac 100644 --- a/clients/client-opsworks/runtimeConfig.native.ts +++ b/clients/client-opsworks/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./OpsWorksClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-opsworks/runtimeConfig.ts b/clients/client-opsworks/runtimeConfig.ts index 83dd8c28207a9..7c7a47fbc09f8 100644 --- a/clients/client-opsworks/runtimeConfig.ts +++ b/clients/client-opsworks/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-opsworkscm/OpsWorksCMClient.ts b/clients/client-opsworkscm/OpsWorksCMClient.ts index 9ec3ce2fbf409..b495afa58c080 100644 --- a/clients/client-opsworkscm/OpsWorksCMClient.ts +++ b/clients/client-opsworkscm/OpsWorksCMClient.ts @@ -69,6 +69,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -79,6 +80,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type OpsWorksCMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +227,8 @@ export type OpsWorksCMClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type OpsWorksCMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +236,8 @@ export type OpsWorksCMClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS OpsWorks CM @@ -343,16 +346,16 @@ export class OpsWorksCMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-opsworkscm/runtimeConfig.browser.ts b/clients/client-opsworkscm/runtimeConfig.browser.ts index 9faa544c9b79f..7f2185cac5201 100644 --- a/clients/client-opsworkscm/runtimeConfig.browser.ts +++ b/clients/client-opsworkscm/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-opsworkscm/runtimeConfig.native.ts b/clients/client-opsworkscm/runtimeConfig.native.ts index 46c8df4111135..136b8193f32c3 100644 --- a/clients/client-opsworkscm/runtimeConfig.native.ts +++ b/clients/client-opsworkscm/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./OpsWorksCMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-opsworkscm/runtimeConfig.ts b/clients/client-opsworkscm/runtimeConfig.ts index 05574e57fe014..2e2c70a404011 100644 --- a/clients/client-opsworkscm/runtimeConfig.ts +++ b/clients/client-opsworkscm/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-organizations/OrganizationsClient.ts b/clients/client-organizations/OrganizationsClient.ts index b54d8a2f63cca..829095ecc5374 100644 --- a/clients/client-organizations/OrganizationsClient.ts +++ b/clients/client-organizations/OrganizationsClient.ts @@ -161,6 +161,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -171,6 +172,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -326,11 +328,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -372,6 +369,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type OrganizationsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -380,8 +383,8 @@ export type OrganizationsClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type OrganizationsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -389,8 +392,8 @@ export type OrganizationsClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Organizations @@ -412,16 +415,16 @@ export class OrganizationsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-organizations/runtimeConfig.browser.ts b/clients/client-organizations/runtimeConfig.browser.ts index 0bbd703209087..2d368f08078c8 100644 --- a/clients/client-organizations/runtimeConfig.browser.ts +++ b/clients/client-organizations/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-organizations/runtimeConfig.native.ts b/clients/client-organizations/runtimeConfig.native.ts index 7f114f369b56b..e8e94b4f2b0aa 100644 --- a/clients/client-organizations/runtimeConfig.native.ts +++ b/clients/client-organizations/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./OrganizationsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-organizations/runtimeConfig.ts b/clients/client-organizations/runtimeConfig.ts index 4ef2f0fadf825..fd5cbad4b7279 100644 --- a/clients/client-organizations/runtimeConfig.ts +++ b/clients/client-organizations/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-outposts/OutpostsClient.ts b/clients/client-outposts/OutpostsClient.ts index d26eb71be3568..198420cc6da22 100644 --- a/clients/client-outposts/OutpostsClient.ts +++ b/clients/client-outposts/OutpostsClient.ts @@ -45,6 +45,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -55,6 +56,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -122,11 +124,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -168,6 +165,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type OutpostsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -176,8 +179,8 @@ export type OutpostsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type OutpostsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -185,8 +188,8 @@ export type OutpostsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Outposts is a fully-managed service that extends AWS infrastructure, @@ -213,16 +216,16 @@ export class OutpostsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-outposts/runtimeConfig.browser.ts b/clients/client-outposts/runtimeConfig.browser.ts index f52a4bc657f70..cc31f1773f6a5 100644 --- a/clients/client-outposts/runtimeConfig.browser.ts +++ b/clients/client-outposts/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-outposts/runtimeConfig.native.ts b/clients/client-outposts/runtimeConfig.native.ts index 0438b4ad69bde..b79a1ac2d3916 100644 --- a/clients/client-outposts/runtimeConfig.native.ts +++ b/clients/client-outposts/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./OutpostsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-outposts/runtimeConfig.ts b/clients/client-outposts/runtimeConfig.ts index 4365b133e0d40..85d94e67e8fdf 100644 --- a/clients/client-outposts/runtimeConfig.ts +++ b/clients/client-outposts/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-personalize-events/PersonalizeEventsClient.ts b/clients/client-personalize-events/PersonalizeEventsClient.ts index a7083b118ee4e..6cf2467423c7e 100644 --- a/clients/client-personalize-events/PersonalizeEventsClient.ts +++ b/clients/client-personalize-events/PersonalizeEventsClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = PutEventsCommandInput | PutItemsCommandInput | PutUsersCommandInput; @@ -101,11 +103,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -147,6 +144,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type PersonalizeEventsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -155,8 +158,8 @@ export type PersonalizeEventsClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PersonalizeEventsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -164,8 +167,8 @@ export type PersonalizeEventsClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Personalize can consume real-time user event data, such as stream or click data, and use @@ -188,16 +191,16 @@ export class PersonalizeEventsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-personalize-events/runtimeConfig.browser.ts b/clients/client-personalize-events/runtimeConfig.browser.ts index be6605596fd27..29d961ec3988c 100644 --- a/clients/client-personalize-events/runtimeConfig.browser.ts +++ b/clients/client-personalize-events/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-personalize-events/runtimeConfig.native.ts b/clients/client-personalize-events/runtimeConfig.native.ts index 4014e952d21dc..fa4b108562d0d 100644 --- a/clients/client-personalize-events/runtimeConfig.native.ts +++ b/clients/client-personalize-events/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PersonalizeEventsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-personalize-events/runtimeConfig.ts b/clients/client-personalize-events/runtimeConfig.ts index 8b8938c4b931a..fb7047407c17d 100644 --- a/clients/client-personalize-events/runtimeConfig.ts +++ b/clients/client-personalize-events/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-personalize-runtime/PersonalizeRuntimeClient.ts b/clients/client-personalize-runtime/PersonalizeRuntimeClient.ts index aa2e4cf300c52..205d61272d9d4 100644 --- a/clients/client-personalize-runtime/PersonalizeRuntimeClient.ts +++ b/clients/client-personalize-runtime/PersonalizeRuntimeClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GetPersonalizedRankingCommandInput | GetRecommendationsCommandInput; @@ -103,11 +105,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -149,6 +146,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type PersonalizeRuntimeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -157,8 +160,8 @@ export type PersonalizeRuntimeClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PersonalizeRuntimeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -166,8 +169,8 @@ export type PersonalizeRuntimeClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -189,16 +192,16 @@ export class PersonalizeRuntimeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-personalize-runtime/runtimeConfig.browser.ts b/clients/client-personalize-runtime/runtimeConfig.browser.ts index 84c92ec5acfa8..c78c795d4b63c 100644 --- a/clients/client-personalize-runtime/runtimeConfig.browser.ts +++ b/clients/client-personalize-runtime/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-personalize-runtime/runtimeConfig.native.ts b/clients/client-personalize-runtime/runtimeConfig.native.ts index ce7f23fe94f37..d3639a5e6f110 100644 --- a/clients/client-personalize-runtime/runtimeConfig.native.ts +++ b/clients/client-personalize-runtime/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PersonalizeRuntimeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-personalize-runtime/runtimeConfig.ts b/clients/client-personalize-runtime/runtimeConfig.ts index 30d5025f9e3d2..b8e0ac87b5301 100644 --- a/clients/client-personalize-runtime/runtimeConfig.ts +++ b/clients/client-personalize-runtime/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-personalize/PersonalizeClient.ts b/clients/client-personalize/PersonalizeClient.ts index 671dc6b410ec3..672d55f66a22e 100644 --- a/clients/client-personalize/PersonalizeClient.ts +++ b/clients/client-personalize/PersonalizeClient.ts @@ -114,6 +114,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -124,6 +125,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -263,11 +265,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -309,6 +306,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type PersonalizeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -317,8 +320,8 @@ export type PersonalizeClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PersonalizeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -326,8 +329,8 @@ export type PersonalizeClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Personalize is a machine learning service that makes it easy to add individualized @@ -350,16 +353,16 @@ export class PersonalizeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-personalize/runtimeConfig.browser.ts b/clients/client-personalize/runtimeConfig.browser.ts index c29645ad41946..ccca8adda904a 100644 --- a/clients/client-personalize/runtimeConfig.browser.ts +++ b/clients/client-personalize/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-personalize/runtimeConfig.native.ts b/clients/client-personalize/runtimeConfig.native.ts index 21b3daa6c979c..d04e00fcec44f 100644 --- a/clients/client-personalize/runtimeConfig.native.ts +++ b/clients/client-personalize/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PersonalizeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-personalize/runtimeConfig.ts b/clients/client-personalize/runtimeConfig.ts index 842195f9f8917..a7685f8cd27fd 100644 --- a/clients/client-personalize/runtimeConfig.ts +++ b/clients/client-personalize/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-pi/PIClient.ts b/clients/client-pi/PIClient.ts index f3cf5276b6c61..7b5366616dfa5 100644 --- a/clients/client-pi/PIClient.ts +++ b/clients/client-pi/PIClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = DescribeDimensionKeysCommandInput | GetResourceMetricsCommandInput; @@ -103,11 +105,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -149,6 +146,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type PIClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -157,8 +160,8 @@ export type PIClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions> EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PIClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -166,8 +169,8 @@ export type PIClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandler EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Performance Insights enables you to monitor and explore different dimensions of @@ -202,16 +205,16 @@ export class PIClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-pi/runtimeConfig.browser.ts b/clients/client-pi/runtimeConfig.browser.ts index 8505dd027c93c..ce5fcb03867dc 100644 --- a/clients/client-pi/runtimeConfig.browser.ts +++ b/clients/client-pi/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-pi/runtimeConfig.native.ts b/clients/client-pi/runtimeConfig.native.ts index a21490f338d42..8f17286345931 100644 --- a/clients/client-pi/runtimeConfig.native.ts +++ b/clients/client-pi/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PIClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-pi/runtimeConfig.ts b/clients/client-pi/runtimeConfig.ts index d6c06c872fd5d..f1b2e8d5f41fb 100644 --- a/clients/client-pi/runtimeConfig.ts +++ b/clients/client-pi/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-pinpoint-email/PinpointEmailClient.ts b/clients/client-pinpoint-email/PinpointEmailClient.ts index bf81efa63bacb..fae575ee86730 100644 --- a/clients/client-pinpoint-email/PinpointEmailClient.ts +++ b/clients/client-pinpoint-email/PinpointEmailClient.ts @@ -182,6 +182,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -192,6 +193,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -329,11 +331,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -375,6 +372,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type PinpointEmailClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -383,8 +386,8 @@ export type PinpointEmailClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PinpointEmailClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -392,8 +395,8 @@ export type PinpointEmailClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Pinpoint Email Service @@ -443,16 +446,16 @@ export class PinpointEmailClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-pinpoint-email/runtimeConfig.browser.ts b/clients/client-pinpoint-email/runtimeConfig.browser.ts index 4a03a5f4e91da..3e52b3e2c7d0f 100644 --- a/clients/client-pinpoint-email/runtimeConfig.browser.ts +++ b/clients/client-pinpoint-email/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-pinpoint-email/runtimeConfig.native.ts b/clients/client-pinpoint-email/runtimeConfig.native.ts index 1b92604d7e02e..24013a65d121a 100644 --- a/clients/client-pinpoint-email/runtimeConfig.native.ts +++ b/clients/client-pinpoint-email/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PinpointEmailClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-pinpoint-email/runtimeConfig.ts b/clients/client-pinpoint-email/runtimeConfig.ts index c977404112dea..dd64e28c2b253 100644 --- a/clients/client-pinpoint-email/runtimeConfig.ts +++ b/clients/client-pinpoint-email/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-pinpoint-sms-voice/PinpointSMSVoiceClient.ts b/clients/client-pinpoint-sms-voice/PinpointSMSVoiceClient.ts index d4ebe4b192d6e..1c49e2d8ef48a 100644 --- a/clients/client-pinpoint-sms-voice/PinpointSMSVoiceClient.ts +++ b/clients/client-pinpoint-sms-voice/PinpointSMSVoiceClient.ts @@ -64,6 +64,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -74,6 +75,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -143,11 +145,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -189,6 +186,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type PinpointSMSVoiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -197,8 +200,8 @@ export type PinpointSMSVoiceClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PinpointSMSVoiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -206,8 +209,8 @@ export type PinpointSMSVoiceClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Pinpoint SMS and Voice Messaging public facing APIs @@ -229,16 +232,16 @@ export class PinpointSMSVoiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-pinpoint-sms-voice/runtimeConfig.browser.ts b/clients/client-pinpoint-sms-voice/runtimeConfig.browser.ts index 24d8d2b7e92e7..d53c04af3c93a 100644 --- a/clients/client-pinpoint-sms-voice/runtimeConfig.browser.ts +++ b/clients/client-pinpoint-sms-voice/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-pinpoint-sms-voice/runtimeConfig.native.ts b/clients/client-pinpoint-sms-voice/runtimeConfig.native.ts index 31636ad78ceec..e97a34cebcca0 100644 --- a/clients/client-pinpoint-sms-voice/runtimeConfig.native.ts +++ b/clients/client-pinpoint-sms-voice/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PinpointSMSVoiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-pinpoint-sms-voice/runtimeConfig.ts b/clients/client-pinpoint-sms-voice/runtimeConfig.ts index 9ba47ed1ffb74..8ba8ff15275eb 100644 --- a/clients/client-pinpoint-sms-voice/runtimeConfig.ts +++ b/clients/client-pinpoint-sms-voice/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-pinpoint/PinpointClient.ts b/clients/client-pinpoint/PinpointClient.ts index 028bdf5e9913c..61044c7be16e2 100644 --- a/clients/client-pinpoint/PinpointClient.ts +++ b/clients/client-pinpoint/PinpointClient.ts @@ -255,6 +255,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -265,6 +266,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -542,11 +544,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -588,6 +585,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type PinpointClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -596,8 +599,8 @@ export type PinpointClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PinpointClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -605,8 +608,8 @@ export type PinpointClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Doc Engage API - Amazon Pinpoint API

@@ -628,16 +631,16 @@ export class PinpointClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-pinpoint/runtimeConfig.browser.ts b/clients/client-pinpoint/runtimeConfig.browser.ts index 2f20bbbad2bcb..3cd77708455fd 100644 --- a/clients/client-pinpoint/runtimeConfig.browser.ts +++ b/clients/client-pinpoint/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-pinpoint/runtimeConfig.native.ts b/clients/client-pinpoint/runtimeConfig.native.ts index 023c17306d023..2f202ac7dc1d4 100644 --- a/clients/client-pinpoint/runtimeConfig.native.ts +++ b/clients/client-pinpoint/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PinpointClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-pinpoint/runtimeConfig.ts b/clients/client-pinpoint/runtimeConfig.ts index 3163da034d73f..694292a362245 100644 --- a/clients/client-pinpoint/runtimeConfig.ts +++ b/clients/client-pinpoint/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-polly/PollyClient.ts b/clients/client-polly/PollyClient.ts index c090841946a9c..8761da4926ba4 100644 --- a/clients/client-polly/PollyClient.ts +++ b/clients/client-polly/PollyClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -134,11 +136,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -180,6 +177,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type PollyClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -188,8 +191,8 @@ export type PollyClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PollyClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -197,8 +200,8 @@ export type PollyClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Polly is a web service that makes it easy to synthesize speech from @@ -225,16 +228,16 @@ export class PollyClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-polly/runtimeConfig.browser.ts b/clients/client-polly/runtimeConfig.browser.ts index d666057083bcb..2d61a1001fb62 100644 --- a/clients/client-polly/runtimeConfig.browser.ts +++ b/clients/client-polly/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-polly/runtimeConfig.native.ts b/clients/client-polly/runtimeConfig.native.ts index d4c46a6faab60..247aeafab705d 100644 --- a/clients/client-polly/runtimeConfig.native.ts +++ b/clients/client-polly/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PollyClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-polly/runtimeConfig.ts b/clients/client-polly/runtimeConfig.ts index ee8ac98008364..3e55dc929b66d 100644 --- a/clients/client-polly/runtimeConfig.ts +++ b/clients/client-polly/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-pricing/PricingClient.ts b/clients/client-pricing/PricingClient.ts index df0e5d62679b6..bb140e14873c5 100644 --- a/clients/client-pricing/PricingClient.ts +++ b/clients/client-pricing/PricingClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = DescribeServicesCommandInput | GetAttributeValuesCommandInput | GetProductsCommandInput; @@ -104,11 +106,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -150,6 +147,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type PricingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -158,8 +161,8 @@ export type PricingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PricingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -167,8 +170,8 @@ export type PricingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Price List Service API (AWS Price List Service) is a centralized and convenient way to @@ -213,16 +216,16 @@ export class PricingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-pricing/runtimeConfig.browser.ts b/clients/client-pricing/runtimeConfig.browser.ts index 9727b15241e3f..14c3de2c1ed11 100644 --- a/clients/client-pricing/runtimeConfig.browser.ts +++ b/clients/client-pricing/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-pricing/runtimeConfig.native.ts b/clients/client-pricing/runtimeConfig.native.ts index b503eccafd0f8..4792ba1e56e25 100644 --- a/clients/client-pricing/runtimeConfig.native.ts +++ b/clients/client-pricing/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PricingClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-pricing/runtimeConfig.ts b/clients/client-pricing/runtimeConfig.ts index a4ee6b5f39256..db7b72ba26071 100644 --- a/clients/client-pricing/runtimeConfig.ts +++ b/clients/client-pricing/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-qldb-session/QLDBSessionClient.ts b/clients/client-qldb-session/QLDBSessionClient.ts index 3010230b33503..dbea8ccb2869e 100644 --- a/clients/client-qldb-session/QLDBSessionClient.ts +++ b/clients/client-qldb-session/QLDBSessionClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = SendCommandCommandInput; @@ -99,11 +101,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -145,6 +142,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type QLDBSessionClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -153,8 +156,8 @@ export type QLDBSessionClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type QLDBSessionClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -162,8 +165,8 @@ export type QLDBSessionClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The transactional data APIs for Amazon QLDB

@@ -205,16 +208,16 @@ export class QLDBSessionClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-qldb-session/runtimeConfig.browser.ts b/clients/client-qldb-session/runtimeConfig.browser.ts index fe0ee71dbd68a..cbdc898f9e8a7 100644 --- a/clients/client-qldb-session/runtimeConfig.browser.ts +++ b/clients/client-qldb-session/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-qldb-session/runtimeConfig.native.ts b/clients/client-qldb-session/runtimeConfig.native.ts index 57fef29777303..9eadf3401b96a 100644 --- a/clients/client-qldb-session/runtimeConfig.native.ts +++ b/clients/client-qldb-session/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./QLDBSessionClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-qldb-session/runtimeConfig.ts b/clients/client-qldb-session/runtimeConfig.ts index 34d88d8c6aae9..23954907193a7 100644 --- a/clients/client-qldb-session/runtimeConfig.ts +++ b/clients/client-qldb-session/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-qldb/QLDBClient.ts b/clients/client-qldb/QLDBClient.ts index 78e024bd1dfac..34f9d4ebeccbd 100644 --- a/clients/client-qldb/QLDBClient.ts +++ b/clients/client-qldb/QLDBClient.ts @@ -78,6 +78,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -88,6 +89,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -179,11 +181,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -225,6 +222,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type QLDBClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -233,8 +236,8 @@ export type QLDBClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOption EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type QLDBClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -242,8 +245,8 @@ export type QLDBClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandl EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The control plane for Amazon QLDB

@@ -265,16 +268,16 @@ export class QLDBClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-qldb/runtimeConfig.browser.ts b/clients/client-qldb/runtimeConfig.browser.ts index c7139cb57ae8c..b0232ba79b349 100644 --- a/clients/client-qldb/runtimeConfig.browser.ts +++ b/clients/client-qldb/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-qldb/runtimeConfig.native.ts b/clients/client-qldb/runtimeConfig.native.ts index bd8912906853a..fee104745edf3 100644 --- a/clients/client-qldb/runtimeConfig.native.ts +++ b/clients/client-qldb/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./QLDBClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-qldb/runtimeConfig.ts b/clients/client-qldb/runtimeConfig.ts index 7a236f0e51cb6..b720880168bdc 100644 --- a/clients/client-qldb/runtimeConfig.ts +++ b/clients/client-qldb/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-quicksight/QuickSightClient.ts b/clients/client-quicksight/QuickSightClient.ts index 1e08316051d1d..11d15672fa697 100644 --- a/clients/client-quicksight/QuickSightClient.ts +++ b/clients/client-quicksight/QuickSightClient.ts @@ -248,6 +248,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -258,6 +259,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -509,11 +511,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -555,6 +552,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type QuickSightClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -563,8 +566,8 @@ export type QuickSightClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type QuickSightClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -572,8 +575,8 @@ export type QuickSightClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon QuickSight API Reference @@ -599,16 +602,16 @@ export class QuickSightClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-quicksight/runtimeConfig.browser.ts b/clients/client-quicksight/runtimeConfig.browser.ts index 1cd4c65e949ee..baad8cbe2390b 100644 --- a/clients/client-quicksight/runtimeConfig.browser.ts +++ b/clients/client-quicksight/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-quicksight/runtimeConfig.native.ts b/clients/client-quicksight/runtimeConfig.native.ts index 4a75770c25026..c140fe2890a5e 100644 --- a/clients/client-quicksight/runtimeConfig.native.ts +++ b/clients/client-quicksight/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./QuickSightClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-quicksight/runtimeConfig.ts b/clients/client-quicksight/runtimeConfig.ts index 79d6ad23426bb..06e408843312a 100644 --- a/clients/client-quicksight/runtimeConfig.ts +++ b/clients/client-quicksight/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ram/RAMClient.ts b/clients/client-ram/RAMClient.ts index d1e1e1ad8a61e..16d9632e17023 100644 --- a/clients/client-ram/RAMClient.ts +++ b/clients/client-ram/RAMClient.ts @@ -107,6 +107,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -117,6 +118,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -218,11 +220,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -264,6 +261,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type RAMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -272,8 +275,8 @@ export type RAMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RAMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -281,8 +284,8 @@ export type RAMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Use AWS Resource Access Manager to share AWS resources between AWS accounts. To share a resource, you @@ -309,16 +312,16 @@ export class RAMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ram/runtimeConfig.browser.ts b/clients/client-ram/runtimeConfig.browser.ts index 5c9dfc43f5688..ff3ede4ef91b4 100644 --- a/clients/client-ram/runtimeConfig.browser.ts +++ b/clients/client-ram/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ram/runtimeConfig.native.ts b/clients/client-ram/runtimeConfig.native.ts index 0055d86d41c38..e90e29b19f8e9 100644 --- a/clients/client-ram/runtimeConfig.native.ts +++ b/clients/client-ram/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RAMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ram/runtimeConfig.ts b/clients/client-ram/runtimeConfig.ts index cf2e668214a20..45df96b74d895 100644 --- a/clients/client-ram/runtimeConfig.ts +++ b/clients/client-ram/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-rds-data/RDSDataClient.ts b/clients/client-rds-data/RDSDataClient.ts index f391e8b7944ba..9d13bfadb251d 100644 --- a/clients/client-rds-data/RDSDataClient.ts +++ b/clients/client-rds-data/RDSDataClient.ts @@ -47,6 +47,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -57,6 +58,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -122,11 +124,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -168,6 +165,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type RDSDataClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -176,8 +179,8 @@ export type RDSDataClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RDSDataClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -185,8 +188,8 @@ export type RDSDataClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon RDS Data Service @@ -217,16 +220,16 @@ export class RDSDataClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-rds-data/runtimeConfig.browser.ts b/clients/client-rds-data/runtimeConfig.browser.ts index a2cc85379b4f5..d4d9e6db5c9b5 100644 --- a/clients/client-rds-data/runtimeConfig.browser.ts +++ b/clients/client-rds-data/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-rds-data/runtimeConfig.native.ts b/clients/client-rds-data/runtimeConfig.native.ts index 10e0bc1347bed..67e12ed55cd68 100644 --- a/clients/client-rds-data/runtimeConfig.native.ts +++ b/clients/client-rds-data/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RDSDataClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-rds-data/runtimeConfig.ts b/clients/client-rds-data/runtimeConfig.ts index cd98eb24aa516..93c2a3186956d 100644 --- a/clients/client-rds-data/runtimeConfig.ts +++ b/clients/client-rds-data/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-rds/RDSClient.ts b/clients/client-rds/RDSClient.ts index 57cda35d6402d..956b5ba1088bd 100644 --- a/clients/client-rds/RDSClient.ts +++ b/clients/client-rds/RDSClient.ts @@ -458,6 +458,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -468,6 +469,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -785,11 +787,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -831,6 +828,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type RDSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -839,8 +842,8 @@ export type RDSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RDSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -848,8 +851,8 @@ export type RDSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Relational Database Service @@ -927,16 +930,16 @@ export class RDSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-rds/runtimeConfig.browser.ts b/clients/client-rds/runtimeConfig.browser.ts index e1dd909bb3aa0..e8a83bb559507 100644 --- a/clients/client-rds/runtimeConfig.browser.ts +++ b/clients/client-rds/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-rds/runtimeConfig.native.ts b/clients/client-rds/runtimeConfig.native.ts index df367c874d586..10be771599560 100644 --- a/clients/client-rds/runtimeConfig.native.ts +++ b/clients/client-rds/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RDSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-rds/runtimeConfig.ts b/clients/client-rds/runtimeConfig.ts index de3407d0c2ab7..5c42388c6891b 100644 --- a/clients/client-rds/runtimeConfig.ts +++ b/clients/client-rds/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-redshift-data/RedshiftDataClient.ts b/clients/client-redshift-data/RedshiftDataClient.ts index 83a4eae5ea2da..66ccf7fee7e26 100644 --- a/clients/client-redshift-data/RedshiftDataClient.ts +++ b/clients/client-redshift-data/RedshiftDataClient.ts @@ -44,6 +44,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -54,6 +55,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -125,11 +127,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -171,6 +168,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type RedshiftDataClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -179,8 +182,8 @@ export type RedshiftDataClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RedshiftDataClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -188,8 +191,8 @@ export type RedshiftDataClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

You can use the Amazon Redshift Data API to run queries on Amazon Redshift tables. You @@ -212,16 +215,16 @@ export class RedshiftDataClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-redshift-data/runtimeConfig.browser.ts b/clients/client-redshift-data/runtimeConfig.browser.ts index 0ddcb664de062..8ade1939e18bb 100644 --- a/clients/client-redshift-data/runtimeConfig.browser.ts +++ b/clients/client-redshift-data/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-redshift-data/runtimeConfig.native.ts b/clients/client-redshift-data/runtimeConfig.native.ts index c2681c976a1c4..1c8f8e313b9c4 100644 --- a/clients/client-redshift-data/runtimeConfig.native.ts +++ b/clients/client-redshift-data/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RedshiftDataClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-redshift-data/runtimeConfig.ts b/clients/client-redshift-data/runtimeConfig.ts index bcb0acc43dbe4..dba7e470be4dc 100644 --- a/clients/client-redshift-data/runtimeConfig.ts +++ b/clients/client-redshift-data/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-redshift/RedshiftClient.ts b/clients/client-redshift/RedshiftClient.ts index 2ab0cfffda959..0e8163a10a331 100644 --- a/clients/client-redshift/RedshiftClient.ts +++ b/clients/client-redshift/RedshiftClient.ts @@ -340,6 +340,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -350,6 +351,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -587,11 +589,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -633,6 +630,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type RedshiftClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -641,8 +644,8 @@ export type RedshiftClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RedshiftClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -650,8 +653,8 @@ export type RedshiftClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Redshift @@ -694,16 +697,16 @@ export class RedshiftClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-redshift/runtimeConfig.browser.ts b/clients/client-redshift/runtimeConfig.browser.ts index 3c941956d348b..0073064ccbd3d 100644 --- a/clients/client-redshift/runtimeConfig.browser.ts +++ b/clients/client-redshift/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-redshift/runtimeConfig.native.ts b/clients/client-redshift/runtimeConfig.native.ts index 3e750a39c9faa..d0ff8a798c016 100644 --- a/clients/client-redshift/runtimeConfig.native.ts +++ b/clients/client-redshift/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RedshiftClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-redshift/runtimeConfig.ts b/clients/client-redshift/runtimeConfig.ts index 39398cc997b6d..0c47c88843d81 100644 --- a/clients/client-redshift/runtimeConfig.ts +++ b/clients/client-redshift/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-rekognition/RekognitionClient.ts b/clients/client-rekognition/RekognitionClient.ts index dd3519e6f4d29..5e74f94c63ab2 100644 --- a/clients/client-rekognition/RekognitionClient.ts +++ b/clients/client-rekognition/RekognitionClient.ts @@ -146,6 +146,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -156,6 +157,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -305,11 +307,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -351,6 +348,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type RekognitionClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -359,8 +362,8 @@ export type RekognitionClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RekognitionClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -368,8 +371,8 @@ export type RekognitionClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This is the Amazon Rekognition API reference.

@@ -391,16 +394,16 @@ export class RekognitionClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-rekognition/runtimeConfig.browser.ts b/clients/client-rekognition/runtimeConfig.browser.ts index a4e078b5ac7f3..f2ad5648510d5 100644 --- a/clients/client-rekognition/runtimeConfig.browser.ts +++ b/clients/client-rekognition/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-rekognition/runtimeConfig.native.ts b/clients/client-rekognition/runtimeConfig.native.ts index 25394ac24fc4f..66912db06ab3e 100644 --- a/clients/client-rekognition/runtimeConfig.native.ts +++ b/clients/client-rekognition/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RekognitionClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-rekognition/runtimeConfig.ts b/clients/client-rekognition/runtimeConfig.ts index 02b01ecc142b3..01c3d544c8391 100644 --- a/clients/client-rekognition/runtimeConfig.ts +++ b/clients/client-rekognition/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-resource-groups-tagging-api/ResourceGroupsTaggingAPIClient.ts b/clients/client-resource-groups-tagging-api/ResourceGroupsTaggingAPIClient.ts index 550ef8af8b123..190a4a6faf39e 100644 --- a/clients/client-resource-groups-tagging-api/ResourceGroupsTaggingAPIClient.ts +++ b/clients/client-resource-groups-tagging-api/ResourceGroupsTaggingAPIClient.ts @@ -52,6 +52,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -62,6 +63,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -131,11 +133,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -177,6 +174,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ResourceGroupsTaggingAPIClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -185,8 +188,8 @@ export type ResourceGroupsTaggingAPIClientConfig = Partial<__SmithyConfiguration EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ResourceGroupsTaggingAPIClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -194,8 +197,8 @@ export type ResourceGroupsTaggingAPIClientResolvedConfig = __SmithyResolvedConfi EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Resource Groups Tagging API @@ -973,16 +976,16 @@ export class ResourceGroupsTaggingAPIClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-resource-groups-tagging-api/runtimeConfig.browser.ts b/clients/client-resource-groups-tagging-api/runtimeConfig.browser.ts index 85702060e8381..59de4b69fb7e7 100644 --- a/clients/client-resource-groups-tagging-api/runtimeConfig.browser.ts +++ b/clients/client-resource-groups-tagging-api/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-resource-groups-tagging-api/runtimeConfig.native.ts b/clients/client-resource-groups-tagging-api/runtimeConfig.native.ts index 48a22bdedd23f..94081e75c64aa 100644 --- a/clients/client-resource-groups-tagging-api/runtimeConfig.native.ts +++ b/clients/client-resource-groups-tagging-api/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ResourceGroupsTaggingAPIClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-resource-groups-tagging-api/runtimeConfig.ts b/clients/client-resource-groups-tagging-api/runtimeConfig.ts index 53d23d89f3d7d..b3b7a948f886e 100644 --- a/clients/client-resource-groups-tagging-api/runtimeConfig.ts +++ b/clients/client-resource-groups-tagging-api/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-resource-groups/ResourceGroupsClient.ts b/clients/client-resource-groups/ResourceGroupsClient.ts index c84717252369f..dda1624f7d3bb 100644 --- a/clients/client-resource-groups/ResourceGroupsClient.ts +++ b/clients/client-resource-groups/ResourceGroupsClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -146,11 +148,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -192,6 +189,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ResourceGroupsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -200,8 +203,8 @@ export type ResourceGroupsClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ResourceGroupsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -209,8 +212,8 @@ export type ResourceGroupsClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Resource Groups @@ -267,16 +270,16 @@ export class ResourceGroupsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-resource-groups/runtimeConfig.browser.ts b/clients/client-resource-groups/runtimeConfig.browser.ts index a2823ee8e7852..3402d2e436bd9 100644 --- a/clients/client-resource-groups/runtimeConfig.browser.ts +++ b/clients/client-resource-groups/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-resource-groups/runtimeConfig.native.ts b/clients/client-resource-groups/runtimeConfig.native.ts index 2becb0f1bae9a..2372597f29694 100644 --- a/clients/client-resource-groups/runtimeConfig.native.ts +++ b/clients/client-resource-groups/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ResourceGroupsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-resource-groups/runtimeConfig.ts b/clients/client-resource-groups/runtimeConfig.ts index 566747c107bd1..cf0b2e270b14f 100644 --- a/clients/client-resource-groups/runtimeConfig.ts +++ b/clients/client-resource-groups/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-robomaker/RoboMakerClient.ts b/clients/client-robomaker/RoboMakerClient.ts index 5e5c1d86b7726..5b925669b3115 100644 --- a/clients/client-robomaker/RoboMakerClient.ts +++ b/clients/client-robomaker/RoboMakerClient.ts @@ -206,6 +206,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -216,6 +217,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -383,11 +385,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -429,6 +426,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type RoboMakerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -437,8 +440,8 @@ export type RoboMakerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RoboMakerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -446,8 +449,8 @@ export type RoboMakerClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This section provides documentation for the AWS RoboMaker API operations.

@@ -469,16 +472,16 @@ export class RoboMakerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-robomaker/runtimeConfig.browser.ts b/clients/client-robomaker/runtimeConfig.browser.ts index 18c64ac90a054..40b9c97b70d08 100644 --- a/clients/client-robomaker/runtimeConfig.browser.ts +++ b/clients/client-robomaker/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-robomaker/runtimeConfig.native.ts b/clients/client-robomaker/runtimeConfig.native.ts index a97e86f8b06de..a94796711ac8c 100644 --- a/clients/client-robomaker/runtimeConfig.native.ts +++ b/clients/client-robomaker/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RoboMakerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-robomaker/runtimeConfig.ts b/clients/client-robomaker/runtimeConfig.ts index 6ad9fb078aa48..96c7359faea35 100644 --- a/clients/client-robomaker/runtimeConfig.ts +++ b/clients/client-robomaker/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-route-53-domains/Route53DomainsClient.ts b/clients/client-route-53-domains/Route53DomainsClient.ts index 1d2c7f7b3bead..3d09047b81f8b 100644 --- a/clients/client-route-53-domains/Route53DomainsClient.ts +++ b/clients/client-route-53-domains/Route53DomainsClient.ts @@ -120,6 +120,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -130,6 +131,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -239,11 +241,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -285,6 +282,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type Route53DomainsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -293,8 +296,8 @@ export type Route53DomainsClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type Route53DomainsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -302,8 +305,8 @@ export type Route53DomainsClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Route 53 API actions let you register domain names and perform related operations.

@@ -325,16 +328,16 @@ export class Route53DomainsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-route-53-domains/runtimeConfig.browser.ts b/clients/client-route-53-domains/runtimeConfig.browser.ts index 20d16d59875c6..b46103d9f6b1f 100644 --- a/clients/client-route-53-domains/runtimeConfig.browser.ts +++ b/clients/client-route-53-domains/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-route-53-domains/runtimeConfig.native.ts b/clients/client-route-53-domains/runtimeConfig.native.ts index cec0f17700e7d..bc2a62428f65c 100644 --- a/clients/client-route-53-domains/runtimeConfig.native.ts +++ b/clients/client-route-53-domains/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./Route53DomainsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-route-53-domains/runtimeConfig.ts b/clients/client-route-53-domains/runtimeConfig.ts index aff6ba976d8b7..5351d2be3d7fe 100644 --- a/clients/client-route-53-domains/runtimeConfig.ts +++ b/clients/client-route-53-domains/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-route-53/Route53Client.ts b/clients/client-route-53/Route53Client.ts index 2e451275f75e3..70654160a5d9a 100644 --- a/clients/client-route-53/Route53Client.ts +++ b/clients/client-route-53/Route53Client.ts @@ -209,6 +209,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -219,6 +220,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -386,11 +388,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -432,6 +429,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type Route53ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -440,8 +443,8 @@ export type Route53ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type Route53ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -449,8 +452,8 @@ export type Route53ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Route 53 is a highly available and scalable Domain Name System (DNS) web service.

@@ -472,16 +475,16 @@ export class Route53Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-route-53/runtimeConfig.browser.ts b/clients/client-route-53/runtimeConfig.browser.ts index 7d7799b09f66c..55cc424c3ada9 100644 --- a/clients/client-route-53/runtimeConfig.browser.ts +++ b/clients/client-route-53/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-route-53/runtimeConfig.native.ts b/clients/client-route-53/runtimeConfig.native.ts index 5ae542c98f1a3..2b2235c56777b 100644 --- a/clients/client-route-53/runtimeConfig.native.ts +++ b/clients/client-route-53/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./Route53Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-route-53/runtimeConfig.ts b/clients/client-route-53/runtimeConfig.ts index 1d788bdb042a4..aa26b0a45f48f 100644 --- a/clients/client-route-53/runtimeConfig.ts +++ b/clients/client-route-53/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-route53resolver/Route53ResolverClient.ts b/clients/client-route53resolver/Route53ResolverClient.ts index 179261dd3c6d1..09d894bd70402 100644 --- a/clients/client-route53resolver/Route53ResolverClient.ts +++ b/clients/client-route53resolver/Route53ResolverClient.ts @@ -142,6 +142,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -152,6 +153,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -269,11 +271,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -315,6 +312,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type Route53ResolverClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -323,8 +326,8 @@ export type Route53ResolverClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type Route53ResolverClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -332,8 +335,8 @@ export type Route53ResolverClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

When you create a VPC using Amazon VPC, you automatically get DNS resolution within the VPC from Route 53 Resolver. @@ -384,16 +387,16 @@ export class Route53ResolverClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-route53resolver/runtimeConfig.browser.ts b/clients/client-route53resolver/runtimeConfig.browser.ts index 8227eab7f4b04..ea448824a9385 100644 --- a/clients/client-route53resolver/runtimeConfig.browser.ts +++ b/clients/client-route53resolver/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-route53resolver/runtimeConfig.native.ts b/clients/client-route53resolver/runtimeConfig.native.ts index 8cf96cc7ad429..d1646c2c7e280 100644 --- a/clients/client-route53resolver/runtimeConfig.native.ts +++ b/clients/client-route53resolver/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./Route53ResolverClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-route53resolver/runtimeConfig.ts b/clients/client-route53resolver/runtimeConfig.ts index 8f905b163c681..53af4680828b4 100644 --- a/clients/client-route53resolver/runtimeConfig.ts +++ b/clients/client-route53resolver/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-s3-control/S3ControlClient.ts b/clients/client-s3-control/S3ControlClient.ts index b2347ab75ba3c..2598803b1b7cd 100644 --- a/clients/client-s3-control/S3ControlClient.ts +++ b/clients/client-s3-control/S3ControlClient.ts @@ -136,6 +136,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -146,6 +147,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -277,11 +279,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -323,6 +320,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type S3ControlClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -331,9 +334,9 @@ export type S3ControlClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & HostHeaderInputConfig & - S3ControlInputConfig; + S3ControlInputConfig & + UserAgentInputConfig; export type S3ControlClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -341,9 +344,9 @@ export type S3ControlClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & HostHeaderResolvedConfig & - S3ControlResolvedConfig; + S3ControlResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -368,17 +371,17 @@ export class S3ControlClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); - let _config_7 = resolveS3ControlConfig(_config_6); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveS3ControlConfig(_config_5); + let _config_7 = resolveUserAgentConfig(_config_6); super(_config_7); this.config = _config_7; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-s3-control/runtimeConfig.browser.ts b/clients/client-s3-control/runtimeConfig.browser.ts index 77cade9d06bbd..7a5ad67c1de62 100644 --- a/clients/client-s3-control/runtimeConfig.browser.ts +++ b/clients/client-s3-control/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-s3-control/runtimeConfig.native.ts b/clients/client-s3-control/runtimeConfig.native.ts index d80b766e2815e..3b6f6952f670e 100644 --- a/clients/client-s3-control/runtimeConfig.native.ts +++ b/clients/client-s3-control/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./S3ControlClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-s3-control/runtimeConfig.ts b/clients/client-s3-control/runtimeConfig.ts index efc104aee1f11..088d314337b67 100644 --- a/clients/client-s3-control/runtimeConfig.ts +++ b/clients/client-s3-control/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-s3/S3Client.ts b/clients/client-s3/S3Client.ts index 8470e6d7778d1..600a15ef27ebb 100644 --- a/clients/client-s3/S3Client.ts +++ b/clients/client-s3/S3Client.ts @@ -301,6 +301,7 @@ import { StreamCollector as __StreamCollector, StreamHasher as __StreamHasher, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; import { Readable } from "stream"; @@ -537,11 +538,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -605,6 +601,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Whether to override the request region with the region inferred from requested resource's ARN. Defaults to false. */ useArnRegion?: boolean | Provider; + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + /** * The function that provides necessary utilities for generating and parsing event stream */ @@ -617,9 +619,9 @@ export type S3ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions> EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & HostHeaderInputConfig & BucketEndpointInputConfig & + UserAgentInputConfig & EventStreamSerdeInputConfig; export type S3ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & @@ -628,9 +630,9 @@ export type S3ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandler EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & HostHeaderResolvedConfig & BucketEndpointResolvedConfig & + UserAgentResolvedConfig & EventStreamSerdeResolvedConfig; /** @@ -653,21 +655,21 @@ export class S3Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); - let _config_7 = resolveBucketEndpointConfig(_config_6); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveBucketEndpointConfig(_config_5); + let _config_7 = resolveUserAgentConfig(_config_6); let _config_8 = resolveEventStreamSerdeConfig(_config_7); super(_config_8); this.config = _config_8; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); this.middlewareStack.use(getValidateBucketNamePlugin(this.config)); this.middlewareStack.use(getUseRegionalEndpointPlugin(this.config)); this.middlewareStack.use(getAddExpectContinuePlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-s3/runtimeConfig.browser.ts b/clients/client-s3/runtimeConfig.browser.ts index 3e7ed9ca99e35..a40ebe805729c 100644 --- a/clients/client-s3/runtimeConfig.browser.ts +++ b/clients/client-s3/runtimeConfig.browser.ts @@ -25,7 +25,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), eventStreamSerdeProvider, maxAttempts: DEFAULT_MAX_ATTEMPTS, md5: Md5, diff --git a/clients/client-s3/runtimeConfig.native.ts b/clients/client-s3/runtimeConfig.native.ts index 4011cbdb3c47a..3982fdd7d24b5 100644 --- a/clients/client-s3/runtimeConfig.native.ts +++ b/clients/client-s3/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./S3Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-s3/runtimeConfig.ts b/clients/client-s3/runtimeConfig.ts index 50a05de926d4c..3278b5f89d8dc 100644 --- a/clients/client-s3/runtimeConfig.ts +++ b/clients/client-s3/runtimeConfig.ts @@ -28,7 +28,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), eventStreamSerdeProvider, maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), md5: Hash.bind(null, "md5"), diff --git a/clients/client-s3outposts/S3OutpostsClient.ts b/clients/client-s3outposts/S3OutpostsClient.ts index ddb0e63df8459..22b37059ba054 100644 --- a/clients/client-s3outposts/S3OutpostsClient.ts +++ b/clients/client-s3outposts/S3OutpostsClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = CreateEndpointCommandInput | DeleteEndpointCommandInput | ListEndpointsCommandInput; @@ -101,11 +103,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -147,6 +144,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type S3OutpostsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -155,8 +158,8 @@ export type S3OutpostsClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type S3OutpostsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -164,8 +167,8 @@ export type S3OutpostsClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon S3 on Outposts provides access to S3 on Outposts operations.

@@ -187,16 +190,16 @@ export class S3OutpostsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-s3outposts/runtimeConfig.browser.ts b/clients/client-s3outposts/runtimeConfig.browser.ts index 6ae63da72eba8..a45cef78c9b66 100644 --- a/clients/client-s3outposts/runtimeConfig.browser.ts +++ b/clients/client-s3outposts/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-s3outposts/runtimeConfig.native.ts b/clients/client-s3outposts/runtimeConfig.native.ts index 0a755860d14d7..dace87cef6b2d 100644 --- a/clients/client-s3outposts/runtimeConfig.native.ts +++ b/clients/client-s3outposts/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./S3OutpostsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-s3outposts/runtimeConfig.ts b/clients/client-s3outposts/runtimeConfig.ts index d739f7bd78d2a..a82b2c81d9af5 100644 --- a/clients/client-s3outposts/runtimeConfig.ts +++ b/clients/client-s3outposts/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sagemaker-a2i-runtime/SageMakerA2IRuntimeClient.ts b/clients/client-sagemaker-a2i-runtime/SageMakerA2IRuntimeClient.ts index e60180315db47..a474ea6b14fb0 100644 --- a/clients/client-sagemaker-a2i-runtime/SageMakerA2IRuntimeClient.ts +++ b/clients/client-sagemaker-a2i-runtime/SageMakerA2IRuntimeClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -113,11 +115,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -159,6 +156,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SageMakerA2IRuntimeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -167,8 +170,8 @@ export type SageMakerA2IRuntimeClientConfig = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SageMakerA2IRuntimeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -176,8 +179,8 @@ export type SageMakerA2IRuntimeClientResolvedConfig = __SmithyResolvedConfigurat EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * @@ -228,16 +231,16 @@ export class SageMakerA2IRuntimeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sagemaker-a2i-runtime/runtimeConfig.browser.ts b/clients/client-sagemaker-a2i-runtime/runtimeConfig.browser.ts index a292984f97877..415392b4e693d 100644 --- a/clients/client-sagemaker-a2i-runtime/runtimeConfig.browser.ts +++ b/clients/client-sagemaker-a2i-runtime/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sagemaker-a2i-runtime/runtimeConfig.native.ts b/clients/client-sagemaker-a2i-runtime/runtimeConfig.native.ts index 49248f418db66..80117347da1d8 100644 --- a/clients/client-sagemaker-a2i-runtime/runtimeConfig.native.ts +++ b/clients/client-sagemaker-a2i-runtime/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SageMakerA2IRuntimeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sagemaker-a2i-runtime/runtimeConfig.ts b/clients/client-sagemaker-a2i-runtime/runtimeConfig.ts index 6df54fcbdcf69..1f989b86a8db0 100644 --- a/clients/client-sagemaker-a2i-runtime/runtimeConfig.ts +++ b/clients/client-sagemaker-a2i-runtime/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sagemaker-edge/SagemakerEdgeClient.ts b/clients/client-sagemaker-edge/SagemakerEdgeClient.ts index d769accc9d3d7..c298595ab2dac 100644 --- a/clients/client-sagemaker-edge/SagemakerEdgeClient.ts +++ b/clients/client-sagemaker-edge/SagemakerEdgeClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GetDeviceRegistrationCommandInput | SendHeartbeatCommandInput; @@ -103,11 +105,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -149,6 +146,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SagemakerEdgeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -157,8 +160,8 @@ export type SagemakerEdgeClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SagemakerEdgeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -166,8 +169,8 @@ export type SagemakerEdgeClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

SageMaker Edge Manager dataplane service for communicating with active agents.

@@ -189,16 +192,16 @@ export class SagemakerEdgeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sagemaker-edge/runtimeConfig.browser.ts b/clients/client-sagemaker-edge/runtimeConfig.browser.ts index b95d7c41ca791..07691bcf0d293 100644 --- a/clients/client-sagemaker-edge/runtimeConfig.browser.ts +++ b/clients/client-sagemaker-edge/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sagemaker-edge/runtimeConfig.native.ts b/clients/client-sagemaker-edge/runtimeConfig.native.ts index b486e532174d2..6ca52bb341edc 100644 --- a/clients/client-sagemaker-edge/runtimeConfig.native.ts +++ b/clients/client-sagemaker-edge/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SagemakerEdgeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sagemaker-edge/runtimeConfig.ts b/clients/client-sagemaker-edge/runtimeConfig.ts index 89e3b964d59ef..b31960f514b17 100644 --- a/clients/client-sagemaker-edge/runtimeConfig.ts +++ b/clients/client-sagemaker-edge/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sagemaker-featurestore-runtime/SageMakerFeatureStoreRuntimeClient.ts b/clients/client-sagemaker-featurestore-runtime/SageMakerFeatureStoreRuntimeClient.ts index 09733c0a9a26b..8fdfaaec48991 100644 --- a/clients/client-sagemaker-featurestore-runtime/SageMakerFeatureStoreRuntimeClient.ts +++ b/clients/client-sagemaker-featurestore-runtime/SageMakerFeatureStoreRuntimeClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = DeleteRecordCommandInput | GetRecordCommandInput | PutRecordCommandInput; @@ -101,11 +103,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -147,6 +144,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SageMakerFeatureStoreRuntimeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -155,8 +158,8 @@ export type SageMakerFeatureStoreRuntimeClientConfig = Partial<__SmithyConfigura EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SageMakerFeatureStoreRuntimeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -164,8 +167,8 @@ export type SageMakerFeatureStoreRuntimeClientResolvedConfig = __SmithyResolvedC EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Contains all data plane API operations and data types for the Amazon SageMaker Feature @@ -213,16 +216,16 @@ export class SageMakerFeatureStoreRuntimeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.browser.ts b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.browser.ts index 14f48f2b1c9b2..47abf099083b5 100644 --- a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.browser.ts +++ b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.native.ts b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.native.ts index ab1868223d045..ed2f094a6ab9e 100644 --- a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.native.ts +++ b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SageMakerFeatureStoreRuntimeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.ts b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.ts index 4f8fa9b74adcb..431e4229dc588 100644 --- a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.ts +++ b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sagemaker-runtime/SageMakerRuntimeClient.ts b/clients/client-sagemaker-runtime/SageMakerRuntimeClient.ts index 30b90bbf9b741..7fcf7639005b5 100644 --- a/clients/client-sagemaker-runtime/SageMakerRuntimeClient.ts +++ b/clients/client-sagemaker-runtime/SageMakerRuntimeClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = InvokeEndpointCommandInput; @@ -99,11 +101,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -145,6 +142,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SageMakerRuntimeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -153,8 +156,8 @@ export type SageMakerRuntimeClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SageMakerRuntimeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -162,8 +165,8 @@ export type SageMakerRuntimeClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The Amazon SageMaker runtime API.

@@ -185,16 +188,16 @@ export class SageMakerRuntimeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sagemaker-runtime/runtimeConfig.browser.ts b/clients/client-sagemaker-runtime/runtimeConfig.browser.ts index ff82f4baef703..66dc79dc4bb3e 100644 --- a/clients/client-sagemaker-runtime/runtimeConfig.browser.ts +++ b/clients/client-sagemaker-runtime/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sagemaker-runtime/runtimeConfig.native.ts b/clients/client-sagemaker-runtime/runtimeConfig.native.ts index 2261c4f642faa..cdaeb8c508c4c 100644 --- a/clients/client-sagemaker-runtime/runtimeConfig.native.ts +++ b/clients/client-sagemaker-runtime/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SageMakerRuntimeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sagemaker-runtime/runtimeConfig.ts b/clients/client-sagemaker-runtime/runtimeConfig.ts index 66eeb877f6c0f..4b0ad0de00638 100644 --- a/clients/client-sagemaker-runtime/runtimeConfig.ts +++ b/clients/client-sagemaker-runtime/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sagemaker/SageMakerClient.ts b/clients/client-sagemaker/SageMakerClient.ts index dc613c3984c99..cc89e327572ca 100644 --- a/clients/client-sagemaker/SageMakerClient.ts +++ b/clients/client-sagemaker/SageMakerClient.ts @@ -601,6 +601,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -611,6 +612,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -1130,11 +1132,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -1176,6 +1173,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SageMakerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -1184,8 +1187,8 @@ export type SageMakerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SageMakerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -1193,8 +1196,8 @@ export type SageMakerClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Provides APIs for creating and managing Amazon SageMaker resources.

@@ -1231,16 +1234,16 @@ export class SageMakerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sagemaker/runtimeConfig.browser.ts b/clients/client-sagemaker/runtimeConfig.browser.ts index 0b3a61ed323d1..f1ff8687fbad9 100644 --- a/clients/client-sagemaker/runtimeConfig.browser.ts +++ b/clients/client-sagemaker/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sagemaker/runtimeConfig.native.ts b/clients/client-sagemaker/runtimeConfig.native.ts index 6dfb2f325c43c..3741f42cc11ee 100644 --- a/clients/client-sagemaker/runtimeConfig.native.ts +++ b/clients/client-sagemaker/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SageMakerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sagemaker/runtimeConfig.ts b/clients/client-sagemaker/runtimeConfig.ts index 7f42cb25dea1a..32aa3687d7fc6 100644 --- a/clients/client-sagemaker/runtimeConfig.ts +++ b/clients/client-sagemaker/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-savingsplans/SavingsplansClient.ts b/clients/client-savingsplans/SavingsplansClient.ts index b5095fa5a77e9..fefae3c70e369 100644 --- a/clients/client-savingsplans/SavingsplansClient.ts +++ b/clients/client-savingsplans/SavingsplansClient.ts @@ -62,6 +62,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -72,6 +73,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -143,11 +145,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -189,6 +186,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SavingsplansClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -197,8 +200,8 @@ export type SavingsplansClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SavingsplansClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -206,8 +209,8 @@ export type SavingsplansClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Savings Plans are a pricing model that offer significant savings on AWS usage (for @@ -232,16 +235,16 @@ export class SavingsplansClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-savingsplans/runtimeConfig.browser.ts b/clients/client-savingsplans/runtimeConfig.browser.ts index de7d8132f165a..eb401f250ce52 100644 --- a/clients/client-savingsplans/runtimeConfig.browser.ts +++ b/clients/client-savingsplans/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-savingsplans/runtimeConfig.native.ts b/clients/client-savingsplans/runtimeConfig.native.ts index 43fd9d4d9fc51..c91d78dd62dcd 100644 --- a/clients/client-savingsplans/runtimeConfig.native.ts +++ b/clients/client-savingsplans/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SavingsplansClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-savingsplans/runtimeConfig.ts b/clients/client-savingsplans/runtimeConfig.ts index 06130fe386e90..0e91dc5e90694 100644 --- a/clients/client-savingsplans/runtimeConfig.ts +++ b/clients/client-savingsplans/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-schemas/SchemasClient.ts b/clients/client-schemas/SchemasClient.ts index acbd6fda9d8a0..6c3b2648f53be 100644 --- a/clients/client-schemas/SchemasClient.ts +++ b/clients/client-schemas/SchemasClient.ts @@ -84,6 +84,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -94,6 +95,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -209,11 +211,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -255,6 +252,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SchemasClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -263,8 +266,8 @@ export type SchemasClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SchemasClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -272,8 +275,8 @@ export type SchemasClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon EventBridge Schema Registry

@@ -295,16 +298,16 @@ export class SchemasClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-schemas/runtimeConfig.browser.ts b/clients/client-schemas/runtimeConfig.browser.ts index e9a919557cbe9..915071791fbbe 100644 --- a/clients/client-schemas/runtimeConfig.browser.ts +++ b/clients/client-schemas/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-schemas/runtimeConfig.native.ts b/clients/client-schemas/runtimeConfig.native.ts index 6ec04bfab8deb..51138d3693735 100644 --- a/clients/client-schemas/runtimeConfig.native.ts +++ b/clients/client-schemas/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SchemasClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-schemas/runtimeConfig.ts b/clients/client-schemas/runtimeConfig.ts index f553aec4d19bd..45636e8a830db 100644 --- a/clients/client-schemas/runtimeConfig.ts +++ b/clients/client-schemas/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-secrets-manager/SecretsManagerClient.ts b/clients/client-secrets-manager/SecretsManagerClient.ts index b42a55d3449bd..2617bafcf3dc1 100644 --- a/clients/client-secrets-manager/SecretsManagerClient.ts +++ b/clients/client-secrets-manager/SecretsManagerClient.ts @@ -66,6 +66,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -76,6 +77,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -167,11 +169,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -213,6 +210,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SecretsManagerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -221,8 +224,8 @@ export type SecretsManagerClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SecretsManagerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -230,8 +233,8 @@ export type SecretsManagerClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Secrets Manager API Reference @@ -315,16 +318,16 @@ export class SecretsManagerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-secrets-manager/runtimeConfig.browser.ts b/clients/client-secrets-manager/runtimeConfig.browser.ts index 2dddda132a68f..9e26246a3c468 100644 --- a/clients/client-secrets-manager/runtimeConfig.browser.ts +++ b/clients/client-secrets-manager/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-secrets-manager/runtimeConfig.native.ts b/clients/client-secrets-manager/runtimeConfig.native.ts index 657c775b8f3f7..ceed11dc98bfd 100644 --- a/clients/client-secrets-manager/runtimeConfig.native.ts +++ b/clients/client-secrets-manager/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SecretsManagerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-secrets-manager/runtimeConfig.ts b/clients/client-secrets-manager/runtimeConfig.ts index 8f54fe76eb283..fecf768159e7c 100644 --- a/clients/client-secrets-manager/runtimeConfig.ts +++ b/clients/client-secrets-manager/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-securityhub/SecurityHubClient.ts b/clients/client-securityhub/SecurityHubClient.ts index c6da8a7cc61bc..983e152215a8f 100644 --- a/clients/client-securityhub/SecurityHubClient.ts +++ b/clients/client-securityhub/SecurityHubClient.ts @@ -146,6 +146,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -156,6 +157,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -305,11 +307,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -351,6 +348,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SecurityHubClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -359,8 +362,8 @@ export type SecurityHubClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SecurityHubClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -368,8 +371,8 @@ export type SecurityHubClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Security Hub provides you with a comprehensive view of the security state of your AWS @@ -445,16 +448,16 @@ export class SecurityHubClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-securityhub/runtimeConfig.browser.ts b/clients/client-securityhub/runtimeConfig.browser.ts index 895ae6aafc3a7..6ba9bee2afa02 100644 --- a/clients/client-securityhub/runtimeConfig.browser.ts +++ b/clients/client-securityhub/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-securityhub/runtimeConfig.native.ts b/clients/client-securityhub/runtimeConfig.native.ts index 3521fd7b35c73..dd9d2e7caab33 100644 --- a/clients/client-securityhub/runtimeConfig.native.ts +++ b/clients/client-securityhub/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SecurityHubClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-securityhub/runtimeConfig.ts b/clients/client-securityhub/runtimeConfig.ts index ae21fc35654d0..0eebedf88d713 100644 --- a/clients/client-securityhub/runtimeConfig.ts +++ b/clients/client-securityhub/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-serverlessapplicationrepository/ServerlessApplicationRepositoryClient.ts b/clients/client-serverlessapplicationrepository/ServerlessApplicationRepositoryClient.ts index bb4bc7e1bad67..6e68abcf5fe1b 100644 --- a/clients/client-serverlessapplicationrepository/ServerlessApplicationRepositoryClient.ts +++ b/clients/client-serverlessapplicationrepository/ServerlessApplicationRepositoryClient.ts @@ -73,6 +73,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -83,6 +84,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -164,11 +166,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -210,6 +207,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ServerlessApplicationRepositoryClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -218,8 +221,8 @@ export type ServerlessApplicationRepositoryClientConfig = Partial<__SmithyConfig EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ServerlessApplicationRepositoryClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -227,8 +230,8 @@ export type ServerlessApplicationRepositoryClientResolvedConfig = __SmithyResolv EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The AWS Serverless Application Repository makes it easy for developers and enterprises to quickly find @@ -269,16 +272,16 @@ export class ServerlessApplicationRepositoryClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-serverlessapplicationrepository/runtimeConfig.browser.ts b/clients/client-serverlessapplicationrepository/runtimeConfig.browser.ts index 0fedf8d4dc24f..be17cfbba1129 100644 --- a/clients/client-serverlessapplicationrepository/runtimeConfig.browser.ts +++ b/clients/client-serverlessapplicationrepository/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-serverlessapplicationrepository/runtimeConfig.native.ts b/clients/client-serverlessapplicationrepository/runtimeConfig.native.ts index cf2754a217ee9..1c230fb24295f 100644 --- a/clients/client-serverlessapplicationrepository/runtimeConfig.native.ts +++ b/clients/client-serverlessapplicationrepository/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ServerlessApplicationRepositoryClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-serverlessapplicationrepository/runtimeConfig.ts b/clients/client-serverlessapplicationrepository/runtimeConfig.ts index ca18348b4e876..8fb70a7d44995 100644 --- a/clients/client-serverlessapplicationrepository/runtimeConfig.ts +++ b/clients/client-serverlessapplicationrepository/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-service-catalog-appregistry/ServiceCatalogAppRegistryClient.ts b/clients/client-service-catalog-appregistry/ServiceCatalogAppRegistryClient.ts index 5092cbcbeb025..ce2e5c2508c60 100644 --- a/clients/client-service-catalog-appregistry/ServiceCatalogAppRegistryClient.ts +++ b/clients/client-service-catalog-appregistry/ServiceCatalogAppRegistryClient.ts @@ -84,6 +84,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -94,6 +95,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -185,11 +187,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -231,6 +228,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ServiceCatalogAppRegistryClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -239,8 +242,8 @@ export type ServiceCatalogAppRegistryClientConfig = Partial<__SmithyConfiguratio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ServiceCatalogAppRegistryClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -248,8 +251,8 @@ export type ServiceCatalogAppRegistryClientResolvedConfig = __SmithyResolvedConf EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Service Catalog AppRegistry enables organizations to understand the application context of their AWS resources. AppRegistry provides a repository of your applications, their resources, and the application metadata that you use within your enterprise.

@@ -271,16 +274,16 @@ export class ServiceCatalogAppRegistryClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-service-catalog-appregistry/runtimeConfig.browser.ts b/clients/client-service-catalog-appregistry/runtimeConfig.browser.ts index 4f451273696f7..c1a44b749fce0 100644 --- a/clients/client-service-catalog-appregistry/runtimeConfig.browser.ts +++ b/clients/client-service-catalog-appregistry/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-service-catalog-appregistry/runtimeConfig.native.ts b/clients/client-service-catalog-appregistry/runtimeConfig.native.ts index ee600010499f3..9f3a125df0eed 100644 --- a/clients/client-service-catalog-appregistry/runtimeConfig.native.ts +++ b/clients/client-service-catalog-appregistry/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ServiceCatalogAppRegistryClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-service-catalog-appregistry/runtimeConfig.ts b/clients/client-service-catalog-appregistry/runtimeConfig.ts index 78c8f1cd32c71..6b90b5bba3dae 100644 --- a/clients/client-service-catalog-appregistry/runtimeConfig.ts +++ b/clients/client-service-catalog-appregistry/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-service-catalog/ServiceCatalogClient.ts b/clients/client-service-catalog/ServiceCatalogClient.ts index bec6c821a9170..2ed21dbec3f7a 100644 --- a/clients/client-service-catalog/ServiceCatalogClient.ts +++ b/clients/client-service-catalog/ServiceCatalogClient.ts @@ -300,6 +300,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -310,6 +311,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -533,11 +535,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -579,6 +576,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ServiceCatalogClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -587,8 +590,8 @@ export type ServiceCatalogClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ServiceCatalogClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -596,8 +599,8 @@ export type ServiceCatalogClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Service Catalog @@ -625,16 +628,16 @@ export class ServiceCatalogClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-service-catalog/runtimeConfig.browser.ts b/clients/client-service-catalog/runtimeConfig.browser.ts index afd0157c051b5..77795b217d49d 100644 --- a/clients/client-service-catalog/runtimeConfig.browser.ts +++ b/clients/client-service-catalog/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-service-catalog/runtimeConfig.native.ts b/clients/client-service-catalog/runtimeConfig.native.ts index 64f4d2e33b09c..6e6b7c049f125 100644 --- a/clients/client-service-catalog/runtimeConfig.native.ts +++ b/clients/client-service-catalog/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ServiceCatalogClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-service-catalog/runtimeConfig.ts b/clients/client-service-catalog/runtimeConfig.ts index 9d47538a9ce3a..8017131b4ba45 100644 --- a/clients/client-service-catalog/runtimeConfig.ts +++ b/clients/client-service-catalog/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-service-quotas/ServiceQuotasClient.ts b/clients/client-service-quotas/ServiceQuotasClient.ts index 678437a9809a6..8bc4443ad3d0f 100644 --- a/clients/client-service-quotas/ServiceQuotasClient.ts +++ b/clients/client-service-quotas/ServiceQuotasClient.ts @@ -90,6 +90,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -100,6 +101,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -185,11 +187,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -231,6 +228,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ServiceQuotasClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -239,8 +242,8 @@ export type ServiceQuotasClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ServiceQuotasClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -248,8 +251,8 @@ export type ServiceQuotasClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Service Quotas is a web service that you can use to manage many of your AWS service @@ -282,16 +285,16 @@ export class ServiceQuotasClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-service-quotas/runtimeConfig.browser.ts b/clients/client-service-quotas/runtimeConfig.browser.ts index 458ce3ce4e711..463ad036364f6 100644 --- a/clients/client-service-quotas/runtimeConfig.browser.ts +++ b/clients/client-service-quotas/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-service-quotas/runtimeConfig.native.ts b/clients/client-service-quotas/runtimeConfig.native.ts index 30fe2aecdc136..48a66cb351d54 100644 --- a/clients/client-service-quotas/runtimeConfig.native.ts +++ b/clients/client-service-quotas/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ServiceQuotasClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-service-quotas/runtimeConfig.ts b/clients/client-service-quotas/runtimeConfig.ts index 91e9eefda9741..ab0506d45e8dd 100644 --- a/clients/client-service-quotas/runtimeConfig.ts +++ b/clients/client-service-quotas/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-servicediscovery/ServiceDiscoveryClient.ts b/clients/client-servicediscovery/ServiceDiscoveryClient.ts index d020d85f32a11..1a13f278c259e 100644 --- a/clients/client-servicediscovery/ServiceDiscoveryClient.ts +++ b/clients/client-servicediscovery/ServiceDiscoveryClient.ts @@ -76,6 +76,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -86,6 +87,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -185,11 +187,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -231,6 +228,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ServiceDiscoveryClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -239,8 +242,8 @@ export type ServiceDiscoveryClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ServiceDiscoveryClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -248,8 +251,8 @@ export type ServiceDiscoveryClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Cloud Map lets you configure public DNS, private DNS, or HTTP namespaces that your microservice applications @@ -275,16 +278,16 @@ export class ServiceDiscoveryClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-servicediscovery/runtimeConfig.browser.ts b/clients/client-servicediscovery/runtimeConfig.browser.ts index 994ee89c31f0a..a3b13d5e82072 100644 --- a/clients/client-servicediscovery/runtimeConfig.browser.ts +++ b/clients/client-servicediscovery/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-servicediscovery/runtimeConfig.native.ts b/clients/client-servicediscovery/runtimeConfig.native.ts index 944f125275e08..acaccf3a0df37 100644 --- a/clients/client-servicediscovery/runtimeConfig.native.ts +++ b/clients/client-servicediscovery/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ServiceDiscoveryClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-servicediscovery/runtimeConfig.ts b/clients/client-servicediscovery/runtimeConfig.ts index b7ee53509b50c..ba756b546b2aa 100644 --- a/clients/client-servicediscovery/runtimeConfig.ts +++ b/clients/client-servicediscovery/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ses/SESClient.ts b/clients/client-ses/SESClient.ts index a5907055bcd98..f680612bc1113 100644 --- a/clients/client-ses/SESClient.ts +++ b/clients/client-ses/SESClient.ts @@ -256,6 +256,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -266,6 +267,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -461,11 +463,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -507,6 +504,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SESClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -515,8 +518,8 @@ export type SESClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SESClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -524,8 +527,8 @@ export type SESClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Simple Email Service @@ -555,16 +558,16 @@ export class SESClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ses/runtimeConfig.browser.ts b/clients/client-ses/runtimeConfig.browser.ts index 26eb616cdfb73..d75c725b6b3ea 100644 --- a/clients/client-ses/runtimeConfig.browser.ts +++ b/clients/client-ses/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ses/runtimeConfig.native.ts b/clients/client-ses/runtimeConfig.native.ts index 51f65df33326e..1bb017439ca7a 100644 --- a/clients/client-ses/runtimeConfig.native.ts +++ b/clients/client-ses/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SESClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ses/runtimeConfig.ts b/clients/client-ses/runtimeConfig.ts index f014c7db40574..5c1ed47b84d83 100644 --- a/clients/client-ses/runtimeConfig.ts +++ b/clients/client-ses/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sesv2/SESv2Client.ts b/clients/client-sesv2/SESv2Client.ts index aab8855655969..19abbf68222d4 100644 --- a/clients/client-sesv2/SESv2Client.ts +++ b/clients/client-sesv2/SESv2Client.ts @@ -283,6 +283,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -293,6 +294,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -506,11 +508,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -552,6 +549,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SESv2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -560,8 +563,8 @@ export type SESv2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SESv2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -569,8 +572,8 @@ export type SESv2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon SES API v2 @@ -611,16 +614,16 @@ export class SESv2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sesv2/runtimeConfig.browser.ts b/clients/client-sesv2/runtimeConfig.browser.ts index a540a3f328022..1dcda64649fcd 100644 --- a/clients/client-sesv2/runtimeConfig.browser.ts +++ b/clients/client-sesv2/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sesv2/runtimeConfig.native.ts b/clients/client-sesv2/runtimeConfig.native.ts index 643610f632566..de4ce746efe7c 100644 --- a/clients/client-sesv2/runtimeConfig.native.ts +++ b/clients/client-sesv2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SESv2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sesv2/runtimeConfig.ts b/clients/client-sesv2/runtimeConfig.ts index 29dfbbbfe6c0c..c10e43d09c7c3 100644 --- a/clients/client-sesv2/runtimeConfig.ts +++ b/clients/client-sesv2/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sfn/SFNClient.ts b/clients/client-sfn/SFNClient.ts index f900342f62369..56f5450245dc0 100644 --- a/clients/client-sfn/SFNClient.ts +++ b/clients/client-sfn/SFNClient.ts @@ -70,6 +70,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -80,6 +81,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -179,11 +181,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -225,6 +222,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SFNClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -233,8 +236,8 @@ export type SFNClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SFNClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -242,8 +245,8 @@ export type SFNClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Step Functions @@ -280,16 +283,16 @@ export class SFNClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sfn/runtimeConfig.browser.ts b/clients/client-sfn/runtimeConfig.browser.ts index 29ff52e06066b..feb4baba53c74 100644 --- a/clients/client-sfn/runtimeConfig.browser.ts +++ b/clients/client-sfn/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sfn/runtimeConfig.native.ts b/clients/client-sfn/runtimeConfig.native.ts index a7b55e5cb611b..00d159d01f9dc 100644 --- a/clients/client-sfn/runtimeConfig.native.ts +++ b/clients/client-sfn/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SFNClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sfn/runtimeConfig.ts b/clients/client-sfn/runtimeConfig.ts index afb547724557d..f8216174433fd 100644 --- a/clients/client-sfn/runtimeConfig.ts +++ b/clients/client-sfn/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-shield/ShieldClient.ts b/clients/client-shield/ShieldClient.ts index 927bd005b20e4..176213b21ff0f 100644 --- a/clients/client-shield/ShieldClient.ts +++ b/clients/client-shield/ShieldClient.ts @@ -122,6 +122,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -132,6 +133,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -245,11 +247,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -291,6 +288,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ShieldClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -299,8 +302,8 @@ export type ShieldClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ShieldClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -308,8 +311,8 @@ export type ShieldClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Shield Advanced @@ -334,16 +337,16 @@ export class ShieldClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-shield/runtimeConfig.browser.ts b/clients/client-shield/runtimeConfig.browser.ts index e68cfe313d51d..483403f16dea2 100644 --- a/clients/client-shield/runtimeConfig.browser.ts +++ b/clients/client-shield/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-shield/runtimeConfig.native.ts b/clients/client-shield/runtimeConfig.native.ts index 8c9823e405af8..0ec8cbf92b197 100644 --- a/clients/client-shield/runtimeConfig.native.ts +++ b/clients/client-shield/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ShieldClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-shield/runtimeConfig.ts b/clients/client-shield/runtimeConfig.ts index 947252f497821..720c6456ac9de 100644 --- a/clients/client-shield/runtimeConfig.ts +++ b/clients/client-shield/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-signer/SignerClient.ts b/clients/client-signer/SignerClient.ts index 7ef9a065778f8..a049419b1c7a9 100644 --- a/clients/client-signer/SignerClient.ts +++ b/clients/client-signer/SignerClient.ts @@ -76,6 +76,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -86,6 +87,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -173,11 +175,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -219,6 +216,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SignerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -227,8 +230,8 @@ export type SignerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SignerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -236,8 +239,8 @@ export type SignerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Signer is a fully managed code signing service to help you ensure the trust and @@ -275,16 +278,16 @@ export class SignerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-signer/runtimeConfig.browser.ts b/clients/client-signer/runtimeConfig.browser.ts index 8a57aa7d2a725..1fc6924f82a8a 100644 --- a/clients/client-signer/runtimeConfig.browser.ts +++ b/clients/client-signer/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-signer/runtimeConfig.native.ts b/clients/client-signer/runtimeConfig.native.ts index fbd2cc504fa73..a4baf366b8948 100644 --- a/clients/client-signer/runtimeConfig.native.ts +++ b/clients/client-signer/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SignerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-signer/runtimeConfig.ts b/clients/client-signer/runtimeConfig.ts index 50a3939ca2e94..bfa850d4e9ccc 100644 --- a/clients/client-signer/runtimeConfig.ts +++ b/clients/client-signer/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sms/SMSClient.ts b/clients/client-sms/SMSClient.ts index de5f6db2966d1..b2e32ed217e39 100644 --- a/clients/client-sms/SMSClient.ts +++ b/clients/client-sms/SMSClient.ts @@ -130,6 +130,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -140,6 +141,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -263,11 +265,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -309,6 +306,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SMSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -317,8 +320,8 @@ export type SMSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SMSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -326,8 +329,8 @@ export type SMSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Server Migration Service @@ -365,16 +368,16 @@ export class SMSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sms/runtimeConfig.browser.ts b/clients/client-sms/runtimeConfig.browser.ts index 8232328b3c511..f832dbc9de705 100644 --- a/clients/client-sms/runtimeConfig.browser.ts +++ b/clients/client-sms/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sms/runtimeConfig.native.ts b/clients/client-sms/runtimeConfig.native.ts index 4bc1ab9e5b035..c95fc3ed6760f 100644 --- a/clients/client-sms/runtimeConfig.native.ts +++ b/clients/client-sms/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SMSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sms/runtimeConfig.ts b/clients/client-sms/runtimeConfig.ts index eba8fc1d468f1..75b1b996e8aa7 100644 --- a/clients/client-sms/runtimeConfig.ts +++ b/clients/client-sms/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-snowball/SnowballClient.ts b/clients/client-snowball/SnowballClient.ts index 8e4333a77d91d..c5a65cc2291a7 100644 --- a/clients/client-snowball/SnowballClient.ts +++ b/clients/client-snowball/SnowballClient.ts @@ -69,6 +69,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -79,6 +80,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -176,11 +178,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -222,6 +219,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SnowballClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -230,8 +233,8 @@ export type SnowballClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SnowballClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -239,8 +242,8 @@ export type SnowballClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Snow Family is a petabyte-scale data transport solution that uses secure devices to @@ -268,16 +271,16 @@ export class SnowballClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-snowball/runtimeConfig.browser.ts b/clients/client-snowball/runtimeConfig.browser.ts index 6d4ae01f4a08f..2f20490bf5cb5 100644 --- a/clients/client-snowball/runtimeConfig.browser.ts +++ b/clients/client-snowball/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-snowball/runtimeConfig.native.ts b/clients/client-snowball/runtimeConfig.native.ts index ec4eea64dda56..2d91706b1deba 100644 --- a/clients/client-snowball/runtimeConfig.native.ts +++ b/clients/client-snowball/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SnowballClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-snowball/runtimeConfig.ts b/clients/client-snowball/runtimeConfig.ts index 5bb03ff898395..0f406bd951a71 100644 --- a/clients/client-snowball/runtimeConfig.ts +++ b/clients/client-snowball/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sns/SNSClient.ts b/clients/client-sns/SNSClient.ts index 70e7b04843675..7c4ebd7972981 100644 --- a/clients/client-sns/SNSClient.ts +++ b/clients/client-sns/SNSClient.ts @@ -116,6 +116,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -126,6 +127,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -245,11 +247,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -291,6 +288,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SNSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -299,8 +302,8 @@ export type SNSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SNSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -308,8 +311,8 @@ export type SNSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Simple Notification Service @@ -344,16 +347,16 @@ export class SNSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sns/runtimeConfig.browser.ts b/clients/client-sns/runtimeConfig.browser.ts index 7a32870c37435..6fa0f51b1f046 100644 --- a/clients/client-sns/runtimeConfig.browser.ts +++ b/clients/client-sns/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sns/runtimeConfig.native.ts b/clients/client-sns/runtimeConfig.native.ts index afffe39183728..d2f5fa43ba094 100644 --- a/clients/client-sns/runtimeConfig.native.ts +++ b/clients/client-sns/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SNSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sns/runtimeConfig.ts b/clients/client-sns/runtimeConfig.ts index 9cdebd29a8028..44bc423367006 100644 --- a/clients/client-sns/runtimeConfig.ts +++ b/clients/client-sns/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sqs/SQSClient.ts b/clients/client-sqs/SQSClient.ts index f046232304d7b..d14932fab11b1 100644 --- a/clients/client-sqs/SQSClient.ts +++ b/clients/client-sqs/SQSClient.ts @@ -64,6 +64,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -74,6 +75,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -167,11 +169,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -219,6 +216,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * that computes MD5 hashes */ md5?: __HashConstructor; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SQSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -227,8 +230,8 @@ export type SQSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SQSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -236,8 +239,8 @@ export type SQSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Welcome to the Amazon Simple Queue Service API Reference.

@@ -327,16 +330,16 @@ export class SQSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sqs/runtimeConfig.browser.ts b/clients/client-sqs/runtimeConfig.browser.ts index c7810b4c2efc3..764ee1f356dab 100644 --- a/clients/client-sqs/runtimeConfig.browser.ts +++ b/clients/client-sqs/runtimeConfig.browser.ts @@ -23,7 +23,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, md5: Md5, region: invalidAsyncFunction("Region is missing") as any, diff --git a/clients/client-sqs/runtimeConfig.native.ts b/clients/client-sqs/runtimeConfig.native.ts index 382075f732688..747f3fc27b68d 100644 --- a/clients/client-sqs/runtimeConfig.native.ts +++ b/clients/client-sqs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SQSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sqs/runtimeConfig.ts b/clients/client-sqs/runtimeConfig.ts index 1bd7ef89c53b4..856c80d245c41 100644 --- a/clients/client-sqs/runtimeConfig.ts +++ b/clients/client-sqs/runtimeConfig.ts @@ -25,7 +25,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), md5: Hash.bind(null, "md5"), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), diff --git a/clients/client-ssm/SSMClient.ts b/clients/client-ssm/SSMClient.ts index df1d89e3066d6..03532a9f7a0bf 100644 --- a/clients/client-ssm/SSMClient.ts +++ b/clients/client-ssm/SSMClient.ts @@ -411,6 +411,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -421,6 +422,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -728,11 +730,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -774,6 +771,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SSMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -782,8 +785,8 @@ export type SSMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SSMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -791,8 +794,8 @@ export type SSMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Systems Manager @@ -827,16 +830,16 @@ export class SSMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ssm/runtimeConfig.browser.ts b/clients/client-ssm/runtimeConfig.browser.ts index 188eb31b35b24..fa23d9f2cd182 100644 --- a/clients/client-ssm/runtimeConfig.browser.ts +++ b/clients/client-ssm/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ssm/runtimeConfig.native.ts b/clients/client-ssm/runtimeConfig.native.ts index fc2dc4d37ef40..9152a78f57a4f 100644 --- a/clients/client-ssm/runtimeConfig.native.ts +++ b/clients/client-ssm/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SSMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ssm/runtimeConfig.ts b/clients/client-ssm/runtimeConfig.ts index c6629bfe3fa02..c35b49f5dcb3a 100644 --- a/clients/client-ssm/runtimeConfig.ts +++ b/clients/client-ssm/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sso-admin/SSOAdminClient.ts b/clients/client-sso-admin/SSOAdminClient.ts index 4fbab42fab83f..f8bcfcc00bd37 100644 --- a/clients/client-sso-admin/SSOAdminClient.ts +++ b/clients/client-sso-admin/SSOAdminClient.ts @@ -147,6 +147,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -157,6 +158,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -272,11 +274,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -318,6 +315,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SSOAdminClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -326,8 +329,8 @@ export type SSOAdminClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SSOAdminClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -335,8 +338,8 @@ export type SSOAdminClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; export class SSOAdminClient extends __Client< __HttpHandlerOptions, @@ -355,16 +358,16 @@ export class SSOAdminClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sso-admin/runtimeConfig.browser.ts b/clients/client-sso-admin/runtimeConfig.browser.ts index ff78878335bc7..827f3a688623c 100644 --- a/clients/client-sso-admin/runtimeConfig.browser.ts +++ b/clients/client-sso-admin/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sso-admin/runtimeConfig.native.ts b/clients/client-sso-admin/runtimeConfig.native.ts index 65e01ed51b199..7f6c1a49eb890 100644 --- a/clients/client-sso-admin/runtimeConfig.native.ts +++ b/clients/client-sso-admin/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SSOAdminClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sso-admin/runtimeConfig.ts b/clients/client-sso-admin/runtimeConfig.ts index 13a07e4a37c74..69f0205fd6254 100644 --- a/clients/client-sso-admin/runtimeConfig.ts +++ b/clients/client-sso-admin/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sso-oidc/SSOOIDCClient.ts b/clients/client-sso-oidc/SSOOIDCClient.ts index c83e0ea341620..4fa412bb3f5cb 100644 --- a/clients/client-sso-oidc/SSOOIDCClient.ts +++ b/clients/client-sso-oidc/SSOOIDCClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -105,11 +107,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -151,6 +148,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SSOOIDCClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -159,8 +162,8 @@ export type SSOOIDCClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SSOOIDCClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -168,8 +171,8 @@ export type SSOOIDCClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Single Sign-On (SSO) OpenID Connect (OIDC) is a web service that enables a client @@ -208,15 +211,15 @@ export class SSOOIDCClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sso-oidc/runtimeConfig.browser.ts b/clients/client-sso-oidc/runtimeConfig.browser.ts index c1f6b89f069a0..d1cb30d36219e 100644 --- a/clients/client-sso-oidc/runtimeConfig.browser.ts +++ b/clients/client-sso-oidc/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sso-oidc/runtimeConfig.native.ts b/clients/client-sso-oidc/runtimeConfig.native.ts index 2d6edb1f73af6..ca0e0299d2f0e 100644 --- a/clients/client-sso-oidc/runtimeConfig.native.ts +++ b/clients/client-sso-oidc/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SSOOIDCClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sso-oidc/runtimeConfig.ts b/clients/client-sso-oidc/runtimeConfig.ts index bb96ed7e71605..2007407b27521 100644 --- a/clients/client-sso-oidc/runtimeConfig.ts +++ b/clients/client-sso-oidc/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sso/SSOClient.ts b/clients/client-sso/SSOClient.ts index 78f0f7250c8e0..8fb13c50c89b2 100644 --- a/clients/client-sso/SSOClient.ts +++ b/clients/client-sso/SSOClient.ts @@ -34,6 +34,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -44,6 +45,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -105,11 +107,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -151,6 +148,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SSOClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -159,8 +162,8 @@ export type SSOClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SSOClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -168,8 +171,8 @@ export type SSOClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Single Sign-On Portal is a web service that makes it easy for you to assign user @@ -206,15 +209,15 @@ export class SSOClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sso/runtimeConfig.browser.ts b/clients/client-sso/runtimeConfig.browser.ts index e0586f6519e2d..9df1925afc84b 100644 --- a/clients/client-sso/runtimeConfig.browser.ts +++ b/clients/client-sso/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sso/runtimeConfig.native.ts b/clients/client-sso/runtimeConfig.native.ts index d8ad68c511e87..3ad0db426b847 100644 --- a/clients/client-sso/runtimeConfig.native.ts +++ b/clients/client-sso/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SSOClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sso/runtimeConfig.ts b/clients/client-sso/runtimeConfig.ts index 789068a8fee1c..3d0de7113633f 100644 --- a/clients/client-sso/runtimeConfig.ts +++ b/clients/client-sso/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-storage-gateway/StorageGatewayClient.ts b/clients/client-storage-gateway/StorageGatewayClient.ts index e19ddd02316cb..fbf36f0be18d6 100644 --- a/clients/client-storage-gateway/StorageGatewayClient.ts +++ b/clients/client-storage-gateway/StorageGatewayClient.ts @@ -254,6 +254,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -264,6 +265,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -485,11 +487,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -531,6 +528,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type StorageGatewayClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -539,8 +542,8 @@ export type StorageGatewayClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type StorageGatewayClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -548,8 +551,8 @@ export type StorageGatewayClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Storage Gateway Service @@ -642,16 +645,16 @@ export class StorageGatewayClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-storage-gateway/runtimeConfig.browser.ts b/clients/client-storage-gateway/runtimeConfig.browser.ts index 66830ce32ac70..bd6ffe278c2ed 100644 --- a/clients/client-storage-gateway/runtimeConfig.browser.ts +++ b/clients/client-storage-gateway/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-storage-gateway/runtimeConfig.native.ts b/clients/client-storage-gateway/runtimeConfig.native.ts index cc6d1c0ac637a..ce154893764f6 100644 --- a/clients/client-storage-gateway/runtimeConfig.native.ts +++ b/clients/client-storage-gateway/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./StorageGatewayClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-storage-gateway/runtimeConfig.ts b/clients/client-storage-gateway/runtimeConfig.ts index 8c73ede9abd22..05ca1184f758c 100644 --- a/clients/client-storage-gateway/runtimeConfig.ts +++ b/clients/client-storage-gateway/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sts/STSClient.ts b/clients/client-sts/STSClient.ts index b5554ddbccc25..11b25d8e1db49 100644 --- a/clients/client-sts/STSClient.ts +++ b/clients/client-sts/STSClient.ts @@ -44,6 +44,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -54,6 +55,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -123,11 +125,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -169,6 +166,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type STSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -177,8 +180,8 @@ export type STSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type STSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -186,8 +189,8 @@ export type STSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Security Token Service @@ -213,15 +216,15 @@ export class STSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sts/runtimeConfig.browser.ts b/clients/client-sts/runtimeConfig.browser.ts index 51151068b48d9..9b88b1c246edb 100644 --- a/clients/client-sts/runtimeConfig.browser.ts +++ b/clients/client-sts/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sts/runtimeConfig.native.ts b/clients/client-sts/runtimeConfig.native.ts index 5161b3c6ef3ed..18c5e144a2e0e 100644 --- a/clients/client-sts/runtimeConfig.native.ts +++ b/clients/client-sts/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./STSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sts/runtimeConfig.ts b/clients/client-sts/runtimeConfig.ts index 7b79d9cf829bf..742e5a0e0532d 100644 --- a/clients/client-sts/runtimeConfig.ts +++ b/clients/client-sts/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-support/SupportClient.ts b/clients/client-support/SupportClient.ts index effc949b286ab..e1b70744ef577 100644 --- a/clients/client-support/SupportClient.ts +++ b/clients/client-support/SupportClient.ts @@ -76,6 +76,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -86,6 +87,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -167,11 +169,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -213,6 +210,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SupportClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -221,8 +224,8 @@ export type SupportClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SupportClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -230,8 +233,8 @@ export type SupportClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Support @@ -329,16 +332,16 @@ export class SupportClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-support/runtimeConfig.browser.ts b/clients/client-support/runtimeConfig.browser.ts index 7263a91ad5627..9c2064edbee96 100644 --- a/clients/client-support/runtimeConfig.browser.ts +++ b/clients/client-support/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-support/runtimeConfig.native.ts b/clients/client-support/runtimeConfig.native.ts index 91f90d7b10574..dc58990668d10 100644 --- a/clients/client-support/runtimeConfig.native.ts +++ b/clients/client-support/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SupportClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-support/runtimeConfig.ts b/clients/client-support/runtimeConfig.ts index 6eb899b68ab3d..5ba10887af159 100644 --- a/clients/client-support/runtimeConfig.ts +++ b/clients/client-support/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-swf/SWFClient.ts b/clients/client-swf/SWFClient.ts index 0bca73e993ffd..6f37c1c72344b 100644 --- a/clients/client-swf/SWFClient.ts +++ b/clients/client-swf/SWFClient.ts @@ -156,6 +156,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -166,6 +167,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -293,11 +295,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -339,6 +336,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SWFClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -347,8 +350,8 @@ export type SWFClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SWFClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -356,8 +359,8 @@ export type SWFClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Simple Workflow Service @@ -394,16 +397,16 @@ export class SWFClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-swf/runtimeConfig.browser.ts b/clients/client-swf/runtimeConfig.browser.ts index 59c0a7d26b5dd..b6754ff11c968 100644 --- a/clients/client-swf/runtimeConfig.browser.ts +++ b/clients/client-swf/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-swf/runtimeConfig.native.ts b/clients/client-swf/runtimeConfig.native.ts index ff1e21573c415..2049ed2381d67 100644 --- a/clients/client-swf/runtimeConfig.native.ts +++ b/clients/client-swf/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SWFClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-swf/runtimeConfig.ts b/clients/client-swf/runtimeConfig.ts index 3e1b30d286a8c..957d607a73b20 100644 --- a/clients/client-swf/runtimeConfig.ts +++ b/clients/client-swf/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-synthetics/SyntheticsClient.ts b/clients/client-synthetics/SyntheticsClient.ts index af58ef094e420..2f915eaca1967 100644 --- a/clients/client-synthetics/SyntheticsClient.ts +++ b/clients/client-synthetics/SyntheticsClient.ts @@ -57,6 +57,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -67,6 +68,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -146,11 +148,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -192,6 +189,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SyntheticsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -200,8 +203,8 @@ export type SyntheticsClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SyntheticsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -209,8 +212,8 @@ export type SyntheticsClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon CloudWatch Synthetics @@ -247,16 +250,16 @@ export class SyntheticsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-synthetics/runtimeConfig.browser.ts b/clients/client-synthetics/runtimeConfig.browser.ts index 3178cc9c86a2a..7b5d4d70637f8 100644 --- a/clients/client-synthetics/runtimeConfig.browser.ts +++ b/clients/client-synthetics/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-synthetics/runtimeConfig.native.ts b/clients/client-synthetics/runtimeConfig.native.ts index e642b1b418320..4710dc382000b 100644 --- a/clients/client-synthetics/runtimeConfig.native.ts +++ b/clients/client-synthetics/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SyntheticsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-synthetics/runtimeConfig.ts b/clients/client-synthetics/runtimeConfig.ts index 56db6357918bb..8fb6861a42c26 100644 --- a/clients/client-synthetics/runtimeConfig.ts +++ b/clients/client-synthetics/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-textract/TextractClient.ts b/clients/client-textract/TextractClient.ts index f44c90ae41971..cfa893d50f796 100644 --- a/clients/client-textract/TextractClient.ts +++ b/clients/client-textract/TextractClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -128,11 +130,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -174,6 +171,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type TextractClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -182,8 +185,8 @@ export type TextractClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type TextractClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -191,8 +194,8 @@ export type TextractClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Textract detects and analyzes text in documents and converts it @@ -216,16 +219,16 @@ export class TextractClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-textract/runtimeConfig.browser.ts b/clients/client-textract/runtimeConfig.browser.ts index 7c9195aaf64e9..11de7ecefc857 100644 --- a/clients/client-textract/runtimeConfig.browser.ts +++ b/clients/client-textract/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-textract/runtimeConfig.native.ts b/clients/client-textract/runtimeConfig.native.ts index 35710800d3e59..fed2a54e79dc7 100644 --- a/clients/client-textract/runtimeConfig.native.ts +++ b/clients/client-textract/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./TextractClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-textract/runtimeConfig.ts b/clients/client-textract/runtimeConfig.ts index 6205f94126f6e..954379f3b33d7 100644 --- a/clients/client-textract/runtimeConfig.ts +++ b/clients/client-textract/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-timestream-query/TimestreamQueryClient.ts b/clients/client-timestream-query/TimestreamQueryClient.ts index 2ba271e919db7..d81e8332a0219 100644 --- a/clients/client-timestream-query/TimestreamQueryClient.ts +++ b/clients/client-timestream-query/TimestreamQueryClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = CancelQueryCommandInput | DescribeEndpointsCommandInput | QueryCommandInput; @@ -101,11 +103,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -147,6 +144,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type TimestreamQueryClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -155,8 +158,8 @@ export type TimestreamQueryClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type TimestreamQueryClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -164,8 +167,8 @@ export type TimestreamQueryClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -189,16 +192,16 @@ export class TimestreamQueryClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-timestream-query/runtimeConfig.browser.ts b/clients/client-timestream-query/runtimeConfig.browser.ts index 344860992f16d..5169263f83eee 100644 --- a/clients/client-timestream-query/runtimeConfig.browser.ts +++ b/clients/client-timestream-query/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-timestream-query/runtimeConfig.native.ts b/clients/client-timestream-query/runtimeConfig.native.ts index f2dad327a3607..f1dc5f5891157 100644 --- a/clients/client-timestream-query/runtimeConfig.native.ts +++ b/clients/client-timestream-query/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./TimestreamQueryClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-timestream-query/runtimeConfig.ts b/clients/client-timestream-query/runtimeConfig.ts index 796e40438c88a..f3122f7b721d6 100644 --- a/clients/client-timestream-query/runtimeConfig.ts +++ b/clients/client-timestream-query/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-timestream-write/TimestreamWriteClient.ts b/clients/client-timestream-write/TimestreamWriteClient.ts index a0641cc2f60e2..a5dab4897125d 100644 --- a/clients/client-timestream-write/TimestreamWriteClient.ts +++ b/clients/client-timestream-write/TimestreamWriteClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -146,11 +148,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -192,6 +189,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type TimestreamWriteClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -200,8 +203,8 @@ export type TimestreamWriteClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type TimestreamWriteClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -209,8 +212,8 @@ export type TimestreamWriteClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Timestream is a fast, scalable, fully managed time series database service that makes it easy to store and analyze trillions of time series data points per day. With Timestream, you can easily store and analyze IoT sensor data to derive insights from your IoT applications. You can analyze industrial telemetry to streamline equipment management and maintenance. You can also store and analyze log data and metrics to improve the performance and availability of your applications. Timestream is built from the ground up to effectively ingest, process, and store time series data. It organizes data to optimize query processing. It automatically scales based on the volume of data ingested and on the query volume to ensure you receive optimal performance while inserting and querying data. As your data grows over time, Timestream’s adaptive query processing engine spans across storage tiers to provide fast analysis while reducing costs.

@@ -232,16 +235,16 @@ export class TimestreamWriteClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-timestream-write/runtimeConfig.browser.ts b/clients/client-timestream-write/runtimeConfig.browser.ts index c9ababccb0dbd..7fd541135e2a9 100644 --- a/clients/client-timestream-write/runtimeConfig.browser.ts +++ b/clients/client-timestream-write/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-timestream-write/runtimeConfig.native.ts b/clients/client-timestream-write/runtimeConfig.native.ts index 88055c11c8d4c..764bd1a272231 100644 --- a/clients/client-timestream-write/runtimeConfig.native.ts +++ b/clients/client-timestream-write/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./TimestreamWriteClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-timestream-write/runtimeConfig.ts b/clients/client-timestream-write/runtimeConfig.ts index f0b8a1d5a275c..da2ac11edbf30 100644 --- a/clients/client-timestream-write/runtimeConfig.ts +++ b/clients/client-timestream-write/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-transcribe-streaming/TranscribeStreamingClient.ts b/clients/client-transcribe-streaming/TranscribeStreamingClient.ts index aa7ff40c3a8b7..b2cdef2c16d45 100644 --- a/clients/client-transcribe-streaming/TranscribeStreamingClient.ts +++ b/clients/client-transcribe-streaming/TranscribeStreamingClient.ts @@ -59,6 +59,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -71,6 +72,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = StartMedicalStreamTranscriptionCommandInput | StartStreamTranscriptionCommandInput; @@ -124,11 +126,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -176,6 +173,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ eventStreamPayloadHandlerProvider?: __EventStreamPayloadHandlerProvider; + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + /** * The function that provides necessary utilities for generating and parsing event stream */ @@ -188,10 +191,10 @@ export type TranscribeStreamingClientConfig = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & HostHeaderInputConfig & EventStreamInputConfig & WebSocketInputConfig & + UserAgentInputConfig & EventStreamSerdeInputConfig; export type TranscribeStreamingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & @@ -200,10 +203,10 @@ export type TranscribeStreamingClientResolvedConfig = __SmithyResolvedConfigurat EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & HostHeaderResolvedConfig & EventStreamResolvedConfig & WebSocketResolvedConfig & + UserAgentResolvedConfig & EventStreamSerdeResolvedConfig; /** @@ -226,20 +229,20 @@ export class TranscribeStreamingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); - let _config_7 = resolveEventStreamConfig(_config_6); - let _config_8 = resolveWebSocketConfig(_config_7); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveEventStreamConfig(_config_5); + let _config_7 = resolveWebSocketConfig(_config_6); + let _config_8 = resolveUserAgentConfig(_config_7); let _config_9 = resolveEventStreamSerdeConfig(_config_8); super(_config_9); this.config = _config_9; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); this.middlewareStack.use(getWebSocketPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-transcribe-streaming/runtimeConfig.browser.ts b/clients/client-transcribe-streaming/runtimeConfig.browser.ts index 4657be4850b73..275e7b9b13ea0 100644 --- a/clients/client-transcribe-streaming/runtimeConfig.browser.ts +++ b/clients/client-transcribe-streaming/runtimeConfig.browser.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), eventStreamPayloadHandlerProvider: () => eventStreamPayloadHandler, eventStreamSerdeProvider, maxAttempts: DEFAULT_MAX_ATTEMPTS, diff --git a/clients/client-transcribe-streaming/runtimeConfig.native.ts b/clients/client-transcribe-streaming/runtimeConfig.native.ts index e9dfb74bf5354..c5de4261d5734 100644 --- a/clients/client-transcribe-streaming/runtimeConfig.native.ts +++ b/clients/client-transcribe-streaming/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { WebSocketHandler, eventStreamPayloadHandler } from "@aws-sdk/middleware-sdk-transcribe-streaming"; import { parseUrl } from "@aws-sdk/url-parser-node"; @@ -12,7 +10,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, eventStreamPayloadHandlerProvider: () => eventStreamPayloadHandler, requestHandler: new WebSocketHandler(), sha256: Sha256, diff --git a/clients/client-transcribe-streaming/runtimeConfig.ts b/clients/client-transcribe-streaming/runtimeConfig.ts index 5af99a4b1355a..26e5f5bec386e 100644 --- a/clients/client-transcribe-streaming/runtimeConfig.ts +++ b/clients/client-transcribe-streaming/runtimeConfig.ts @@ -26,7 +26,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), eventStreamPayloadHandlerProvider, eventStreamSerdeProvider, maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), diff --git a/clients/client-transcribe/TranscribeClient.ts b/clients/client-transcribe/TranscribeClient.ts index 3bd7170fc4b34..061eacf8efa61 100644 --- a/clients/client-transcribe/TranscribeClient.ts +++ b/clients/client-transcribe/TranscribeClient.ts @@ -125,6 +125,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -135,6 +136,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -242,11 +244,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -288,6 +285,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type TranscribeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -296,8 +299,8 @@ export type TranscribeClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type TranscribeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -305,8 +308,8 @@ export type TranscribeClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Operations and objects for transcribing speech to text.

@@ -328,16 +331,16 @@ export class TranscribeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-transcribe/runtimeConfig.browser.ts b/clients/client-transcribe/runtimeConfig.browser.ts index fe63667d11153..06eb8ccd38ce5 100644 --- a/clients/client-transcribe/runtimeConfig.browser.ts +++ b/clients/client-transcribe/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-transcribe/runtimeConfig.native.ts b/clients/client-transcribe/runtimeConfig.native.ts index 2f32f23632c6b..2e3c754e7de3d 100644 --- a/clients/client-transcribe/runtimeConfig.native.ts +++ b/clients/client-transcribe/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./TranscribeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-transcribe/runtimeConfig.ts b/clients/client-transcribe/runtimeConfig.ts index de3621cfa373b..8a6f385abcb0e 100644 --- a/clients/client-transcribe/runtimeConfig.ts +++ b/clients/client-transcribe/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-transfer/TransferClient.ts b/clients/client-transfer/TransferClient.ts index 8aea33e09ce80..d12c9c805a355 100644 --- a/clients/client-transfer/TransferClient.ts +++ b/clients/client-transfer/TransferClient.ts @@ -67,6 +67,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -77,6 +78,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type TransferClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +227,8 @@ export type TransferClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type TransferClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +236,8 @@ export type TransferClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Transfer Family is a fully managed service that enables the transfer of files over the @@ -264,16 +267,16 @@ export class TransferClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-transfer/runtimeConfig.browser.ts b/clients/client-transfer/runtimeConfig.browser.ts index 0d93781eac69d..213ee1a261762 100644 --- a/clients/client-transfer/runtimeConfig.browser.ts +++ b/clients/client-transfer/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-transfer/runtimeConfig.native.ts b/clients/client-transfer/runtimeConfig.native.ts index c862aa79ea005..b92ae70576e4e 100644 --- a/clients/client-transfer/runtimeConfig.native.ts +++ b/clients/client-transfer/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./TransferClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-transfer/runtimeConfig.ts b/clients/client-transfer/runtimeConfig.ts index 972871d41fabf..a7f7a04ff9f70 100644 --- a/clients/client-transfer/runtimeConfig.ts +++ b/clients/client-transfer/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-translate/TranslateClient.ts b/clients/client-translate/TranslateClient.ts index 4329be8139ff3..f3c67cff83fbb 100644 --- a/clients/client-translate/TranslateClient.ts +++ b/clients/client-translate/TranslateClient.ts @@ -61,6 +61,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -71,6 +72,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -152,11 +154,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -198,6 +195,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type TranslateClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -206,8 +209,8 @@ export type TranslateClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type TranslateClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -215,8 +218,8 @@ export type TranslateClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Provides translation between one source language and another of the same set of @@ -239,16 +242,16 @@ export class TranslateClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-translate/runtimeConfig.browser.ts b/clients/client-translate/runtimeConfig.browser.ts index 3dc5a28957f9b..6f390efa04777 100644 --- a/clients/client-translate/runtimeConfig.browser.ts +++ b/clients/client-translate/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-translate/runtimeConfig.native.ts b/clients/client-translate/runtimeConfig.native.ts index e6bd39b75c175..6fdd202c6526e 100644 --- a/clients/client-translate/runtimeConfig.native.ts +++ b/clients/client-translate/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./TranslateClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-translate/runtimeConfig.ts b/clients/client-translate/runtimeConfig.ts index 06c4382f37235..abc996f0c3ad3 100644 --- a/clients/client-translate/runtimeConfig.ts +++ b/clients/client-translate/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-waf-regional/WAFRegionalClient.ts b/clients/client-waf-regional/WAFRegionalClient.ts index 997a77ed2c41d..043237022cf2a 100644 --- a/clients/client-waf-regional/WAFRegionalClient.ts +++ b/clients/client-waf-regional/WAFRegionalClient.ts @@ -221,6 +221,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -231,6 +232,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -446,11 +448,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -492,6 +489,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type WAFRegionalClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -500,8 +503,8 @@ export type WAFRegionalClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WAFRegionalClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -509,8 +512,8 @@ export type WAFRegionalClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * @@ -542,16 +545,16 @@ export class WAFRegionalClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-waf-regional/runtimeConfig.browser.ts b/clients/client-waf-regional/runtimeConfig.browser.ts index 2607d15e90996..53e6577de3fd6 100644 --- a/clients/client-waf-regional/runtimeConfig.browser.ts +++ b/clients/client-waf-regional/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-waf-regional/runtimeConfig.native.ts b/clients/client-waf-regional/runtimeConfig.native.ts index ada1c500934c4..bc6f447ea9bea 100644 --- a/clients/client-waf-regional/runtimeConfig.native.ts +++ b/clients/client-waf-regional/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WAFRegionalClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-waf-regional/runtimeConfig.ts b/clients/client-waf-regional/runtimeConfig.ts index 2527c39138444..b4aae97be0bc1 100644 --- a/clients/client-waf-regional/runtimeConfig.ts +++ b/clients/client-waf-regional/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-waf/WAFClient.ts b/clients/client-waf/WAFClient.ts index e42413b835940..99b4786d82d76 100644 --- a/clients/client-waf/WAFClient.ts +++ b/clients/client-waf/WAFClient.ts @@ -211,6 +211,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -221,6 +222,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -428,11 +430,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -474,6 +471,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type WAFClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -482,8 +485,8 @@ export type WAFClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WAFClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -491,8 +494,8 @@ export type WAFClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * @@ -524,16 +527,16 @@ export class WAFClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-waf/runtimeConfig.browser.ts b/clients/client-waf/runtimeConfig.browser.ts index f91cf67d9a882..6320a2adf8c83 100644 --- a/clients/client-waf/runtimeConfig.browser.ts +++ b/clients/client-waf/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-waf/runtimeConfig.native.ts b/clients/client-waf/runtimeConfig.native.ts index 1f15f0fbe641a..c1e3c02236bbe 100644 --- a/clients/client-waf/runtimeConfig.native.ts +++ b/clients/client-waf/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WAFClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-waf/runtimeConfig.ts b/clients/client-waf/runtimeConfig.ts index 2d058499eb910..685211865b97d 100644 --- a/clients/client-waf/runtimeConfig.ts +++ b/clients/client-waf/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-wafv2/WAFV2Client.ts b/clients/client-wafv2/WAFV2Client.ts index 7b291054c4de2..8a1a48d53e730 100644 --- a/clients/client-wafv2/WAFV2Client.ts +++ b/clients/client-wafv2/WAFV2Client.ts @@ -129,6 +129,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -139,6 +140,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -272,11 +274,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -318,6 +315,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type WAFV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -326,8 +329,8 @@ export type WAFV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WAFV2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -335,8 +338,8 @@ export type WAFV2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * @@ -414,16 +417,16 @@ export class WAFV2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-wafv2/runtimeConfig.browser.ts b/clients/client-wafv2/runtimeConfig.browser.ts index d724f23f635dd..78ea50474f8ef 100644 --- a/clients/client-wafv2/runtimeConfig.browser.ts +++ b/clients/client-wafv2/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-wafv2/runtimeConfig.native.ts b/clients/client-wafv2/runtimeConfig.native.ts index 6d4f6ffe94a1b..e8f9e21c4f94f 100644 --- a/clients/client-wafv2/runtimeConfig.native.ts +++ b/clients/client-wafv2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WAFV2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-wafv2/runtimeConfig.ts b/clients/client-wafv2/runtimeConfig.ts index 938f7f6d8979d..89a685ab29857 100644 --- a/clients/client-wafv2/runtimeConfig.ts +++ b/clients/client-wafv2/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-workdocs/WorkDocsClient.ts b/clients/client-workdocs/WorkDocsClient.ts index bceaa86fe5f69..856abfb1912b9 100644 --- a/clients/client-workdocs/WorkDocsClient.ts +++ b/clients/client-workdocs/WorkDocsClient.ts @@ -124,6 +124,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -134,6 +135,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -269,11 +271,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -315,6 +312,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type WorkDocsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -323,8 +326,8 @@ export type WorkDocsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WorkDocsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -332,8 +335,8 @@ export type WorkDocsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The WorkDocs API is designed for the following use cases:

@@ -387,16 +390,16 @@ export class WorkDocsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-workdocs/runtimeConfig.browser.ts b/clients/client-workdocs/runtimeConfig.browser.ts index e20215bf0c639..5754fdb8e48b0 100644 --- a/clients/client-workdocs/runtimeConfig.browser.ts +++ b/clients/client-workdocs/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-workdocs/runtimeConfig.native.ts b/clients/client-workdocs/runtimeConfig.native.ts index 8937246365f1b..5c9b238d1b67c 100644 --- a/clients/client-workdocs/runtimeConfig.native.ts +++ b/clients/client-workdocs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WorkDocsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-workdocs/runtimeConfig.ts b/clients/client-workdocs/runtimeConfig.ts index 458f9b20e533a..48473183c7c2a 100644 --- a/clients/client-workdocs/runtimeConfig.ts +++ b/clients/client-workdocs/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-worklink/WorkLinkClient.ts b/clients/client-worklink/WorkLinkClient.ts index e9ae05b9e611f..d443344bf044a 100644 --- a/clients/client-worklink/WorkLinkClient.ts +++ b/clients/client-worklink/WorkLinkClient.ts @@ -128,6 +128,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -138,6 +139,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -257,11 +259,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -303,6 +300,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type WorkLinkClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -311,8 +314,8 @@ export type WorkLinkClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WorkLinkClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -320,8 +323,8 @@ export type WorkLinkClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon WorkLink is a cloud-based service that provides secure access @@ -349,16 +352,16 @@ export class WorkLinkClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-worklink/runtimeConfig.browser.ts b/clients/client-worklink/runtimeConfig.browser.ts index 25670e2c8ea0e..663f07a10d948 100644 --- a/clients/client-worklink/runtimeConfig.browser.ts +++ b/clients/client-worklink/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-worklink/runtimeConfig.native.ts b/clients/client-worklink/runtimeConfig.native.ts index abcc18ec5e853..b34e35b0027f8 100644 --- a/clients/client-worklink/runtimeConfig.native.ts +++ b/clients/client-worklink/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WorkLinkClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-worklink/runtimeConfig.ts b/clients/client-worklink/runtimeConfig.ts index 5d88e326f001f..803f7ec2bccfb 100644 --- a/clients/client-worklink/runtimeConfig.ts +++ b/clients/client-worklink/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-workmail/WorkMailClient.ts b/clients/client-workmail/WorkMailClient.ts index a574302885f7b..4663d71689960 100644 --- a/clients/client-workmail/WorkMailClient.ts +++ b/clients/client-workmail/WorkMailClient.ts @@ -101,6 +101,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -111,6 +112,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -230,11 +232,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -276,6 +273,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type WorkMailClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -284,8 +287,8 @@ export type WorkMailClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WorkMailClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -293,8 +296,8 @@ export type WorkMailClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon WorkMail is a secure, managed business email and calendaring service with support for @@ -350,16 +353,16 @@ export class WorkMailClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-workmail/runtimeConfig.browser.ts b/clients/client-workmail/runtimeConfig.browser.ts index 3e89fe07279bd..de4422b136f35 100644 --- a/clients/client-workmail/runtimeConfig.browser.ts +++ b/clients/client-workmail/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-workmail/runtimeConfig.native.ts b/clients/client-workmail/runtimeConfig.native.ts index 267f6a91b508a..c4a1cc49ca210 100644 --- a/clients/client-workmail/runtimeConfig.native.ts +++ b/clients/client-workmail/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WorkMailClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-workmail/runtimeConfig.ts b/clients/client-workmail/runtimeConfig.ts index c7312806cff04..730636127777a 100644 --- a/clients/client-workmail/runtimeConfig.ts +++ b/clients/client-workmail/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-workmailmessageflow/WorkMailMessageFlowClient.ts b/clients/client-workmailmessageflow/WorkMailMessageFlowClient.ts index 909297966bd5c..a466a2ab9bc8a 100644 --- a/clients/client-workmailmessageflow/WorkMailMessageFlowClient.ts +++ b/clients/client-workmailmessageflow/WorkMailMessageFlowClient.ts @@ -39,6 +39,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -49,6 +50,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GetRawMessageContentCommandInput; @@ -102,11 +104,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -148,6 +145,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type WorkMailMessageFlowClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -156,8 +159,8 @@ export type WorkMailMessageFlowClientConfig = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WorkMailMessageFlowClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -165,8 +168,8 @@ export type WorkMailMessageFlowClientResolvedConfig = __SmithyResolvedConfigurat EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The WorkMail Message Flow API provides access to email messages as they are @@ -192,16 +195,16 @@ export class WorkMailMessageFlowClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-workmailmessageflow/runtimeConfig.browser.ts b/clients/client-workmailmessageflow/runtimeConfig.browser.ts index 3455971ed8e0e..08dd2fc81b765 100644 --- a/clients/client-workmailmessageflow/runtimeConfig.browser.ts +++ b/clients/client-workmailmessageflow/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-workmailmessageflow/runtimeConfig.native.ts b/clients/client-workmailmessageflow/runtimeConfig.native.ts index 80b3d31ae9176..a7338b76ceaa0 100644 --- a/clients/client-workmailmessageflow/runtimeConfig.native.ts +++ b/clients/client-workmailmessageflow/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WorkMailMessageFlowClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-workmailmessageflow/runtimeConfig.ts b/clients/client-workmailmessageflow/runtimeConfig.ts index f3a1a8530e1bc..4e9d7f9e77f4c 100644 --- a/clients/client-workmailmessageflow/runtimeConfig.ts +++ b/clients/client-workmailmessageflow/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-workspaces/WorkSpacesClient.ts b/clients/client-workspaces/WorkSpacesClient.ts index 312aa21640226..91950442ae6db 100644 --- a/clients/client-workspaces/WorkSpacesClient.ts +++ b/clients/client-workspaces/WorkSpacesClient.ts @@ -175,6 +175,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -185,6 +186,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -338,11 +340,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -384,6 +381,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type WorkSpacesClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -392,8 +395,8 @@ export type WorkSpacesClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WorkSpacesClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -401,8 +404,8 @@ export type WorkSpacesClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon WorkSpaces Service @@ -426,16 +429,16 @@ export class WorkSpacesClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-workspaces/runtimeConfig.browser.ts b/clients/client-workspaces/runtimeConfig.browser.ts index df2b7c8083d0b..f2d8015ebb6d8 100644 --- a/clients/client-workspaces/runtimeConfig.browser.ts +++ b/clients/client-workspaces/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-workspaces/runtimeConfig.native.ts b/clients/client-workspaces/runtimeConfig.native.ts index cdc750bee2628..cbd244f45cc81 100644 --- a/clients/client-workspaces/runtimeConfig.native.ts +++ b/clients/client-workspaces/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WorkSpacesClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-workspaces/runtimeConfig.ts b/clients/client-workspaces/runtimeConfig.ts index a92d954a69606..4bf4a2c635747 100644 --- a/clients/client-workspaces/runtimeConfig.ts +++ b/clients/client-workspaces/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-xray/XRayClient.ts b/clients/client-xray/XRayClient.ts index fec4ca2d5183f..b5fcaf72dfbbf 100644 --- a/clients/client-xray/XRayClient.ts +++ b/clients/client-xray/XRayClient.ts @@ -86,6 +86,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -96,6 +97,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -203,11 +205,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -249,6 +246,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type XRayClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -257,8 +260,8 @@ export type XRayClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOption EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type XRayClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -266,8 +269,8 @@ export type XRayClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandl EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS X-Ray provides APIs for managing debug traces and retrieving service maps @@ -290,16 +293,16 @@ export class XRayClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-xray/runtimeConfig.browser.ts b/clients/client-xray/runtimeConfig.browser.ts index 79d9cf6f79af8..fab31f3395645 100644 --- a/clients/client-xray/runtimeConfig.browser.ts +++ b/clients/client-xray/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-xray/runtimeConfig.native.ts b/clients/client-xray/runtimeConfig.native.ts index 98479b6c516da..3bae662eef742 100644 --- a/clients/client-xray/runtimeConfig.native.ts +++ b/clients/client-xray/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./XRayClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-xray/runtimeConfig.ts b/clients/client-xray/runtimeConfig.ts index 513597ae3219f..eb7fd3d789e48 100644 --- a/clients/client-xray/runtimeConfig.ts +++ b/clients/client-xray/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/protocol_tests/aws-ec2/EC2ProtocolClient.ts b/protocol_tests/aws-ec2/EC2ProtocolClient.ts index a7150d12dfbcf..fb126aa5e50e7 100644 --- a/protocol_tests/aws-ec2/EC2ProtocolClient.ts +++ b/protocol_tests/aws-ec2/EC2ProtocolClient.ts @@ -65,6 +65,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -75,6 +76,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -164,11 +166,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -210,6 +207,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type EC2ProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -218,8 +221,8 @@ export type EC2ProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EC2ProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -227,8 +230,8 @@ export type EC2ProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * An EC2 query service that sends query requests and XML responses. @@ -250,16 +253,16 @@ export class EC2ProtocolClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/protocol_tests/aws-ec2/runtimeConfig.browser.ts b/protocol_tests/aws-ec2/runtimeConfig.browser.ts index 6f536157708ec..0d58d1320614d 100644 --- a/protocol_tests/aws-ec2/runtimeConfig.browser.ts +++ b/protocol_tests/aws-ec2/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/protocol_tests/aws-ec2/runtimeConfig.native.ts b/protocol_tests/aws-ec2/runtimeConfig.native.ts index e260a640a0686..c2c8364ec2831 100644 --- a/protocol_tests/aws-ec2/runtimeConfig.native.ts +++ b/protocol_tests/aws-ec2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EC2ProtocolClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/protocol_tests/aws-ec2/runtimeConfig.ts b/protocol_tests/aws-ec2/runtimeConfig.ts index ae050c8c75f8e..6e9a4eb636a29 100644 --- a/protocol_tests/aws-ec2/runtimeConfig.ts +++ b/protocol_tests/aws-ec2/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/protocol_tests/aws-json/JsonProtocolClient.ts b/protocol_tests/aws-json/JsonProtocolClient.ts index 3bfeb87c27bad..44d0663f79552 100644 --- a/protocol_tests/aws-json/JsonProtocolClient.ts +++ b/protocol_tests/aws-json/JsonProtocolClient.ts @@ -52,6 +52,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -62,6 +63,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -131,11 +133,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -177,6 +174,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type JsonProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -185,8 +188,8 @@ export type JsonProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type JsonProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -194,8 +197,8 @@ export type JsonProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; export class JsonProtocolClient extends __Client< __HttpHandlerOptions, @@ -214,16 +217,16 @@ export class JsonProtocolClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/protocol_tests/aws-json/runtimeConfig.browser.ts b/protocol_tests/aws-json/runtimeConfig.browser.ts index 495f92be689ea..3efd7bc8a34cf 100644 --- a/protocol_tests/aws-json/runtimeConfig.browser.ts +++ b/protocol_tests/aws-json/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/protocol_tests/aws-json/runtimeConfig.native.ts b/protocol_tests/aws-json/runtimeConfig.native.ts index eecffc6983a39..b83f7ca69972b 100644 --- a/protocol_tests/aws-json/runtimeConfig.native.ts +++ b/protocol_tests/aws-json/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./JsonProtocolClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/protocol_tests/aws-json/runtimeConfig.ts b/protocol_tests/aws-json/runtimeConfig.ts index 312ebcb617713..4bcf61bdf302e 100644 --- a/protocol_tests/aws-json/runtimeConfig.ts +++ b/protocol_tests/aws-json/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/protocol_tests/aws-query/QueryProtocolClient.ts b/protocol_tests/aws-query/QueryProtocolClient.ts index 185f8575e9e19..d451893b02aef 100644 --- a/protocol_tests/aws-query/QueryProtocolClient.ts +++ b/protocol_tests/aws-query/QueryProtocolClient.ts @@ -79,6 +79,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -89,6 +90,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -194,11 +196,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -240,6 +237,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type QueryProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -248,8 +251,8 @@ export type QueryProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type QueryProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -257,8 +260,8 @@ export type QueryProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * A query service that sends query requests and XML responses. @@ -280,16 +283,16 @@ export class QueryProtocolClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/protocol_tests/aws-query/runtimeConfig.browser.ts b/protocol_tests/aws-query/runtimeConfig.browser.ts index 8e70f36a301c7..854caebc955aa 100644 --- a/protocol_tests/aws-query/runtimeConfig.browser.ts +++ b/protocol_tests/aws-query/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/protocol_tests/aws-query/runtimeConfig.native.ts b/protocol_tests/aws-query/runtimeConfig.native.ts index 819b612eaeee6..b4506d8969582 100644 --- a/protocol_tests/aws-query/runtimeConfig.native.ts +++ b/protocol_tests/aws-query/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./QueryProtocolClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/protocol_tests/aws-query/runtimeConfig.ts b/protocol_tests/aws-query/runtimeConfig.ts index b3943e52edade..682eee7ac2d08 100644 --- a/protocol_tests/aws-query/runtimeConfig.ts +++ b/protocol_tests/aws-query/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/protocol_tests/aws-restjson/RestJsonProtocolClient.ts b/protocol_tests/aws-restjson/RestJsonProtocolClient.ts index 39efc20e8bbbb..d448a3108373e 100644 --- a/protocol_tests/aws-restjson/RestJsonProtocolClient.ts +++ b/protocol_tests/aws-restjson/RestJsonProtocolClient.ts @@ -135,6 +135,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -145,6 +146,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -272,11 +274,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -318,6 +315,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type RestJsonProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -326,8 +329,8 @@ export type RestJsonProtocolClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RestJsonProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -335,8 +338,8 @@ export type RestJsonProtocolClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * A REST JSON service that sends JSON requests and responses. @@ -358,16 +361,16 @@ export class RestJsonProtocolClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/protocol_tests/aws-restjson/runtimeConfig.browser.ts b/protocol_tests/aws-restjson/runtimeConfig.browser.ts index 5f24183b0bc2c..dd586f92ed3ca 100644 --- a/protocol_tests/aws-restjson/runtimeConfig.browser.ts +++ b/protocol_tests/aws-restjson/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/protocol_tests/aws-restjson/runtimeConfig.native.ts b/protocol_tests/aws-restjson/runtimeConfig.native.ts index 98a833d6c3195..b3086035d8293 100644 --- a/protocol_tests/aws-restjson/runtimeConfig.native.ts +++ b/protocol_tests/aws-restjson/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RestJsonProtocolClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/protocol_tests/aws-restjson/runtimeConfig.ts b/protocol_tests/aws-restjson/runtimeConfig.ts index 83527f829a8b2..afe44fe761e12 100644 --- a/protocol_tests/aws-restjson/runtimeConfig.ts +++ b/protocol_tests/aws-restjson/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/protocol_tests/aws-restxml/RestXmlProtocolClient.ts b/protocol_tests/aws-restxml/RestXmlProtocolClient.ts index 9c2d8d44418e1..b02d95e6aa4d8 100644 --- a/protocol_tests/aws-restxml/RestXmlProtocolClient.ts +++ b/protocol_tests/aws-restxml/RestXmlProtocolClient.ts @@ -147,6 +147,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -157,6 +158,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -296,11 +298,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -342,6 +339,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type RestXmlProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -350,8 +353,8 @@ export type RestXmlProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RestXmlProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -359,8 +362,8 @@ export type RestXmlProtocolClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * A REST XML service that sends XML requests and responses. @@ -382,16 +385,16 @@ export class RestXmlProtocolClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/protocol_tests/aws-restxml/runtimeConfig.browser.ts b/protocol_tests/aws-restxml/runtimeConfig.browser.ts index fa5b8050b0f15..fbb3e306ed3ba 100644 --- a/protocol_tests/aws-restxml/runtimeConfig.browser.ts +++ b/protocol_tests/aws-restxml/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/protocol_tests/aws-restxml/runtimeConfig.native.ts b/protocol_tests/aws-restxml/runtimeConfig.native.ts index ec7124e99904f..cf729595d6e3a 100644 --- a/protocol_tests/aws-restxml/runtimeConfig.native.ts +++ b/protocol_tests/aws-restxml/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RestXmlProtocolClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/protocol_tests/aws-restxml/runtimeConfig.ts b/protocol_tests/aws-restxml/runtimeConfig.ts index 4a3c657f26d1d..e831beae8e649 100644 --- a/protocol_tests/aws-restxml/runtimeConfig.ts +++ b/protocol_tests/aws-restxml/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(),