forked from smithy-lang/smithy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add extra event id subparts to ClientEndpointDiscovery
- Loading branch information
Showing
6 changed files
with
178 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...oftware/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/endpoint-error.errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[DANGER] ns.foo#FooService: Services SHOULD define an error which indicates an endpoint is invalid. | ClientEndpointDiscovery | ||
[DANGER] ns.foo#FooService: Services SHOULD define an error which indicates an endpoint is invalid. | ClientEndpointDiscovery.MissingErrorDefinition | ||
[ERROR] ns.foo#GetObject: The operation `ns.foo#GetObject` is marked with `aws.api#clientDiscoveredEndpoint` and is bound to the service `ns.foo#BarService` but does not have the required error `ns.foo#InvalidEndpointError`. | ClientEndpointDiscovery |
1 change: 1 addition & 0 deletions
1
...software/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/no-operations.errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[WARNING] ns.foo#BazService: The service `ns.foo#BazService` is configured to use endpoint discovery, but has no operations bound with the `aws.api#clientDiscoveredEndpoint` trait. | ClientEndpointDiscovery.NoOperations |
66 changes: 66 additions & 0 deletions
66
...software/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/no-operations.smithy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
$version: "2.0" | ||
|
||
namespace ns.foo | ||
|
||
use aws.api#clientEndpointDiscovery | ||
use aws.api#clientDiscoveredEndpoint | ||
|
||
@clientEndpointDiscovery( | ||
operation: DescribeEndpoints, | ||
error: InvalidEndpointError, | ||
) | ||
service BazService { | ||
version: "2021-06-29", | ||
operations: [DescribeEndpoints, GetObjectWithEndpointError], | ||
} | ||
|
||
operation DescribeEndpoints { | ||
input: DescribeEndpointsInput, | ||
output: DescribeEndpointsOutput, | ||
} | ||
|
||
@input | ||
structure DescribeEndpointsInput { | ||
Operation: String, | ||
Identifiers: Identifiers, | ||
} | ||
|
||
map Identifiers { | ||
key: String, | ||
value: String, | ||
} | ||
|
||
@output | ||
structure DescribeEndpointsOutput { | ||
Endpoints: Endpoints, | ||
} | ||
|
||
list Endpoints { | ||
member: Endpoint, | ||
} | ||
|
||
structure Endpoint { | ||
Address: String, | ||
CachePeriodInMinutes: Long, | ||
} | ||
|
||
operation GetObjectWithEndpointError { | ||
input: GetObjectWithEndpointErrorInput, | ||
output: GetObjectWithEndpointErrorOutput, | ||
errors: [InvalidEndpointError], | ||
} | ||
|
||
@input | ||
structure GetObjectWithEndpointErrorInput { | ||
@required | ||
Id: String, | ||
} | ||
|
||
@output | ||
structure GetObjectWithEndpointErrorOutput { | ||
Object: Blob, | ||
} | ||
|
||
@error("client") | ||
@httpError(421) | ||
structure InvalidEndpointError {} |
2 changes: 2 additions & 0 deletions
2
...are/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/unbound-operations.errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[ERROR] ns.foo#GetObject: The operation `ns.foo#GetObject` is marked with `aws.api#clientDiscoveredEndpoint` and is bound to the service `ns.foo#BarService` but does not have the required error `ns.foo#InvalidEndpointError`. | ClientEndpointDiscovery | ||
[ERROR] ns.foo#BarService: The operation `ns.foo#DescribeEndpoints` must be bound to the service `(service: `ns.foo#BarService`)` to use it as the endpoint operation. | ClientEndpointDiscovery.UnboundOperation.DescribeEndpoints |
97 changes: 97 additions & 0 deletions
97
...are/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/unbound-operations.smithy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
$version: "2.0" | ||
|
||
namespace ns.foo | ||
|
||
use aws.api#clientEndpointDiscovery | ||
use aws.api#clientDiscoveredEndpoint | ||
|
||
// This DOES have an error, but it's not bound to the operations. This should | ||
// result in an ERROR. | ||
@clientEndpointDiscovery( | ||
operation: DescribeEndpoints, | ||
error: InvalidEndpointError, | ||
) | ||
service BarService { | ||
version: "2021-06-29", | ||
operations: [GetObject], | ||
} | ||
|
||
// This DOES have an error, and it IS bound to the operations. This should | ||
// not produce any validation events. | ||
@clientEndpointDiscovery( | ||
operation: DescribeEndpoints, | ||
error: InvalidEndpointError, | ||
) | ||
service BazService { | ||
version: "2021-06-29", | ||
operations: [DescribeEndpoints, GetObjectWithEndpointError], | ||
} | ||
|
||
operation DescribeEndpoints { | ||
input: DescribeEndpointsInput, | ||
output: DescribeEndpointsOutput, | ||
} | ||
|
||
@input | ||
structure DescribeEndpointsInput { | ||
Operation: String, | ||
Identifiers: Identifiers, | ||
} | ||
|
||
map Identifiers { | ||
key: String, | ||
value: String, | ||
} | ||
|
||
@output | ||
structure DescribeEndpointsOutput { | ||
Endpoints: Endpoints, | ||
} | ||
|
||
list Endpoints { | ||
member: Endpoint, | ||
} | ||
|
||
structure Endpoint { | ||
Address: String, | ||
CachePeriodInMinutes: Long, | ||
} | ||
|
||
@clientDiscoveredEndpoint(required: true) | ||
operation GetObject { | ||
input: GetObjectInput, | ||
output: GetObjectOutput, | ||
} | ||
|
||
@input | ||
structure GetObjectInput { | ||
@required | ||
Id: String, | ||
} | ||
|
||
@output | ||
structure GetObjectOutput { | ||
Object: Blob, | ||
} | ||
|
||
@clientDiscoveredEndpoint(required: true) | ||
operation GetObjectWithEndpointError { | ||
input: GetObjectWithEndpointErrorInput, | ||
output: GetObjectWithEndpointErrorOutput, | ||
errors: [InvalidEndpointError], | ||
} | ||
|
||
@input | ||
structure GetObjectWithEndpointErrorInput { | ||
@required | ||
Id: String, | ||
} | ||
|
||
@output | ||
structure GetObjectWithEndpointErrorOutput { | ||
Object: Blob, | ||
} | ||
|
||
@error("client") | ||
@httpError(421) | ||
structure InvalidEndpointError {} |