Skip to content

Commit

Permalink
Define internal exchange service method for streaming and batch deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorilla committed May 1, 2023
1 parent 02b108e commit a9e9490
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ proto_library(
":exchange_proto",
"//src/main/proto/wfa/measurement/internal/common:provider_proto",
"@com_google_googleapis//google/type:date_proto",
"@com_google_protobuf//:empty_proto",
],
)

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

package wfa.measurement.internal.kingdom;

import "google/protobuf/empty.proto";
import "google/type/date.proto";
import "wfa/measurement/internal/common/provider.proto";
import "wfa/measurement/internal/kingdom/exchange.proto";
Expand All @@ -33,6 +34,13 @@ service Exchanges {
// If there is already an Exchange for the same date for the given
// `RecurringExchange`, this will do nothing and return that instead.
rpc CreateExchange(CreateExchangeRequest) returns (Exchange);

// Streams `Exchange`s.
rpc StreamExchanges(StreamExchangesRequest) returns (stream Exchange);

// Permanently deletes `Exchange`s.
rpc BatchDeleteExchanges(BatchDeleteExchangesRequest)
returns (google.protobuf.Empty);
}

// Request for `/Exchanges.GetExchange`.
Expand All @@ -52,3 +60,28 @@ message CreateExchangeRequest {
// The `Exchange` to create.
Exchange exchange = 1;
}

// Request for `/Exchanges.StreamExchange`.
message StreamExchangesRequest {
// Restricts results to those matching the given criteria.
message Filter {
google.type.Date exchanged_before = 1;
}
Filter filter = 1;

// The maximum number of results to return. If not specified or 0, it implies
// unlimited.
int32 limit = 2;
}

message DeleteExchangeRequest {
fixed64 external_recurring_exchange_id = 1;
google.type.Date date = 2;
}

// Request for `/Exchanges.BatchDeleteExchanges`.
message BatchDeleteExchangesRequest {
// The request message specifying the `Exchange`s to permanently delete. A
// maximum of 1000 Exchanges can be deleted in a batch.
repeated DeleteExchangeRequest requests = 1;
}

0 comments on commit a9e9490

Please sign in to comment.