Skip to content

Commit

Permalink
Add data availability support
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanvuong2021 committed Nov 1, 2023
1 parent 8b30f27 commit fbe243d
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/proto/wfa/measurement/api/v2alpha/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ proto_library(
":measurement_consumer_proto",
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_googleapis//google/api:resource_proto",
"@com_google_googleapis//google/type:interval_proto",
],
)

Expand All @@ -125,6 +126,7 @@ proto_library(
":event_template_proto",
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_googleapis//google/api:resource_proto",
"@com_google_googleapis//google/type:interval_proto",
"@com_google_protobuf//:any_proto",
],
)
Expand Down Expand Up @@ -521,9 +523,11 @@ proto_library(
strip_import_prefix = IMPORT_PREFIX,
deps = [
":data_provider_proto",
"@com_google_googleapis//google/api:annotations_proto",
"@com_google_googleapis//google/api:client_proto",
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_googleapis//google/api:resource_proto",
"@com_google_googleapis//google/type:interval_proto",
],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package wfa.measurement.api.v2alpha;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/type/interval.proto";
import "wfa/measurement/api/v2alpha/crypto.proto";

option java_package = "org.wfanet.measurement.api.v2alpha";
Expand Down Expand Up @@ -63,4 +64,8 @@ message DataProvider {
(google.api.resource_reference).type = "halo.wfanet.org/Duchy",
(google.api.field_behavior) = UNORDERED_LIST
];

// Interval for when data is guaranteed to be available for a `Requisition`.
// If this field is specified, both `start_time` and `end_time` must be set.
google.type.Interval data_availability_interval = 7;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ syntax = "proto3";

package wfa.measurement.api.v2alpha;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/type/interval.proto";
import "wfa/measurement/api/v2alpha/data_provider.proto";

option java_package = "org.wfanet.measurement.api.v2alpha";
Expand All @@ -35,6 +37,16 @@ service DataProviders {
// Replaces the `required_duchies` field in a `DataProvider` resource.
rpc ReplaceDataProviderRequiredDuchies(
ReplaceDataProviderRequiredDuchiesRequest) returns (DataProvider) {}

// Replaces `data_availability_interval` for a `DataProvider` resource.
rpc ReplaceDataAvailabilityInterval(ReplaceDataAvailabilityIntervalRequest)
returns (DataProvider) {
option (google.api.http) = {
post: "/v2alpha/{name=dataProviders/*}"
body: "data_availability_interval"
};
option (google.api.method_signature) = "name,data_availability_interval";
}
}

// Request message for the `ReplaceDataProviderRequiredDuchies` method.
Expand All @@ -58,3 +70,16 @@ message GetDataProviderRequest {
(google.api.field_behavior) = REQUIRED
];
}

// Request message for `ReplaceDataAvailability` method.
message ReplaceDataAvailabilityIntervalRequest {
// Resource name.
string name = 1 [
(google.api.resource_reference).type = "halo.wfanet.org/DataProvider",
(google.api.field_behavior) = REQUIRED
];

// New value for `data_availability_interval`.
google.type.Interval data_availability_interval = 2
[(google.api.field_behavior) = REQUIRED];
}
15 changes: 15 additions & 0 deletions src/main/proto/wfa/measurement/api/v2alpha/event_group.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package wfa.measurement.api.v2alpha;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/any.proto";
import "google/type/interval.proto";
import "wfa/measurement/api/v2alpha/crypto.proto";

option java_package = "org.wfanet.measurement.api.v2alpha";
Expand Down Expand Up @@ -113,4 +114,18 @@ message EventGroup {
}
// Event Group state.
State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY];

// Interval for when data for this `EventGroup` is guaranteed to be available
// for a `Requisition`.
//
// The parent `data_availability_interval` defines the upper and lower bounds
// for when data is guaranteed to be available.
//
// This field will be required in a future release. Until then, if this is not
// set, data is not guaranteed to be available.
//
// If this is set, then `start_time` is required and the data is guaranteed to
// be available for the interval that defines the overlap between this and the
// parent `data_availability_interval`.
google.type.Interval data_availability_interval = 10;
}

0 comments on commit fbe243d

Please sign in to comment.