Add get_foo() -> &Option<Foo> accessors for builders and fluent builders. (#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](https://github.com/DavidSouther/aws-doc-sdk-examples/commit/017e8a2e407eba6a4c259bca0334f1356ab822d9 ) <!--- 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 <jdisanti@amazon.com>
Loading
Please register or sign in to comment