Add support for stringArray
and operationContextParams
#9153
+217
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note for reviewers: I intentionally did not include a changelog file, as this should not result in any user-observable changes for now, but let me know if you think we should.
Issue #, if available: CLI-4648
Description of changes:
Primary Change
In the rules-based endpoints resolver, this adds support for:
stringArray
as parameters into endpoint resolutionoperationContextParams
- this is a new trait in the service model, which can extract more complicated endpoint resolution parameters (including lists of strings) out of an operation's request.This is a port of boto/botocore#3301.
Supporting Changes
This includes two more PRs from
botocore
:get_attr
, which is a built-in function used within endpoint resolution to resolve named keys and/or indices into arrays or dicts.boto3
to reduce memory usage when using multipleSession
objects. While this is less of an issue for the CLI given a single command invocation will typically use a singleSession
, by overriding the LRU cache we're using forresolve_endpoint
, we can support unhashable types (i.e.list
, which is used for our newstringArray
), which thelru_cache
infunctools
does not.Testing
In addition to porting the automated tests, I manually tested an internal, future service update that is taking advantage of this, and confirmed that the
unit
andfunctional
tests pass locally against the updated model and endpoints files.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.