Skip to content

Commit

Permalink
Update new protocol tests to use shared types instead
Browse files Browse the repository at this point in the history
  • Loading branch information
ianbotsf authored and JordonPhillips committed Nov 10, 2022
1 parent 206a1ea commit f12a737
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 48 deletions.
18 changes: 6 additions & 12 deletions smithy-aws-protocol-tests/model/awsQuery/xml-structs.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ $version: "2.0"
namespace aws.protocoltests.query

use aws.protocols#awsQuery
use aws.protocoltests.shared#DateTime
use aws.protocoltests.shared#EpochSeconds
use aws.protocoltests.shared#FooEnum
use aws.protocoltests.shared#FooEnumList
use aws.protocoltests.shared#FooEnumSet
use aws.protocoltests.shared#FooEnumMap
use aws.protocoltests.shared#HttpDate
use smithy.test#httpResponseTests

// This example serializes simple scalar types in the top level XML document.
Expand Down Expand Up @@ -372,32 +375,23 @@ apply XmlTimestamps @httpResponseTests([
},
])

@timestampFormat("date-time")
timestamp DateTimeTimestamp

@timestampFormat("epoch-seconds")
timestamp EpochSecondsTimestamp

@timestampFormat("http-date")
timestamp HttpDateTimestamp

structure XmlTimestampsOutput {
normal: Timestamp,

@timestampFormat("date-time")
dateTime: Timestamp,

dateTimeOnTarget: DateTimeTimestamp,
dateTimeOnTarget: DateTime,

@timestampFormat("epoch-seconds")
epochSeconds: Timestamp,

epochSecondsOnTarget: EpochSecondsTimestamp,
epochSecondsOnTarget: EpochSeconds,

@timestampFormat("http-date")
httpDate: Timestamp,

httpDateOnTarget: HttpDateTimestamp,
httpDateOnTarget: HttpDate,
}

/// This example serializes enums as top level properties, in lists, sets, and maps.
Expand Down
18 changes: 6 additions & 12 deletions smithy-aws-protocol-tests/model/ec2Query/xml-structs.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ namespace aws.protocoltests.ec2

use aws.protocols#ec2QueryName
use aws.protocols#ec2Query
use aws.protocoltests.shared#DateTime
use aws.protocoltests.shared#EpochSeconds
use aws.protocoltests.shared#FooEnum
use aws.protocoltests.shared#FooEnumList
use aws.protocoltests.shared#FooEnumSet
use aws.protocoltests.shared#FooEnumMap
use aws.protocoltests.shared#HttpDate
use smithy.test#httpResponseTests

// This example serializes simple scalar types in the top level XML document.
Expand Down Expand Up @@ -359,32 +362,23 @@ apply XmlTimestamps @httpResponseTests([
},
])

@timestampFormat("date-time")
timestamp DateTimeTimestamp

@timestampFormat("epoch-seconds")
timestamp EpochSecondsTimestamp

@timestampFormat("http-date")
timestamp HttpDateTimestamp

structure XmlTimestampsOutput {
normal: Timestamp,

@timestampFormat("date-time")
dateTime: Timestamp,

dateTimeOnTarget: DateTimeTimestamp,
dateTimeOnTarget: DateTime,

@timestampFormat("epoch-seconds")
epochSeconds: Timestamp,

epochSecondsOnTarget: EpochSecondsTimestamp,
epochSecondsOnTarget: EpochSeconds,

@timestampFormat("http-date")
httpDate: Timestamp,

httpDateOnTarget: HttpDateTimestamp,
httpDateOnTarget: HttpDate,
}

/// This example serializes enums as top level properties, in lists, sets, and maps.
Expand Down
18 changes: 6 additions & 12 deletions smithy-aws-protocol-tests/model/restJson1/json-structs.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ $version: "2.0"
namespace aws.protocoltests.restjson

use aws.protocols#restJson1
use aws.protocoltests.shared#DateTime
use aws.protocoltests.shared#EpochSeconds
use aws.protocoltests.shared#FooEnum
use aws.protocoltests.shared#FooEnumList
use aws.protocoltests.shared#FooEnumSet
use aws.protocoltests.shared#FooEnumMap
use aws.protocoltests.shared#HttpDate
use smithy.test#httpRequestTests
use smithy.test#httpResponseTests

Expand Down Expand Up @@ -609,32 +612,23 @@ apply JsonTimestamps @httpResponseTests([
},
])

@timestampFormat("date-time")
timestamp DateTimeTimestamp

@timestampFormat("epoch-seconds")
timestamp EpochSecondsTimestamp

@timestampFormat("http-date")
timestamp HttpDateTimestamp

structure JsonTimestampsInputOutput {
normal: Timestamp,

@timestampFormat("date-time")
dateTime: Timestamp,

dateTimeOnTarget: DateTimeTimestamp,
dateTimeOnTarget: DateTime,

@timestampFormat("epoch-seconds")
epochSeconds: Timestamp,

epochSecondsOnTarget: EpochSecondsTimestamp,
epochSecondsOnTarget: EpochSeconds,

@timestampFormat("http-date")
httpDate: Timestamp,

httpDateOnTarget: HttpDateTimestamp,
httpDateOnTarget: HttpDate,
}

/// This example serializes enums as top level properties, in lists, sets, and maps.
Expand Down
18 changes: 6 additions & 12 deletions smithy-aws-protocol-tests/model/restXml/document-structs.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ $version: "2.0"
namespace aws.protocoltests.restxml

use aws.protocols#restXml
use aws.protocoltests.shared#DateTime
use aws.protocoltests.shared#EpochSeconds
use aws.protocoltests.shared#FooEnum
use aws.protocoltests.shared#FooEnumList
use aws.protocoltests.shared#FooEnumSet
use aws.protocoltests.shared#FooEnumMap
use aws.protocoltests.shared#HttpDate
use smithy.test#httpRequestTests
use smithy.test#httpResponseTests

Expand Down Expand Up @@ -871,32 +874,23 @@ apply XmlTimestamps @httpResponseTests([
},
])

@timestampFormat("date-time")
timestamp DateTimeTimestamp

@timestampFormat("epoch-seconds")
timestamp EpochSecondsTimestamp

@timestampFormat("http-date")
timestamp HttpDateTimestamp

structure XmlTimestampsInputOutput {
normal: Timestamp,

@timestampFormat("date-time")
dateTime: Timestamp,

dateTimeOnTarget: DateTimeTimestamp,
dateTimeOnTarget: DateTime,

@timestampFormat("epoch-seconds")
epochSeconds: Timestamp,

epochSecondsOnTarget: EpochSecondsTimestamp,
epochSecondsOnTarget: EpochSeconds,

@timestampFormat("http-date")
httpDate: Timestamp,

httpDateOnTarget: HttpDateTimestamp,
httpDateOnTarget: HttpDate,
}

/// This example serializes enums as top level properties, in lists, sets, and maps.
Expand Down

0 comments on commit f12a737

Please sign in to comment.