Skip to content

Commit

Permalink
Use oneof for the two options
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Apr 30, 2021
1 parent 844ccd8 commit 8dd3b14
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions cs3/storage/provider/v1beta1/provider_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -280,18 +280,20 @@ message InitiateFileUploadRequest {
// REQUIRED.
// The reference to which the action should be performed.
Reference ref = 2;
// OPTIONAL.
// Whether the file is to be uploaded in exclusive mode. Defaults to false.
// If true, the request SHALL be processed such that only one of multiple concurrent uploads
// to the same target reference MAY succeed, whereas all others MUST fail with CODE_ALREADY_EXISTS.
// The semantic is similar to the O_CREAT|O_EXCL POSIX flags.
// The request MUST return CODE_NOT_IMPLEMENTED if the provider does not support this mode.
bool if_not_exist = 3;
// OPTIONAL.
// Whether the file is to be uploaded if the given etag matches. Default to always upload.
// If a mismatching etag is given, the request MUST return CODE_ALREADY_EXISTS with the current etag
// in the opaque field.
string if_match = 4;
oneof options {
// OPTIONAL.
// Whether the file is to be uploaded in exclusive mode. Defaults to false.
// If true, the request SHALL be processed such that only one of multiple concurrent uploads
// to the same target reference MAY succeed, whereas all others MUST fail with CODE_ALREADY_EXISTS.
// The semantic is similar to the O_CREAT|O_EXCL POSIX flags.
// The request MUST return CODE_NOT_IMPLEMENTED if the provider does not support this mode.
bool if_not_exist = 3;
// OPTIONAL.
// Whether the file is to be uploaded if the given etag matches. Default to always upload.
// If a mismatching etag is given, the request MUST return CODE_ALREADY_EXISTS with the current etag
// in the opaque field.
string if_match = 4;
}
}

message InitiateFileUploadResponse {
Expand Down

0 comments on commit 8dd3b14

Please sign in to comment.