-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This allows the CLI's endpoint resolver to consider collections of strings as an input to endpoint resolution, and use operationContextParams to resolve parameters from the operation's input.
- Loading branch information
Showing
9 changed files
with
217 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "enhancement", | ||
"category": "endpoints", | ||
"description": "Add support for ``stringArray`` parameters and the ``operationContextParams`` trait when resolving service endpoints." | ||
} |
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
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
37 changes: 37 additions & 0 deletions
37
tests/unit/botocore/data/endpoints/test-cases/array-index.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,37 @@ | ||
{ | ||
"version": "1.0", | ||
"testCases": [ | ||
{ | ||
"documentation": "Access an array index at index 0", | ||
"params": { | ||
"ResourceList": ["resource"] | ||
}, | ||
"expect": { | ||
"endpoint": { | ||
"url": "https://www.resource.example.com" | ||
} | ||
} | ||
}, | ||
{ | ||
"documentation": "Resolved value when array is explictly set to empty", | ||
"params": { | ||
"ResourceList": [] | ||
}, | ||
"expect": { | ||
"endpoint": { | ||
"url": "https://www.example.com" | ||
} | ||
} | ||
}, | ||
{ | ||
"documentation": "Resolved value to default if array is unset", | ||
"params": { | ||
}, | ||
"expect": { | ||
"endpoint": { | ||
"url": "https://www.default1.example.com" | ||
} | ||
} | ||
} | ||
] | ||
} |
47 changes: 47 additions & 0 deletions
47
tests/unit/botocore/data/endpoints/valid-rules/array-index.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,47 @@ | ||
{ | ||
"version": "1.3", | ||
"parameters": { | ||
"ResourceList": { | ||
"required": true, | ||
"default": ["default1", "default2"], | ||
"type": "stringArray" | ||
} | ||
}, | ||
"rules": [ | ||
{ | ||
"documentation": "Array is set, retrieve index 0", | ||
"conditions": [ | ||
{ | ||
"fn": "isSet", | ||
"argv": [ | ||
{ | ||
"ref": "ResourceList" | ||
} | ||
] | ||
}, | ||
{ | ||
"fn": "getAttr", | ||
"argv": [ | ||
{ | ||
"ref": "ResourceList" | ||
}, | ||
"[0]" | ||
], | ||
"assign": "resourceid" | ||
} | ||
], | ||
"endpoint": { | ||
"url": "https://www.{resourceid}.example.com" | ||
}, | ||
"type": "endpoint" | ||
}, | ||
{ | ||
"documentation": "Fallback when array is unset", | ||
"conditions": [], | ||
"endpoint": { | ||
"url": "https://www.example.com" | ||
}, | ||
"type": "endpoint" | ||
} | ||
] | ||
} |
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