-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #251 from JordonPhillips/ec2-query-name
Add ec2QueryNameTrait
- Loading branch information
Showing
7 changed files
with
130 additions
and
2 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
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
42 changes: 42 additions & 0 deletions
42
smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/Ec2QueryNameTrait.java
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,42 @@ | ||
/* | ||
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
package software.amazon.smithy.aws.traits; | ||
|
||
import software.amazon.smithy.model.SourceLocation; | ||
import software.amazon.smithy.model.shapes.ShapeId; | ||
import software.amazon.smithy.model.traits.StringTrait; | ||
|
||
/** | ||
* Indicates the serialized name of a structure member when that structure is | ||
* serialized for the input of an EC2 operation. | ||
*/ | ||
public class Ec2QueryNameTrait extends StringTrait { | ||
public static final ShapeId ID = ShapeId.from("aws.api#ec2QueryName"); | ||
|
||
public Ec2QueryNameTrait(String value, SourceLocation sourceLocation) { | ||
super(ID, value, sourceLocation); | ||
} | ||
|
||
public Ec2QueryNameTrait(String value) { | ||
this(value, SourceLocation.NONE); | ||
} | ||
|
||
public static final class Provider extends StringTrait.Provider<Ec2QueryNameTrait> { | ||
public Provider() { | ||
super(ID, Ec2QueryNameTrait::new); | ||
} | ||
} | ||
} |
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
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
Empty file.
17 changes: 17 additions & 0 deletions
17
...raits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/ec2-query-name.json
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,17 @@ | ||
{ | ||
"smithy": "0.5.0", | ||
"shapes": { | ||
"com.example#Input": { | ||
"type": "structure", | ||
"members": { | ||
"Ipv6AddressSet": { | ||
"target": "smithy.api#String", | ||
"traits": { | ||
"smithy.api#xmlName": "ipv6AddressSet", | ||
"aws.api#ec2QueryName": "Ipv6Addresses" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |