You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there is no way to get the information in a Builder while creating a request. It would be nice to have some way to get that information. This would be helpful in testing, to be able to verify the contents of a Builder without mocking the request. It may also be useful for implementing a multi stage request, where one builder is passed through several functions that make changes to the request based on prior information.
For an example of a test that would be improved by this pattern, see this commit.
The text was updated successfully, but these errors were encountered:
…ers. (#2792)
This allows testing, as well as making decisions while creating
builders. The references are not mutable, so these props remain read
only keeping the Builder invariants.
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
Some operations are built up using various logic (for instance, choosing
an S3 bucket based on a logged in user). It is a lot of overhead to test
at the mock level, and the Debug formatting is typically not stable.
<!--- If it fixes an open issue, please link to the issue here -->
Closes#2791
## Description
<!--- Describe your changes in detail -->
1. Add `get_foo(&self) -> &Option<Foo>` to Builders
2. Add `as_input(&self) -> &OperationInputBuilder` to Fluent Builders
3. Add `get_foo(&self) -> &Option<Foo>` to FluentBuilder which delegates
to Builders
## Testing
<!--- Please describe in detail how you tested your changes -->
Included unit tests, as well as [proof of concept
tests](DavidSouther/aws-doc-sdk-examples@017e8a2)
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [X] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [X] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
---------
Co-authored-by: John DiSanti <[email protected]>
Currently, there is no way to get the information in a Builder while creating a request. It would be nice to have some way to get that information. This would be helpful in testing, to be able to verify the contents of a Builder without mocking the request. It may also be useful for implementing a multi stage request, where one builder is passed through several functions that make changes to the request based on prior information.
For an example of a test that would be improved by this pattern, see this commit.
The text was updated successfully, but these errors were encountered: