-
Notifications
You must be signed in to change notification settings - Fork 25
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
revision is not optional in B2UpdateBucketRequest #125
Comments
Hi Dmitry -- Sorry for the delay in responding. I was backpacking last week. I see that I have the following comment in B2UpdateBucketRequest.Builder:
Congrats on being the first person to ask about it. :) Can you tell us more about your use case? What are you changing about a bucket that you don't already have a bucket object from the service to start from? Or is it just that you don't want ifRevisionIs to be set? Or...? thanks, |
Hi. I want programmaticaly change cors for example on bucket |
The intention is that you fetch the current version of the bucket and use
that as input to the request. It sounds like maybe you don't have the
current version of the bucket to start with?
…On Wed, Sep 9, 2020 at 3:01 PM Dmitry Fedorov ***@***.***> wrote:
Hi. I want programmaticaly change cors for example on bucket
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#125 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHJFCX3LJVJZZZEAQOBE3LSE6KEDANCNFSM4QPP7MWQ>
.
|
Yes, i don't have version, I want just +1 |
So today your code calls new B2Bucket(....) from scratch and then passes
that to B2UpdateBucketRequest.builder()?
…On Wed, Sep 9, 2020 at 3:08 PM Dmitry Fedorov ***@***.***> wrote:
Yes, i don't have version, I want just +1
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#125 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHJFCSCOHNHUUTJ5GTU4EDSE6K7TANCNFSM4QPP7MWQ>
.
|
No, I have a created bucket. And than I want just update it |
I'm still trying to understand the core of the issue you're having. Does either of these work for you?
Do you have a B2Bucket object for the previously created bucket, or just the accountId and bucketId? (The B2Bucket object in the SDK isn't currently intended to be created by SDK clients -- that's why there's no Builder class for it.) thanks, |
I have just the accountId and bucketId |
As mentioned in the documentation, the ifRevisionIs parameter is used to
detect conflicting updates to a bucket. It sounds like you don't care
about that and that you want to make the change unconditionally.
I would propose adding this to B2UpdateBucketRequest.Builder:
private Builder(String accountId, String bucketId) {
this. accountId = accountId;
this.bucketId = bucketId;
}
and adding this to B2UpdateBucketRequest:
public static Builder builder(String accountId, String bucketId) {
return new Builder(accountId, bucketId);
}
and updating the comment at the start of the Builder class.
And then you'll be able to create the request directly without specifying a
version and without having to make a dummy bucket object.
How does that sound? Are you willing to make a PR?
thanks,
ab
…On Wed, Sep 9, 2020 at 3:44 PM Dmitry Fedorov ***@***.***> wrote:
I have just the accountId and bucketId
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#125 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHJFCTC6J3T6BOZ4GRWTZ3SE6PHFANCNFSM4QPP7MWQ>
.
|
Hi. We need B2Bucket to construct B2UpdateBucketRequest, but in B2Bucket revision is not optional field
@B2Json.required private final int revision;
The text was updated successfully, but these errors were encountered: