-
Notifications
You must be signed in to change notification settings - Fork 2.1k
private/model/api: adding timestampFormat #2066
Conversation
"BlobArgs": { | ||
"shape": "BlobsType" | ||
} | ||
"BlobArgs": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tab/spaces are off.
@@ -233,7 +233,14 @@ func (q *queryParser) parseScalar(v url.Values, r reflect.Value, name string, ta | |||
v.Set(name, strconv.FormatFloat(float64(value), 'f', -1, 32)) | |||
case time.Time: | |||
const ISO8601UTC = "2006-01-02T15:04:05Z" | |||
v.Set(name, value.UTC().Format(ISO8601UTC)) | |||
// Query ignores "defaultTimestampFormat" as that tag only | |||
// applies to structured payload body values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this comment is valid anymore
private/protocol/rest/build.go
Outdated
@@ -272,7 +267,16 @@ func convertType(v reflect.Value, tag reflect.StructTag) (str string, err error) | |||
case float64: | |||
str = strconv.FormatFloat(value, 'f', -1, 64) | |||
case time.Time: | |||
str = value.UTC().Format(RFC1123GMT) | |||
// REST ignores "defaultTimestampFormat" as that tag only | |||
// applies to structured payload body values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this comment is valid anymore
private/protocol/rest/unmarshal.go
Outdated
@@ -198,7 +198,13 @@ func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) erro | |||
} | |||
v.Set(reflect.ValueOf(&f)) | |||
case *time.Time: | |||
t, err := time.Parse(time.RFC1123, header) | |||
// REST ignores "defaultTimestampFormat" as that tag only | |||
// applies to strucutred payload body values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this comment is valid anymore
private/protocol/timestamp.go
Outdated
case ISO8601TimeFormatName: | ||
str = t.Format(ISO8601TimeFormat) | ||
case UnixTimeFormatName: | ||
str = strconv.FormatInt(t.Unix(), 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit would prefer these cases all return their string since the str
var isn't being used other than return a value.
* adding support for timestampFormat * regenerating services * Adding enums back * fixing gofmt
* adding support for timestampFormat * regenerating services * Adding enums back * fixing gofmt
Adds support for the timestampForamt API model trait to the V2 SDK. The SDK will now generate API client parameters with the correct time format for APIs modeled with custom time stamp formats specified. V2 Port of aws/aws-sdk-go#2066 Fix #202 Fix #286
No description provided.