Skip to content
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

Open
z0mb1ek opened this issue Aug 30, 2020 · 9 comments
Open

revision is not optional in B2UpdateBucketRequest #125

z0mb1ek opened this issue Aug 30, 2020 · 9 comments

Comments

@z0mb1ek
Copy link

z0mb1ek commented Aug 30, 2020

Hi. We need B2Bucket to construct B2UpdateBucketRequest, but in B2Bucket revision is not optional field
@B2Json.required private final int revision;

@certainmagic
Copy link
Contributor

Hi Dmitry --

Sorry for the delay in responding. I was backpacking last week.

I see that I have the following comment in B2UpdateBucketRequest.Builder:

// XXX: should i let people opt-out of using ifRevisionIs? let's see if anyone needs it!

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,
ab

@z0mb1ek
Copy link
Author

z0mb1ek commented Sep 9, 2020

Hi. I want programmaticaly change cors for example on bucket

@certainmagic
Copy link
Contributor

certainmagic commented Sep 9, 2020 via email

@z0mb1ek
Copy link
Author

z0mb1ek commented Sep 9, 2020

Yes, i don't have version, I want just +1

@certainmagic
Copy link
Contributor

certainmagic commented Sep 9, 2020 via email

@z0mb1ek
Copy link
Author

z0mb1ek commented Sep 9, 2020

No, I have a created bucket. And than I want just update it

@certainmagic
Copy link
Contributor

I'm still trying to understand the core of the issue you're having. Does either of these work for you?

  • Is it a bucket you have just created?  If so, do you know you want the CORS rules at the time you've created it?  Could you just set them then? Something like this:
    final B2Bucket newBucket = client.createBucket(B2CreateBucketRequest.builder(name, type).setCorsRules(...).build())

  • Usually people would just do something like this:
       final B2Bucket bucket = ...;
    client.updateBucket(B2UpdateBucketRequest.builder(bucket).setCorsRules(...).build())

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,
ab

@z0mb1ek
Copy link
Author

z0mb1ek commented Sep 9, 2020

I have just the accountId and bucketId

@certainmagic
Copy link
Contributor

certainmagic commented Sep 9, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants