-
Notifications
You must be signed in to change notification settings - Fork 314
Refactor CreateCollectionBuilder #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Would it make more sense to swap the parameters of |
I agree with @thomastaylor312. I would go further: why separate the parameters in two places? I'd put them all in the Also, from a documentation point of view, I think it would be best to have all the required fields in one place. |
@MindFlavor I disagree with you on that count. That conflates configuration with data. With a builder, you are building up a client that can act on something. That "something" is the document/blob/VM/etc. So it makes sense for it to be separate from my view |
@MindFlavor @thomastaylor312 I pushed another commit which switches where the required and the optional arguments are passed. I also made I needed to make a new type for the the creation collection request body, but this actually cleaned things up. |
sdk/cosmos/tests/permission.rs
Outdated
let _create_user_response = user2_client.create_user().execute().await.unwrap(); | ||
|
||
// create a temp collection | ||
let create_collection_response = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I don't think this needs to be in a separate {}
block anymore
Yes, you make a valid point 👍 ! I agree (sorry for taking so long to answer) |
This is a suggested way of addressing #129.
This particular builder is the builder in Cosmos with the most required fields. Even then, I think it's still a very reasonable API.
Docs
API Usage
Thoughts?
If we like this, I can update the rest of the builders.