Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update quickstart example models to match new quickstart example syntax #76

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions quickstart-examples/integ/expected-model.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
"target": "example.weather#CityId"
}
},
"properties": {
"coordinates": {
"target": "example.weather#CityCoordinates"
}
},
"read": {
"target": "example.weather#GetCity"
},
Expand Down Expand Up @@ -80,6 +85,11 @@
"target": "example.weather#CityId"
}
},
"properties": {
"chanceOfRain": {
"target": "smithy.api#Float"
}
},
"read": {
"target": "example.weather#GetForecast"
}
Expand Down Expand Up @@ -121,6 +131,7 @@
"name": {
"target": "smithy.api#String",
"traits": {
"smithy.api#notProperty": {},
"smithy.api#required": {}
}
},
Expand Down
37 changes: 23 additions & 14 deletions quickstart-examples/quickstart-cli/models/weather.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,27 @@ namespace example.weather
@paginated(inputToken: "nextToken", outputToken: "nextToken", pageSize: "pageSize")
service Weather {
version: "2006-03-01"
resources: [City]
operations: [GetCurrentTime]
resources: [
City
]
operations: [
GetCurrentTime
]
}

resource City {
identifiers: {cityId: CityId}
identifiers: { cityId: CityId }
properties: { coordinates: CityCoordinates }
read: GetCity
list: ListCities
resources: [Forecast]
resources: [
Forecast
]
}

resource Forecast {
identifiers: {cityId: CityId}
identifiers: { cityId: CityId }
properties: { chanceOfRain: Float }
read: GetForecast
}

Expand All @@ -35,14 +43,15 @@ operation GetCity {
$cityId
}

output := {
output := for City {
// "required" is used on output to indicate if the service
// will always provide a value for the member.
@required
@notProperty
name: String

@required
coordinates: CityCoordinates
$coordinates
}

errors: [
Expand Down Expand Up @@ -91,11 +100,11 @@ list CitySummaries {
}

// CitySummary contains a reference to a City.
@references(
[
{resource: City}
]
)
@references([
{
resource: City
}
])
structure CitySummary {
@required
cityId: CityId
Expand All @@ -121,7 +130,7 @@ operation GetForecast {
$cityId
}

output := {
chanceOfRain: Float
output := for Forecast {
$chanceOfRain
}
}
37 changes: 23 additions & 14 deletions quickstart-examples/quickstart-gradle/models/weather.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,27 @@ namespace example.weather
@paginated(inputToken: "nextToken", outputToken: "nextToken", pageSize: "pageSize")
service Weather {
version: "2006-03-01"
resources: [City]
operations: [GetCurrentTime]
resources: [
City
]
operations: [
GetCurrentTime
]
}

resource City {
identifiers: {cityId: CityId}
identifiers: { cityId: CityId }
properties: { coordinates: CityCoordinates }
read: GetCity
list: ListCities
resources: [Forecast]
resources: [
Forecast
]
}

resource Forecast {
identifiers: {cityId: CityId}
identifiers: { cityId: CityId }
properties: { chanceOfRain: Float }
read: GetForecast
}

Expand All @@ -35,14 +43,15 @@ operation GetCity {
$cityId
}

output := {
output := for City {
// "required" is used on output to indicate if the service
// will always provide a value for the member.
@required
@notProperty
name: String

@required
coordinates: CityCoordinates
$coordinates
}

errors: [
Expand Down Expand Up @@ -91,11 +100,11 @@ list CitySummaries {
}

// CitySummary contains a reference to a City.
@references(
[
{resource: City}
]
)
@references([
{
resource: City
}
])
structure CitySummary {
@required
cityId: CityId
Expand All @@ -121,7 +130,7 @@ operation GetForecast {
$cityId
}

output := {
chanceOfRain: Float
output := for Forecast {
$chanceOfRain
}
}
Loading