Skip to content

Commit

Permalink
Add a parent field to ClaimReadyExchangeStepRequest.
Browse files Browse the repository at this point in the history
This replaces the `party` oneof. The method operates on the recurringExchanges resource collection.
  • Loading branch information
SanjayVas committed Jun 1, 2023
1 parent aa65f56 commit 7cc6ad8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
1 change: 1 addition & 0 deletions src/main/proto/wfa/measurement/api/v2alpha/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ proto_library(
srcs = ["exchange_steps_service.proto"],
deps = [
":exchange_step_proto",
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_googleapis//google/api:resource_proto",
"@com_google_googleapis//google/type:date_proto",
],
Expand Down
2 changes: 0 additions & 2 deletions src/main/proto/wfa/measurement/api/v2alpha/exchange.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ message Exchange {
option (google.api.resource) = {
type: "halo.wfanet.org/Exchange"
pattern: "recurringExchanges/{recurring_exchange}/exchanges/{exchange}"
pattern: "dataProviders/{data_provider}/recurringExchanges/{recurring_exchange}/exchanges/{exchange}"
pattern: "modelProviders/{data_provider}/recurringExchanges/{recurring_exchange}/exchanges/{exchange}"
};

// Resource name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ message ExchangeStep {
option (google.api.resource) = {
type: "halo.wfanet.org/ExchangeStep"
pattern: "recurringExchanges/{recurring_exchange}/exchanges/{exchange}/steps/{exchange_step}"
pattern: "dataProviders/{data_provider}/recurringExchanges/{recurring_exchange}/exchanges/{exchange}/steps/{exchange_step}"
pattern: "modelProviders/{data_provider}/recurringExchanges/{recurring_exchange}/exchanges/{exchange}/steps/{exchange_step}"
};

// Resource name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ syntax = "proto3";

package wfa.measurement.api.v2alpha;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/type/date.proto";
import "wfa/measurement/api/v2alpha/exchange_step.proto";
Expand All @@ -29,12 +30,11 @@ service ExchangeSteps {
// Returns the `ExchangeStep` with the specified resource key.
rpc GetExchangeStep(GetExchangeStepRequest) returns (ExchangeStep);

// Claims a single ExchangeStep that is ready to be worked on and creates an
// initial ExchangeStepAttempt for it.
// Find and claims an `ExchangeStep` that is ready to be worked on, creating
// an initial `ExchangeStepAttempt` for it.
//
// If there are no ready ExchangeSteps, this will return an empty response.
// Since this is expected, normal behavior, it does NOT return a NOT_FOUND
// error.
// This method operates on the recurringExchanges resource collection. If
// there are no ready `ExchangeStep`s, this will return an empty response.
rpc ClaimReadyExchangeStep(ClaimReadyExchangeStepRequest)
returns (ClaimReadyExchangeStepResponse);

Expand All @@ -52,14 +52,14 @@ message GetExchangeStepRequest {

// Request message for `ClaimReadyExchangeStep` method.
message ClaimReadyExchangeStepRequest {
// If an `ExchangeStep` is returned, it should be executed by this party.
// Required.
oneof party {
string data_provider = 1
[(google.api.resource_reference).type = "halo.wfanet.org/DataProvider"];
string model_provider = 2 [(google.api.resource_reference).type =
"halo.wfanet.org/ModelProvider"];
}
reserved 1, 2;

// Resource name of the parent of the `RecurringExchange`.
string parent = 3 [
(google.api.resource_reference).child_type =
"halo.wfanet.org/RecurringExchange",
(google.api.field_behavior) = REQUIRED
];
}

// Response message for `ClaimReadyExchangeStep` method.
Expand Down Expand Up @@ -122,4 +122,4 @@ message ListExchangeStepsResponse {
// A token, which can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
string next_page_token = 2;
}
}

0 comments on commit 7cc6ad8

Please sign in to comment.