feat: add builder patterns to request structs #40
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.
Summary
🎉 100% COMPLETE - This PR now implements builder patterns for ALL request structs across both
redis-cloudandredis-enterpriselibraries!Achievement Unlocked: 100% Coverage! 🏆
Final Status
Changes Made
🏗️ Complete Builder Pattern Implementation
redis-cloud crate (6 structs):
CreateDatabaseRequest/UpdateDatabaseRequestCreateSubscriptionRequest/UpdateSubscriptionRequestCloudProviderConfig/CloudRegionConfigCreateBackupRequestCreatePeeringRequestredis-enterprise crate (18 structs):
HIGH Priority:
CreateDatabaseRequest(migrated from custom builder to TypedBuilder)BootstrapRequestCreateMigrationRequestDebugInfoRequestMEDIUM Priority:
CreateUserRequest/UpdateUserRequestCreateRoleRequestwithBdbRoleCreateCrdbRequestwithCreateCrdbInstanceCreateScheduledJobRequestCreateLdapMappingRequestCreateSuffixRequestCreateRedisAclRequestCreateCrdbTaskRequestDiagnosticRequestLOW Priority:
ServiceConfigRequestNodeActionRequestLicenseUpdateRequest🎯 Developer Experience Improvements
Before (verbose and error-prone):
After (clean and ergonomic):
🚀 Key Benefits
Some()wrapping -strip_optionattribute handles this automatically.to_string()calls -setter(into)converts &str to StringTesting
Implementation Details
Used
typed-builderv0.20 with consistent patterns:#[builder(setter(into))]for String fields#[builder(default, setter(into, strip_option))]for Option#[builder(default, setter(strip_option))]for other OptionWhat This Means
Every single request struct in both Redis libraries now has an ergonomic builder pattern! This makes the Redis APIs significantly more pleasant to use and maintains consistency across the entire codebase.
Closes #38
Closes #41