Skip to content

Commit

Permalink
added impression qualification server, lint errors, review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kungfucraig committed Dec 18, 2024
1 parent dd709e9 commit a241647
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 41 deletions.
22 changes: 22 additions & 0 deletions src/main/proto/wfa/measurement/reporting/v2alpha/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ proto_library(
"@com_google_googleapis//google/type:date_proto",
"@com_google_googleapis//google/type:datetime_proto",
"@com_google_googleapis//google/type:dayofweek_proto",
"@com_google_protobuf//:timestamp_proto",
],
)

Expand Down Expand Up @@ -69,6 +70,7 @@ proto_library(
strip_import_prefix = IMPORT_PREFIX,
deps = [
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_protobuf//:duration_proto",
],
)

Expand Down Expand Up @@ -296,6 +298,26 @@ kt_jvm_grpc_proto_library(
deps = [":event_groups_service_proto"],
)

proto_library(
name = "impression_qualification_filters_service_proto",
srcs = ["impression_qualification_filters_service.proto"],
strip_import_prefix = IMPORT_PREFIX,
deps = [
":impression_qualification_filter_proto",
":impression_qualification_filter_spec_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_protobuf//:timestamp_proto",
],
)

kt_jvm_grpc_proto_library(
name = "impression_qualification_filters_service_kt_jvm_grpc_proto",
deps = [":impression_qualification_filters_service_proto"],
)

proto_library(
name = "metrics_service_proto",
srcs = ["metrics_service.proto"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package wfa.measurement.reporting.v2alpha;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";
import "google/type/date.proto";
import "google/type/datetime.proto";
import "wfa/measurement/reporting/v2alpha/page.proto";
Expand All @@ -28,7 +29,6 @@ option java_multiple_files = true;
option java_outer_classname = "BasicReportProto";

// Resource representing a Basic Report.
// TODO(@kungfucraig): Remove fields not required for Phase I.
message BasicReport {
option (google.api.resource) = {
type: "reporting.halo-cmm.org/BasicReport"
Expand Down Expand Up @@ -106,4 +106,10 @@ message BasicReport {
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = OUTPUT_ONLY
];

// The time when the resource was created.
google.protobuf.Timestamp create_time = 9 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = OUTPUT_ONLY
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,38 @@ service BasicReports {
// Request mesage for 'GetBasicReport' method
message GetBasicReportRequest {
// The name of the basic report to retrieve.
string name = 1 [(google.api.field_behavior) = REQUIRED];
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "reporting.halo-cmm.org/BasicReport"
}
];
}

// Request mesage for 'GetListBasicReport' method
// Request mesage for 'ListBasicReport' method
message ListBasicReportsRequest {
string parent = 1 [(google.api.resource_reference) = {
type: "reporting.halo-cmm.org/MeasurementConsumer"
}];
// List the Basic Reports of the given parent.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "reporting.halo-cmm.org/MeasurementConsumer"
}
];

// Message for specifying filters for listing BasicReports.
message Filter {
// Return BasicReports that were created after this time.
google.protobuf.Timestamp created_after = 1
// (-- api-linter: core::0140::prepositions=disabled
// -- api-linter: core::0142::time-field-names=disabled
// aip.dev/not-precedent: Using a preposition and not ending with "time"
// is natural here. --)
google.protobuf.Timestamp create_time_after = 1
[(google.api.field_behavior) = REQUIRED];
}

// Filter for the list of BasicReports
// (-- api-linter: core::0132::request-field-types=disabled
// aip.dev/not-precedent: Use an explicit filter not a string. --)
Filter filter = 2 [(google.api.field_behavior) = OPTIONAL];

// The maximum number of basic reports to return. The service may return fewer
Expand All @@ -84,6 +100,7 @@ message ListBasicReportsRequest {

// Response message for 'ListBasicReports' method.
message ListBasicReportsResponse {
// The Basic Reports that met the filter criteria
repeated BasicReport basic_reports = 1
[(google.api.field_behavior) = OPTIONAL];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,12 @@ message ImpressionQualificationFilter {
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
];

// The filter category (e.g. MRC)
//
// This allows filters to be grouped by category across Filter Types
string category = 3 [
(google.api.field_behavior) = OPTIONAL,
(google.api.field_behavior) = IMMUTABLE
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ syntax = "proto3";
package wfa.measurement.reporting.v2alpha;

import "google/api/field_behavior.proto";
import "google/protobuf/duration.proto";

option java_package = "org.wfanet.measurement.reporting.v2alpha";
option java_multiple_files = true;
option java_outer_classname = "ImpressionQualificationFilterProto";
option java_outer_classname = "ImpressionQualificationFilterSpecProto";

// Specifies the impression filter for a ReportingMediaType.
//
Expand All @@ -36,7 +37,7 @@ message ImpressionQualificationFilterSpec {
// specified.
enum FilterType {
// Default value. Unused.
REPORTING_MEDIA_TYPE_UNSPECIFIED = 0;
FILTER_TYPE_UNSPECIFIED = 0;
// Filter is for Cross Media
CROSS_MEDIA = 1;
// Filter is for Video
Expand Down Expand Up @@ -84,6 +85,13 @@ message ImpressionQualificationFilterSpec {
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
];

// Specifies the completion filter
Percent completion = 3 [(google.api.field_behavior) = IMMUTABLE];
oneof completion {
// Speifies a completion percent
Percent percent = 3 [(google.api.field_behavior) = IMMUTABLE];
// Specifies the absolute completion duration
google.protobuf.Duration duration = 4
[(google.api.field_behavior) = IMMUTABLE];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,65 +21,82 @@ import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "wfa/measurement/reporting/v2alpha/impression_qualification_filter.proto";
import "wfa/measurement/reporting/v2alpha/impression_qualification_filter_spec.proto";

option java_package = "org.wfanet.measurement.reporting.v2alpha";
option java_multiple_files = true;
option java_outer_classname = "BasicReportsServiceProto";
option java_outer_classname = "ImpressionQualificationFiltersServiceProto";

// Service for managing 'BasicReport' resources.
service BasicReports {
// Returns the 'BasicReport' with the given resource key.
rpc GetBasicReport(GetBasicReportRequest) returns (BasicReport) {
// Service for managing 'ImpressionQualificationFilter' resources.
service ImpressionQualificationFilters {
// Returns the 'ImpressionQualificationFilter' with the given resource key.
rpc GetImpressionQualificationFilter(GetImpressionQualificationFilterRequest)
returns (ImpressionQualificationFilter) {
option (google.api.http) = {
get: "/v2alpha/{name=measurementConsumers/*/basicReports/*}"
get: "/v2alpha/{name=impressionQualificationFilters/*}"
};
option (google.api.method_signature) = "name";
}

// Ordered by `create_time` ascending, `name` ascending.
rpc ListBasicReports(ListBasicReportsRequest)
returns (ListBasicReportsResponse) {
// Ordered by filter type and name in ascending order.
rpc ListImpressionQualificationFilters(
ListImpressionQualificationFiltersRequest)
returns (ListImpressionQualificationFiltersResponse) {
option (google.api.http) = {
get: "/v2alpha/{parent=measurementConsumers/*}/basicReports"
get: "/v2alpha/{parent=measurementConsumers/*}/impressionQualificationFilters"
};
option (google.api.method_signature) = "parent";
}
}

// Request mesage for 'GetBasicReport' method
message GetBasicReportRequest {
// The name of the basic report to retrieve.
string name = 1 [(google.api.field_behavior) = REQUIRED];
// Request mesage for 'GetImpressionQualificationFilter' method
message GetImpressionQualificationFilterRequest {
// The name of the impression qualification filter to retrieve.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "reporting.halo-cmm.org/ImpressionQualificationFilter"
}
];
}

// Request mesage for 'GetListBasicReport' method
message ListBasicReportsRequest {
// Message for specifying filters for listing BasicReports.
// Request mesage for 'ListImpressionQualificationFilter' method
message ListImpressionQualificationFiltersRequest {
// Message for specifying filters for listing ImpressionQualificationFilters.
//
// At least one of the following criteria must be specified.
message Filter {
// Return BasicReports that were created after this time.
google.protobuf.Timestamp created_after = 1
[(google.api.field_behavior) = REQUIRED];
// Returns impression qualification filters with the given filter type.
ImpressionQualificationFilterSpec.FilterType filter_type = 1
[(google.api.field_behavior) = OPTIONAL];

// Returns impression qualification filters with the given category
string category = 2 [(google.api.field_behavior) = OPTIONAL];
}
// Filter for the list of BasicReports
// Filter for the list of ImpressionQualificationFilters
// (-- api-linter: core::0132::request-field-types=disabled
// aip.dev/not-precedent: Use an explicit filter not a string. --)
Filter filter = 1 [(google.api.field_behavior) = OPTIONAL];

// The maximum number of basic reports to return. The service may return fewer
// The maximum number of filters to return. The service may return fewer
// than this value.
// If unspecified, at most 10 basic reports will be returned.
// The maximum value is 25; values above 25 will be coerced to 25.
// If unspecified, at most 50 filters will be returned.
// The maximum value is 100; values above 100 will be coerced to 100.
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

// A page token, received from a previous `ListBasicReports` call.
// Provide this to retrieve the subsequent page.
// A page token, received from a previous `ListImpressionQualificationFilters`
// call. Provide this to retrieve the subsequent page.
//
// When paginating, all other parameters provided to `ListBasicReports` must
// match the call that provided the page token.
// When paginating, all other parameters provided to
// `ListImpressionQualificationFilters` must match the call that provided the
// page token.
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
}

// Response message for 'ListBasicReports' method.
message ListBasicReportsResponse {
repeated BasicReport basic_reports = 1
// Response message for 'ListImpressionQualificationFilters' method.
message ListImpressionQualificationFiltersResponse {
// The set of ImpressionQualificationFilters that met the filter criteria
repeated ImpressionQualificationFilter impression_qualification_filters = 1
[(google.api.field_behavior) = OPTIONAL];

// A token, which can be sent as `page_token` to retrieve the next page.
Expand Down

0 comments on commit a241647

Please sign in to comment.