Skip to content

Commit

Permalink
Merge branch 'main' into fix/set-unmarshaling
Browse files Browse the repository at this point in the history
  • Loading branch information
AnatolyRugalev authored Dec 6, 2024
2 parents 4f5ea85 + ffbc1df commit bbbaccd
Show file tree
Hide file tree
Showing 3,675 changed files with 660,557 additions and 89,206 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
302 changes: 302 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aws/go_module_metadata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion aws/middleware/user_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ const (
FeatureMetadata2
)

// Hardcoded value to specify which version of the user agent we're using
const uaMetadata = "ua/2.1"

func (k SDKAgentKeyType) string() string {
switch k {
case APIMetadata:
Expand Down Expand Up @@ -107,6 +110,7 @@ type RequestUserAgent struct {
func NewRequestUserAgent() *RequestUserAgent {
userAgent, sdkAgent := smithyhttp.NewUserAgentBuilder(), smithyhttp.NewUserAgentBuilder()
addProductName(userAgent)
addUserAgentMetadata(userAgent)
addProductName(sdkAgent)

r := &RequestUserAgent{
Expand Down Expand Up @@ -134,6 +138,10 @@ func addProductName(builder *smithyhttp.UserAgentBuilder) {
builder.AddKeyValue(aws.SDKName, aws.SDKVersion)
}

func addUserAgentMetadata(builder *smithyhttp.UserAgentBuilder) {
builder.AddKey(uaMetadata)
}

// AddUserAgentKey retrieves a requestUserAgent from the provided stack, or initializes one.
func AddUserAgentKey(key string) func(*middleware.Stack) error {
return func(stack *middleware.Stack) error {
Expand Down Expand Up @@ -258,10 +266,10 @@ func (u *RequestUserAgent) HandleBuild(ctx context.Context, in middleware.BuildI

func (u *RequestUserAgent) addHTTPUserAgent(request *smithyhttp.Request) {
const userAgent = "User-Agent"
updateHTTPHeader(request, userAgent, u.userAgent.Build())
if len(u.features) > 0 {
updateHTTPHeader(request, userAgent, buildFeatureMetrics(u.features))
}
updateHTTPHeader(request, userAgent, u.userAgent.Build())
}

func (u *RequestUserAgent) addHTTPSDKAgent(request *smithyhttp.Request) {
Expand Down
7 changes: 4 additions & 3 deletions aws/middleware/user_agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
)

var expectedAgent = aws.SDKName + "/" + aws.SDKVersion +
" ua/2.1" +
" os/" + getNormalizedOSName() +
" lang/go#" + strings.Map(rules, languageVersion) + // normalize as the user-agent builder will
" md/GOOS#" + runtime.GOOS +
Expand Down Expand Up @@ -251,15 +252,15 @@ func TestAddUserAgentFeature(t *testing.T) {
Features: []UserAgentFeature{
UserAgentFeatureWaiter,
},
Expect: "m/B " + expectedAgent,
Expect: expectedAgent + " " + "m/B",
},
"two": {
Features: []UserAgentFeature{
UserAgentFeatureRetryModeAdaptive, // ensure stable order, and idempotent
UserAgentFeatureRetryModeAdaptive,
UserAgentFeatureWaiter,
},
Expect: "m/B,F " + expectedAgent,
Expect: expectedAgent + " " + "m/B,F",
},
}

Expand Down Expand Up @@ -403,7 +404,7 @@ func TestAddSDKAgentKeyValue(t *testing.T) {
t.Fatalf("expect User-Agent to be present")
}
if ua[0] != c.Expect {
t.Errorf("User-Agent: %q != %q", c.Expect, ua[0])
t.Errorf("User-Agent: expected %q != actual %q", c.Expect, ua[0])
}
})
}
Expand Down
445 changes: 439 additions & 6 deletions codegen/sdk-codegen/aws-models/api-gateway.json

Large diffs are not rendered by default.

606 changes: 605 additions & 1 deletion codegen/sdk-codegen/aws-models/application-auto-scaling.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions codegen/sdk-codegen/aws-models/appsync.json
Original file line number Diff line number Diff line change
Expand Up @@ -3881,6 +3881,12 @@
"traits": {
"smithy.api#enumValue": "AMAZON_EVENTBRIDGE"
}
},
"AMAZON_BEDROCK_RUNTIME": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "AMAZON_BEDROCK_RUNTIME"
}
}
}
},
Expand Down
259 changes: 250 additions & 9 deletions codegen/sdk-codegen/aws-models/athena.json

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions codegen/sdk-codegen/aws-models/auto-scaling.json
Original file line number Diff line number Diff line change
Expand Up @@ -3571,6 +3571,12 @@
"smithy.api#documentation": "<p>The unit of the metric. For a complete list of the units that CloudWatch supports, see the\n <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html\">MetricDatum</a>\n data type in the <i>Amazon CloudWatch API Reference</i>.</p>"
}
},
"Period": {
"target": "com.amazonaws.autoscaling#MetricGranularityInSeconds",
"traits": {
"smithy.api#documentation": "<p>\n The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see\n <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy-creating-high-resolution-metrics.html\">Create a target tracking policy using high-resolution metrics for faster response</a>.\n </p>"
}
},
"Metrics": {
"target": "com.amazonaws.autoscaling#TargetTrackingMetricDataQueries",
"traits": {
Expand Down Expand Up @@ -8151,6 +8157,14 @@
"target": "com.amazonaws.autoscaling#MetricDimension"
}
},
"com.amazonaws.autoscaling#MetricGranularityInSeconds": {
"type": "integer",
"traits": {
"smithy.api#range": {
"min": 1
}
}
},
"com.amazonaws.autoscaling#MetricGranularityType": {
"type": "structure",
"members": {
Expand Down Expand Up @@ -10859,6 +10873,12 @@
"smithy.api#documentation": "<p>A human-readable label for this metric or expression. This is especially useful if\n this is a math expression, so that you know what the value represents.</p>"
}
},
"Period": {
"target": "com.amazonaws.autoscaling#MetricGranularityInSeconds",
"traits": {
"smithy.api#documentation": "<p>\n The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see\n <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy-creating-high-resolution-metrics.html\">Create a target tracking policy using high-resolution metrics for faster response</a>.\n </p>"
}
},
"ReturnData": {
"target": "com.amazonaws.autoscaling#ReturnData",
"traits": {
Expand Down Expand Up @@ -10894,6 +10914,12 @@
"traits": {
"smithy.api#documentation": "<p>The unit to use for the returned data points. For a complete list of the units that\n CloudWatch supports, see the <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html\">MetricDatum</a>\n data type in the <i>Amazon CloudWatch API Reference</i>.</p>"
}
},
"Period": {
"target": "com.amazonaws.autoscaling#MetricGranularityInSeconds",
"traits": {
"smithy.api#documentation": "<p>\n The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see\n <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy-creating-high-resolution-metrics.html\">Create a target tracking policy using high-resolution metrics for faster response</a>.\n </p>"
}
}
},
"traits": {
Expand Down
Loading

0 comments on commit bbbaccd

Please sign in to comment.