From 02b108e2188e0f8b91f26aec43c9ff69466cf907 Mon Sep 17 00:00:00 2001 From: Rieman Date: Mon, 1 May 2023 10:46:11 -0700 Subject: [PATCH] Fix page token usage. (#971) * Fix page token package path in CMMS * Separate page tokens for reporting from CMMS --- .../service/api/v2alpha/EventGroupsService.kt | 36 ++++++------- .../api/v2alpha/MeasurementsService.kt | 36 ++++++------- .../api/v2alpha/RequisitionsService.kt | 36 ++++++------- .../reporting/service/api/v1alpha/BUILD.bazel | 4 +- .../api/v1alpha/ReportingSetsService.kt | 36 ++++++------- .../service/api/v1alpha/ReportsService.kt | 35 ++++++------- .../reporting/service/api/v2alpha/BUILD.bazel | 4 +- .../service/api/v2alpha/MetricsService.kt | 8 +-- .../service/api/v2alpha/ProtoConversions.kt | 2 +- .../measurement/api/v2alpha/page_token.proto | 33 +----------- .../measurement/reporting/v1alpha/BUILD.bazel | 21 ++++++++ .../reporting/v1alpha/page_token.proto | 40 +++++++++++++++ .../measurement/reporting/v2alpha/BUILD.bazel | 21 ++++++++ .../reporting/v2alpha/page_token.proto | 50 +++++++++++++++++++ .../api/v2alpha/EventGroupsServiceTest.kt | 32 ++++++------ .../api/v2alpha/MeasurementsServiceTest.kt | 32 ++++++------ .../api/v2alpha/RequisitionsServiceTest.kt | 32 ++++++------ .../api/v1alpha/ReportingSetsServiceTest.kt | 32 ++++++------ .../service/api/v1alpha/ReportsServiceTest.kt | 32 ++++++------ .../service/api/v2alpha/MetricsServiceTest.kt | 4 +- 20 files changed, 323 insertions(+), 203 deletions(-) create mode 100644 src/main/proto/wfa/measurement/reporting/v1alpha/page_token.proto create mode 100644 src/main/proto/wfa/measurement/reporting/v2alpha/page_token.proto diff --git a/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/EventGroupsService.kt b/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/EventGroupsService.kt index 13d59453e3e..934c8ebc2e8 100644 --- a/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/EventGroupsService.kt +++ b/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/EventGroupsService.kt @@ -1,16 +1,18 @@ -// Copyright 2020 The Cross-Media Measurement Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * Copyright 2020 The Cross-Media Measurement Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.wfanet.measurement.kingdom.service.api.v2alpha @@ -19,10 +21,6 @@ import io.grpc.StatusException import kotlin.math.min import kotlinx.coroutines.flow.toList import org.wfanet.measurement.api.Version -import org.wfanet.measurement.api.v2.alpha.ListEventGroupsPageToken -import org.wfanet.measurement.api.v2.alpha.ListEventGroupsPageTokenKt.previousPageEnd -import org.wfanet.measurement.api.v2.alpha.copy -import org.wfanet.measurement.api.v2.alpha.listEventGroupsPageToken import org.wfanet.measurement.api.v2alpha.CreateEventGroupRequest import org.wfanet.measurement.api.v2alpha.DataProviderKey import org.wfanet.measurement.api.v2alpha.DataProviderPrincipal @@ -32,6 +30,8 @@ import org.wfanet.measurement.api.v2alpha.EventGroupKey import org.wfanet.measurement.api.v2alpha.EventGroupKt.eventTemplate import org.wfanet.measurement.api.v2alpha.EventGroupsGrpcKt.EventGroupsCoroutineImplBase import org.wfanet.measurement.api.v2alpha.GetEventGroupRequest +import org.wfanet.measurement.api.v2alpha.ListEventGroupsPageToken +import org.wfanet.measurement.api.v2alpha.ListEventGroupsPageTokenKt.previousPageEnd import org.wfanet.measurement.api.v2alpha.ListEventGroupsRequest import org.wfanet.measurement.api.v2alpha.ListEventGroupsResponse import org.wfanet.measurement.api.v2alpha.MeasurementConsumerCertificateKey @@ -39,7 +39,9 @@ import org.wfanet.measurement.api.v2alpha.MeasurementConsumerKey import org.wfanet.measurement.api.v2alpha.MeasurementConsumerPrincipal import org.wfanet.measurement.api.v2alpha.MeasurementPrincipal import org.wfanet.measurement.api.v2alpha.UpdateEventGroupRequest +import org.wfanet.measurement.api.v2alpha.copy import org.wfanet.measurement.api.v2alpha.eventGroup +import org.wfanet.measurement.api.v2alpha.listEventGroupsPageToken import org.wfanet.measurement.api.v2alpha.listEventGroupsResponse import org.wfanet.measurement.api.v2alpha.principalFromCurrentContext import org.wfanet.measurement.api.v2alpha.signedData diff --git a/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementsService.kt b/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementsService.kt index 93640c4a9fe..b0a42c18bd3 100644 --- a/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementsService.kt +++ b/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementsService.kt @@ -1,16 +1,18 @@ -// Copyright 2021 The Cross-Media Measurement Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * Copyright 2021 The Cross-Media Measurement Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.wfanet.measurement.kingdom.service.api.v2alpha @@ -20,16 +22,14 @@ import io.grpc.StatusException import java.util.AbstractMap import kotlin.math.min import kotlinx.coroutines.flow.toList -import org.wfanet.measurement.api.v2.alpha.ListMeasurementsPageToken -import org.wfanet.measurement.api.v2.alpha.ListMeasurementsPageTokenKt.previousPageEnd -import org.wfanet.measurement.api.v2.alpha.copy -import org.wfanet.measurement.api.v2.alpha.listMeasurementsPageToken import org.wfanet.measurement.api.v2alpha.CancelMeasurementRequest import org.wfanet.measurement.api.v2alpha.CreateMeasurementRequest import org.wfanet.measurement.api.v2alpha.DataProviderCertificateKey import org.wfanet.measurement.api.v2alpha.DataProviderKey import org.wfanet.measurement.api.v2alpha.DifferentialPrivacyParams import org.wfanet.measurement.api.v2alpha.GetMeasurementRequest +import org.wfanet.measurement.api.v2alpha.ListMeasurementsPageToken +import org.wfanet.measurement.api.v2alpha.ListMeasurementsPageTokenKt.previousPageEnd import org.wfanet.measurement.api.v2alpha.ListMeasurementsRequest import org.wfanet.measurement.api.v2alpha.ListMeasurementsResponse import org.wfanet.measurement.api.v2alpha.Measurement @@ -41,6 +41,8 @@ import org.wfanet.measurement.api.v2alpha.MeasurementKey import org.wfanet.measurement.api.v2alpha.MeasurementPrincipal import org.wfanet.measurement.api.v2alpha.MeasurementSpec import org.wfanet.measurement.api.v2alpha.MeasurementsGrpcKt.MeasurementsCoroutineImplBase +import org.wfanet.measurement.api.v2alpha.copy +import org.wfanet.measurement.api.v2alpha.listMeasurementsPageToken import org.wfanet.measurement.api.v2alpha.listMeasurementsResponse import org.wfanet.measurement.api.v2alpha.principalFromCurrentContext import org.wfanet.measurement.common.base64UrlDecode diff --git a/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/RequisitionsService.kt b/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/RequisitionsService.kt index b0ef1330290..c5072bf74ea 100644 --- a/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/RequisitionsService.kt +++ b/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/RequisitionsService.kt @@ -1,16 +1,18 @@ -// Copyright 2020 The Cross-Media Measurement Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * Copyright 2020 The Cross-Media Measurement Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.wfanet.measurement.kingdom.service.api.v2alpha @@ -19,16 +21,14 @@ import io.grpc.StatusException import kotlin.math.min import kotlinx.coroutines.flow.toList import org.wfanet.measurement.api.Version -import org.wfanet.measurement.api.v2.alpha.ListRequisitionsPageToken -import org.wfanet.measurement.api.v2.alpha.ListRequisitionsPageTokenKt.previousPageEnd -import org.wfanet.measurement.api.v2.alpha.copy -import org.wfanet.measurement.api.v2.alpha.listRequisitionsPageToken import org.wfanet.measurement.api.v2alpha.DataProviderCertificateKey import org.wfanet.measurement.api.v2alpha.DataProviderKey import org.wfanet.measurement.api.v2alpha.DataProviderPrincipal import org.wfanet.measurement.api.v2alpha.DuchyCertificateKey import org.wfanet.measurement.api.v2alpha.FulfillDirectRequisitionRequest import org.wfanet.measurement.api.v2alpha.FulfillDirectRequisitionResponse +import org.wfanet.measurement.api.v2alpha.ListRequisitionsPageToken +import org.wfanet.measurement.api.v2alpha.ListRequisitionsPageTokenKt.previousPageEnd import org.wfanet.measurement.api.v2alpha.ListRequisitionsRequest import org.wfanet.measurement.api.v2alpha.ListRequisitionsResponse import org.wfanet.measurement.api.v2alpha.MeasurementConsumerCertificateKey @@ -47,8 +47,10 @@ import org.wfanet.measurement.api.v2alpha.RequisitionKt.DuchyEntryKt.value import org.wfanet.measurement.api.v2alpha.RequisitionKt.duchyEntry import org.wfanet.measurement.api.v2alpha.RequisitionKt.refusal import org.wfanet.measurement.api.v2alpha.RequisitionsGrpcKt.RequisitionsCoroutineImplBase +import org.wfanet.measurement.api.v2alpha.copy import org.wfanet.measurement.api.v2alpha.fulfillDirectRequisitionResponse import org.wfanet.measurement.api.v2alpha.getProviderFromContext +import org.wfanet.measurement.api.v2alpha.listRequisitionsPageToken import org.wfanet.measurement.api.v2alpha.listRequisitionsResponse import org.wfanet.measurement.api.v2alpha.principalFromCurrentContext import org.wfanet.measurement.api.v2alpha.requisition diff --git a/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/BUILD.bazel index b7ffee2cf44..ac23fc7812a 100644 --- a/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/BUILD.bazel @@ -19,8 +19,8 @@ kt_jvm_library( "//src/main/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha:principal_server_interceptor", "//src/main/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha:reporting_principal", "//src/main/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha:resource_key", - "//src/main/proto/wfa/measurement/api/v2alpha:page_token_kt_jvm_proto", "//src/main/proto/wfa/measurement/internal/reporting:reporting_sets_service_kt_jvm_grpc_proto", + "//src/main/proto/wfa/measurement/reporting/v1alpha:page_token_kt_jvm_proto", "//src/main/proto/wfa/measurement/reporting/v1alpha:reporting_sets_service_kt_jvm_grpc_proto", "@wfa_common_jvm//src/main/kotlin/org/wfanet/measurement/common", "@wfa_common_jvm//src/main/kotlin/org/wfanet/measurement/common/grpc", @@ -66,10 +66,10 @@ kt_jvm_library( "//src/main/proto/wfa/measurement/api/v2alpha:measurement_consumers_service_kt_jvm_grpc_proto", "//src/main/proto/wfa/measurement/api/v2alpha:measurement_kt_jvm_proto", "//src/main/proto/wfa/measurement/api/v2alpha:measurements_service_kt_jvm_grpc_proto", - "//src/main/proto/wfa/measurement/api/v2alpha:page_token_kt_jvm_proto", "//src/main/proto/wfa/measurement/internal/reporting:measurements_service_kt_jvm_grpc_proto", "//src/main/proto/wfa/measurement/internal/reporting:reporting_sets_service_kt_jvm_grpc_proto", "//src/main/proto/wfa/measurement/internal/reporting:reports_service_kt_jvm_grpc_proto", + "//src/main/proto/wfa/measurement/reporting/v1alpha:page_token_kt_jvm_proto", "//src/main/proto/wfa/measurement/reporting/v1alpha:reports_service_kt_jvm_grpc_proto", "@wfa_common_jvm//imports/java/com/google/protobuf/util", "@wfa_common_jvm//src/main/kotlin/org/wfanet/measurement/common", diff --git a/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/ReportingSetsService.kt b/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/ReportingSetsService.kt index c4b22487461..e1f69cbb74a 100644 --- a/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/ReportingSetsService.kt +++ b/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/ReportingSetsService.kt @@ -1,26 +1,24 @@ -// Copyright 2022 The Cross-Media Measurement Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * Copyright 2022 The Cross-Media Measurement Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.wfanet.measurement.reporting.service.api.v1alpha import io.grpc.Status import kotlin.math.min import kotlinx.coroutines.flow.toList -import org.wfanet.measurement.api.v2.alpha.ListReportingSetsPageToken -import org.wfanet.measurement.api.v2.alpha.ListReportingSetsPageTokenKt.previousPageEnd -import org.wfanet.measurement.api.v2.alpha.copy -import org.wfanet.measurement.api.v2.alpha.listReportingSetsPageToken import org.wfanet.measurement.api.v2alpha.MeasurementConsumerKey import org.wfanet.measurement.common.base64UrlDecode import org.wfanet.measurement.common.base64UrlEncode @@ -37,10 +35,14 @@ import org.wfanet.measurement.internal.reporting.StreamReportingSetsRequestKt.fi import org.wfanet.measurement.internal.reporting.reportingSet as internalReportingSet import org.wfanet.measurement.internal.reporting.streamReportingSetsRequest import org.wfanet.measurement.reporting.v1alpha.CreateReportingSetRequest +import org.wfanet.measurement.reporting.v1alpha.ListReportingSetsPageToken +import org.wfanet.measurement.reporting.v1alpha.ListReportingSetsPageTokenKt.previousPageEnd import org.wfanet.measurement.reporting.v1alpha.ListReportingSetsRequest import org.wfanet.measurement.reporting.v1alpha.ListReportingSetsResponse import org.wfanet.measurement.reporting.v1alpha.ReportingSet import org.wfanet.measurement.reporting.v1alpha.ReportingSetsGrpcKt.ReportingSetsCoroutineImplBase +import org.wfanet.measurement.reporting.v1alpha.copy +import org.wfanet.measurement.reporting.v1alpha.listReportingSetsPageToken import org.wfanet.measurement.reporting.v1alpha.listReportingSetsResponse import org.wfanet.measurement.reporting.v1alpha.reportingSet diff --git a/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/ReportsService.kt b/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/ReportsService.kt index c31bb33fba2..3a33025ee82 100644 --- a/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/ReportsService.kt +++ b/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/ReportsService.kt @@ -1,16 +1,18 @@ -// Copyright 2022 The Cross-Media Measurement Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * Copyright 2022 The Cross-Media Measurement Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.wfanet.measurement.reporting.service.api.v1alpha @@ -34,10 +36,6 @@ import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.flow.toList -import org.wfanet.measurement.api.v2.alpha.ListReportsPageToken -import org.wfanet.measurement.api.v2.alpha.ListReportsPageTokenKt.previousPageEnd -import org.wfanet.measurement.api.v2.alpha.copy -import org.wfanet.measurement.api.v2.alpha.listReportsPageToken import org.wfanet.measurement.api.v2alpha.Certificate import org.wfanet.measurement.api.v2alpha.CertificatesGrpcKt.CertificatesCoroutineStub import org.wfanet.measurement.api.v2alpha.CreateMeasurementRequest @@ -139,6 +137,8 @@ import org.wfanet.measurement.internal.reporting.timeIntervals as internalTimeIn import org.wfanet.measurement.reporting.service.api.EncryptionKeyPairStore import org.wfanet.measurement.reporting.v1alpha.CreateReportRequest import org.wfanet.measurement.reporting.v1alpha.GetReportRequest +import org.wfanet.measurement.reporting.v1alpha.ListReportsPageToken +import org.wfanet.measurement.reporting.v1alpha.ListReportsPageTokenKt.previousPageEnd import org.wfanet.measurement.reporting.v1alpha.ListReportsRequest import org.wfanet.measurement.reporting.v1alpha.ListReportsResponse import org.wfanet.measurement.reporting.v1alpha.Metric @@ -170,6 +170,7 @@ import org.wfanet.measurement.reporting.v1alpha.ReportsGrpcKt.ReportsCoroutineIm import org.wfanet.measurement.reporting.v1alpha.TimeInterval import org.wfanet.measurement.reporting.v1alpha.TimeIntervals import org.wfanet.measurement.reporting.v1alpha.copy +import org.wfanet.measurement.reporting.v1alpha.listReportsPageToken import org.wfanet.measurement.reporting.v1alpha.listReportsResponse import org.wfanet.measurement.reporting.v1alpha.metric import org.wfanet.measurement.reporting.v1alpha.periodicTimeInterval diff --git a/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/BUILD.bazel index dfc0ccd518a..6721e1b16a9 100644 --- a/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/BUILD.bazel @@ -68,12 +68,12 @@ kt_jvm_library( "//src/main/proto/wfa/measurement/api/v2alpha:measurement_consumers_service_kt_jvm_grpc_proto", "//src/main/proto/wfa/measurement/api/v2alpha:measurement_kt_jvm_proto", "//src/main/proto/wfa/measurement/api/v2alpha:measurements_service_kt_jvm_grpc_proto", - "//src/main/proto/wfa/measurement/api/v2alpha:page_token_kt_jvm_proto", "//src/main/proto/wfa/measurement/config/reporting:metric_spec_config_kt_jvm_proto", "//src/main/proto/wfa/measurement/internal/reporting/v2:measurements_service_kt_jvm_grpc_proto", "//src/main/proto/wfa/measurement/internal/reporting/v2:metrics_service_kt_jvm_grpc_proto", "//src/main/proto/wfa/measurement/internal/reporting/v2:reporting_sets_service_kt_jvm_grpc_proto", "//src/main/proto/wfa/measurement/reporting/v2alpha:metrics_service_kt_jvm_grpc_proto", + "//src/main/proto/wfa/measurement/reporting/v2alpha:page_token_kt_jvm_proto", "@wfa_common_jvm//imports/java/com/google/protobuf/util", "@wfa_common_jvm//src/main/kotlin/org/wfanet/measurement/common", "@wfa_common_jvm//src/main/kotlin/org/wfanet/measurement/common/identity", @@ -98,12 +98,12 @@ kt_jvm_library( "//src/main/proto/wfa/measurement/api/v2alpha:measurement_consumers_service_kt_jvm_grpc_proto", "//src/main/proto/wfa/measurement/api/v2alpha:measurement_kt_jvm_proto", "//src/main/proto/wfa/measurement/api/v2alpha:measurements_service_kt_jvm_grpc_proto", - "//src/main/proto/wfa/measurement/api/v2alpha:page_token_kt_jvm_proto", "//src/main/proto/wfa/measurement/config/reporting:metric_spec_config_kt_jvm_proto", "//src/main/proto/wfa/measurement/internal/reporting/v2:measurements_service_kt_jvm_grpc_proto", "//src/main/proto/wfa/measurement/internal/reporting/v2:metrics_service_kt_jvm_grpc_proto", "//src/main/proto/wfa/measurement/internal/reporting/v2:reporting_sets_service_kt_jvm_grpc_proto", "//src/main/proto/wfa/measurement/reporting/v2alpha:metrics_service_kt_jvm_grpc_proto", + "//src/main/proto/wfa/measurement/reporting/v2alpha:page_token_kt_jvm_proto", "@wfa_common_jvm//imports/java/com/google/protobuf/util", "@wfa_common_jvm//src/main/kotlin/org/wfanet/measurement/common", "@wfa_common_jvm//src/main/kotlin/org/wfanet/measurement/common/crypto:security_provider", diff --git a/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/MetricsService.kt b/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/MetricsService.kt index ac9e0770a07..c02a3ba73e6 100644 --- a/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/MetricsService.kt +++ b/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/MetricsService.kt @@ -39,10 +39,6 @@ import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.flow.toList import kotlinx.coroutines.withContext import org.jetbrains.annotations.BlockingExecutor -import org.wfanet.measurement.api.v2.alpha.ListMetricsPageToken -import org.wfanet.measurement.api.v2.alpha.ListMetricsPageTokenKt.previousPageEnd -import org.wfanet.measurement.api.v2.alpha.copy -import org.wfanet.measurement.api.v2.alpha.listMetricsPageToken import org.wfanet.measurement.api.v2alpha.Certificate import org.wfanet.measurement.api.v2alpha.CertificatesGrpcKt.CertificatesCoroutineStub import org.wfanet.measurement.api.v2alpha.CreateMeasurementRequest @@ -127,6 +123,8 @@ import org.wfanet.measurement.reporting.v2alpha.BatchGetMetricsRequest import org.wfanet.measurement.reporting.v2alpha.BatchGetMetricsResponse import org.wfanet.measurement.reporting.v2alpha.CreateMetricRequest import org.wfanet.measurement.reporting.v2alpha.GetMetricRequest +import org.wfanet.measurement.reporting.v2alpha.ListMetricsPageToken +import org.wfanet.measurement.reporting.v2alpha.ListMetricsPageTokenKt.previousPageEnd import org.wfanet.measurement.reporting.v2alpha.ListMetricsRequest import org.wfanet.measurement.reporting.v2alpha.ListMetricsResponse import org.wfanet.measurement.reporting.v2alpha.Metric @@ -141,6 +139,8 @@ import org.wfanet.measurement.reporting.v2alpha.MetricSpec import org.wfanet.measurement.reporting.v2alpha.MetricsGrpcKt.MetricsCoroutineImplBase import org.wfanet.measurement.reporting.v2alpha.batchCreateMetricsResponse import org.wfanet.measurement.reporting.v2alpha.batchGetMetricsResponse +import org.wfanet.measurement.reporting.v2alpha.copy +import org.wfanet.measurement.reporting.v2alpha.listMetricsPageToken import org.wfanet.measurement.reporting.v2alpha.listMetricsResponse import org.wfanet.measurement.reporting.v2alpha.metric import org.wfanet.measurement.reporting.v2alpha.metricResult diff --git a/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/ProtoConversions.kt b/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/ProtoConversions.kt index 83d34954364..802c37f9e18 100644 --- a/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/ProtoConversions.kt +++ b/src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/ProtoConversions.kt @@ -16,7 +16,6 @@ package org.wfanet.measurement.reporting.service.api.v2alpha -import org.wfanet.measurement.api.v2.alpha.ListMetricsPageToken import org.wfanet.measurement.api.v2alpha.DifferentialPrivacyParams import org.wfanet.measurement.api.v2alpha.Measurement import org.wfanet.measurement.api.v2alpha.MeasurementSpec @@ -35,6 +34,7 @@ import org.wfanet.measurement.internal.reporting.v2.StreamMetricsRequestKt import org.wfanet.measurement.internal.reporting.v2.TimeInterval as InternalTimeInterval import org.wfanet.measurement.internal.reporting.v2.streamMetricsRequest import org.wfanet.measurement.internal.reporting.v2.timeInterval as internalTimeInterval +import org.wfanet.measurement.reporting.v2alpha.ListMetricsPageToken import org.wfanet.measurement.reporting.v2alpha.MetricSpec import org.wfanet.measurement.reporting.v2alpha.MetricSpecKt import org.wfanet.measurement.reporting.v2alpha.TimeInterval diff --git a/src/main/proto/wfa/measurement/api/v2alpha/page_token.proto b/src/main/proto/wfa/measurement/api/v2alpha/page_token.proto index 0a512a2f024..8fe38e01458 100644 --- a/src/main/proto/wfa/measurement/api/v2alpha/page_token.proto +++ b/src/main/proto/wfa/measurement/api/v2alpha/page_token.proto @@ -20,8 +20,7 @@ import "google/protobuf/timestamp.proto"; import "wfa/measurement/api/v2alpha/measurement.proto"; import "wfa/measurement/api/v2alpha/requisition.proto"; -// TODO(riemanli): Fix the package version to v2alpha. -option java_package = "org.wfanet.measurement.api.v2.alpha"; +option java_package = "org.wfanet.measurement.api.v2alpha"; option java_multiple_files = true; message ListEventGroupsPageToken { @@ -60,33 +59,3 @@ message ListRequisitionsPageToken { PreviousPageEnd last_requisition = 6; repeated Measurement.State measurement_states = 7; } - -message ListReportingSetsPageToken { - int32 page_size = 1; - string measurement_consumer_reference_id = 2; - message PreviousPageEnd { - string measurement_consumer_reference_id = 1; - fixed64 external_reporting_set_id = 2; - } - PreviousPageEnd last_reporting_set = 3; -} - -message ListReportsPageToken { - int32 page_size = 1; - string measurement_consumer_reference_id = 2; - message PreviousPageEnd { - string measurement_consumer_reference_id = 1; - fixed64 external_report_id = 2; - } - PreviousPageEnd last_report = 3; -} - -message ListMetricsPageToken { - int32 page_size = 1; - string cmms_measurement_consumer_id = 2; - message PreviousPageEnd { - string cmms_measurement_consumer_id = 1; - fixed64 external_metric_id = 2; - } - PreviousPageEnd last_metric = 3; -} diff --git a/src/main/proto/wfa/measurement/reporting/v1alpha/BUILD.bazel b/src/main/proto/wfa/measurement/reporting/v1alpha/BUILD.bazel index 0def5f34a9a..5aec15c46a2 100644 --- a/src/main/proto/wfa/measurement/reporting/v1alpha/BUILD.bazel +++ b/src/main/proto/wfa/measurement/reporting/v1alpha/BUILD.bazel @@ -96,6 +96,27 @@ proto_library( ], ) +proto_library( + name = "page_token_proto", + srcs = ["page_token.proto"], + deps = [], +) + +java_proto_library( + name = "page_token_java_proto", + deps = [ + ":page_token_proto", + ], +) + +kt_jvm_proto_library( + name = "page_token_kt_jvm_proto", + srcs = [ + ":page_token_proto", + ], + deps = [":page_token_java_proto"], +) + # Services. proto_library( diff --git a/src/main/proto/wfa/measurement/reporting/v1alpha/page_token.proto b/src/main/proto/wfa/measurement/reporting/v1alpha/page_token.proto new file mode 100644 index 00000000000..159cee195ad --- /dev/null +++ b/src/main/proto/wfa/measurement/reporting/v1alpha/page_token.proto @@ -0,0 +1,40 @@ +// Copyright 2023 The Cross-Media Measurement Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package wfa.measurement.reporting.v1alpha; + +option java_package = "org.wfanet.measurement.reporting.v1alpha"; +option java_multiple_files = true; + +message ListReportingSetsPageToken { + int32 page_size = 1; + string measurement_consumer_reference_id = 2; + message PreviousPageEnd { + string measurement_consumer_reference_id = 1; + fixed64 external_reporting_set_id = 2; + } + PreviousPageEnd last_reporting_set = 3; +} + +message ListReportsPageToken { + int32 page_size = 1; + string measurement_consumer_reference_id = 2; + message PreviousPageEnd { + string measurement_consumer_reference_id = 1; + fixed64 external_report_id = 2; + } + PreviousPageEnd last_report = 3; +} diff --git a/src/main/proto/wfa/measurement/reporting/v2alpha/BUILD.bazel b/src/main/proto/wfa/measurement/reporting/v2alpha/BUILD.bazel index 70eedef67f4..907bd29d804 100644 --- a/src/main/proto/wfa/measurement/reporting/v2alpha/BUILD.bazel +++ b/src/main/proto/wfa/measurement/reporting/v2alpha/BUILD.bazel @@ -110,6 +110,27 @@ proto_library( ], ) +proto_library( + name = "page_token_proto", + srcs = ["page_token.proto"], + deps = [], +) + +java_proto_library( + name = "page_token_java_proto", + deps = [ + ":page_token_proto", + ], +) + +kt_jvm_proto_library( + name = "page_token_kt_jvm_proto", + srcs = [ + ":page_token_proto", + ], + deps = [":page_token_java_proto"], +) + # Services. proto_library( diff --git a/src/main/proto/wfa/measurement/reporting/v2alpha/page_token.proto b/src/main/proto/wfa/measurement/reporting/v2alpha/page_token.proto new file mode 100644 index 00000000000..472a0de710d --- /dev/null +++ b/src/main/proto/wfa/measurement/reporting/v2alpha/page_token.proto @@ -0,0 +1,50 @@ +// Copyright 2023 The Cross-Media Measurement Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package wfa.measurement.reporting.v2alpha; + +option java_package = "org.wfanet.measurement.reporting.v2alpha"; +option java_multiple_files = true; + +message ListReportingSetsPageToken { + int32 page_size = 1; + string cmms_measurement_consumer_id = 2; + message PreviousPageEnd { + string cmms_measurement_consumer_id = 1; + fixed64 external_reporting_set_id = 2; + } + PreviousPageEnd last_reporting_set = 3; +} + +message ListReportsPageToken { + int32 page_size = 1; + string cmms_measurement_consumer_id = 2; + message PreviousPageEnd { + string cmms_measurement_consumer_id = 1; + fixed64 external_report_id = 2; + } + PreviousPageEnd last_report = 3; +} + +message ListMetricsPageToken { + int32 page_size = 1; + string cmms_measurement_consumer_id = 2; + message PreviousPageEnd { + string cmms_measurement_consumer_id = 1; + fixed64 external_metric_id = 2; + } + PreviousPageEnd last_metric = 3; +} diff --git a/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/EventGroupsServiceTest.kt b/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/EventGroupsServiceTest.kt index ede5313f420..afd7ebab296 100644 --- a/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/EventGroupsServiceTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/EventGroupsServiceTest.kt @@ -1,16 +1,18 @@ -// Copyright 2020 The Cross-Media Measurement Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * Copyright 2020 The Cross-Media Measurement Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.wfanet.measurement.kingdom.service.api.v2alpha @@ -32,12 +34,11 @@ import org.junit.runners.JUnit4 import org.mockito.kotlin.any import org.mockito.kotlin.verify import org.wfanet.measurement.api.Version -import org.wfanet.measurement.api.v2.alpha.ListEventGroupsPageTokenKt.previousPageEnd -import org.wfanet.measurement.api.v2.alpha.listEventGroupsPageToken import org.wfanet.measurement.api.v2alpha.DataProviderKey import org.wfanet.measurement.api.v2alpha.EventGroup import org.wfanet.measurement.api.v2alpha.EventGroupKey import org.wfanet.measurement.api.v2alpha.EventGroupKt +import org.wfanet.measurement.api.v2alpha.ListEventGroupsPageTokenKt.previousPageEnd import org.wfanet.measurement.api.v2alpha.ListEventGroupsRequest import org.wfanet.measurement.api.v2alpha.ListEventGroupsRequestKt.filter import org.wfanet.measurement.api.v2alpha.MeasurementConsumerCertificateKey @@ -47,6 +48,7 @@ import org.wfanet.measurement.api.v2alpha.createEventGroupRequest import org.wfanet.measurement.api.v2alpha.deleteEventGroupRequest import org.wfanet.measurement.api.v2alpha.eventGroup import org.wfanet.measurement.api.v2alpha.getEventGroupRequest +import org.wfanet.measurement.api.v2alpha.listEventGroupsPageToken import org.wfanet.measurement.api.v2alpha.listEventGroupsRequest import org.wfanet.measurement.api.v2alpha.listEventGroupsResponse import org.wfanet.measurement.api.v2alpha.signedData diff --git a/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementsServiceTest.kt b/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementsServiceTest.kt index fbed4deb1a5..aa0b73483b6 100644 --- a/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementsServiceTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementsServiceTest.kt @@ -1,16 +1,18 @@ -// Copyright 2021 The Cross-Media Measurement Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * Copyright 2021 The Cross-Media Measurement Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.wfanet.measurement.kingdom.service.api.v2alpha @@ -35,13 +37,12 @@ import org.mockito.kotlin.stub import org.mockito.kotlin.verify import org.mockito.kotlin.whenever import org.wfanet.measurement.api.Version -import org.wfanet.measurement.api.v2.alpha.ListMeasurementsPageTokenKt.previousPageEnd -import org.wfanet.measurement.api.v2.alpha.listMeasurementsPageToken import org.wfanet.measurement.api.v2alpha.CancelMeasurementRequest import org.wfanet.measurement.api.v2alpha.DataProviderCertificateKey import org.wfanet.measurement.api.v2alpha.DataProviderKey import org.wfanet.measurement.api.v2alpha.DuchyCertificateKey import org.wfanet.measurement.api.v2alpha.GetMeasurementRequest +import org.wfanet.measurement.api.v2alpha.ListMeasurementsPageTokenKt.previousPageEnd import org.wfanet.measurement.api.v2alpha.ListMeasurementsRequest import org.wfanet.measurement.api.v2alpha.ListMeasurementsRequestKt.filter import org.wfanet.measurement.api.v2alpha.Measurement.Failure @@ -68,6 +69,7 @@ import org.wfanet.measurement.api.v2alpha.createMeasurementRequest import org.wfanet.measurement.api.v2alpha.differentialPrivacyParams import org.wfanet.measurement.api.v2alpha.getMeasurementRequest import org.wfanet.measurement.api.v2alpha.liquidLegionsSketchParams +import org.wfanet.measurement.api.v2alpha.listMeasurementsPageToken import org.wfanet.measurement.api.v2alpha.listMeasurementsRequest import org.wfanet.measurement.api.v2alpha.listMeasurementsResponse import org.wfanet.measurement.api.v2alpha.measurement diff --git a/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/RequisitionsServiceTest.kt b/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/RequisitionsServiceTest.kt index 345f248975e..a501bdfa54c 100644 --- a/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/RequisitionsServiceTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/RequisitionsServiceTest.kt @@ -1,16 +1,18 @@ -// Copyright 2020 The Cross-Media Measurement Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * Copyright 2020 The Cross-Media Measurement Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.wfanet.measurement.kingdom.service.api.v2alpha @@ -34,9 +36,8 @@ import org.mockito.kotlin.any import org.mockito.kotlin.verify import org.mockito.kotlin.whenever import org.wfanet.measurement.api.Version -import org.wfanet.measurement.api.v2.alpha.ListRequisitionsPageTokenKt.previousPageEnd -import org.wfanet.measurement.api.v2.alpha.listRequisitionsPageToken import org.wfanet.measurement.api.v2alpha.DataProviderCertificateKey +import org.wfanet.measurement.api.v2alpha.ListRequisitionsPageTokenKt.previousPageEnd import org.wfanet.measurement.api.v2alpha.ListRequisitionsRequestKt.filter import org.wfanet.measurement.api.v2alpha.Measurement import org.wfanet.measurement.api.v2alpha.MeasurementConsumerCertificateKey @@ -57,6 +58,7 @@ import org.wfanet.measurement.api.v2alpha.copy import org.wfanet.measurement.api.v2alpha.differentialPrivacyParams import org.wfanet.measurement.api.v2alpha.fulfillDirectRequisitionRequest import org.wfanet.measurement.api.v2alpha.fulfillDirectRequisitionResponse +import org.wfanet.measurement.api.v2alpha.listRequisitionsPageToken import org.wfanet.measurement.api.v2alpha.listRequisitionsRequest import org.wfanet.measurement.api.v2alpha.listRequisitionsResponse import org.wfanet.measurement.api.v2alpha.measurementSpec diff --git a/src/test/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/ReportingSetsServiceTest.kt b/src/test/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/ReportingSetsServiceTest.kt index 6b49cefc2f9..fcff3a4bab6 100644 --- a/src/test/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/ReportingSetsServiceTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/ReportingSetsServiceTest.kt @@ -1,16 +1,18 @@ -// Copyright 2022 The Cross-Media Measurement Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * Copyright 2022 The Cross-Media Measurement Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.wfanet.measurement.reporting.service.api.v1alpha @@ -27,8 +29,6 @@ import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.JUnit4 import org.mockito.kotlin.any -import org.wfanet.measurement.api.v2.alpha.ListReportingSetsPageTokenKt.previousPageEnd -import org.wfanet.measurement.api.v2.alpha.listReportingSetsPageToken import org.wfanet.measurement.api.v2alpha.DataProviderKey import org.wfanet.measurement.api.v2alpha.MeasurementConsumerKey import org.wfanet.measurement.api.v2alpha.withDataProviderPrincipal @@ -46,10 +46,12 @@ import org.wfanet.measurement.internal.reporting.StreamReportingSetsRequestKt import org.wfanet.measurement.internal.reporting.copy import org.wfanet.measurement.internal.reporting.reportingSet as internalReportingSet import org.wfanet.measurement.internal.reporting.streamReportingSetsRequest +import org.wfanet.measurement.reporting.v1alpha.ListReportingSetsPageTokenKt.previousPageEnd import org.wfanet.measurement.reporting.v1alpha.ListReportingSetsRequest import org.wfanet.measurement.reporting.v1alpha.ReportingSet import org.wfanet.measurement.reporting.v1alpha.copy import org.wfanet.measurement.reporting.v1alpha.createReportingSetRequest +import org.wfanet.measurement.reporting.v1alpha.listReportingSetsPageToken import org.wfanet.measurement.reporting.v1alpha.listReportingSetsRequest import org.wfanet.measurement.reporting.v1alpha.listReportingSetsResponse import org.wfanet.measurement.reporting.v1alpha.reportingSet diff --git a/src/test/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/ReportsServiceTest.kt b/src/test/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/ReportsServiceTest.kt index 2f18c2f52fd..1fb73fcfdfb 100644 --- a/src/test/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/ReportsServiceTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/reporting/service/api/v1alpha/ReportsServiceTest.kt @@ -1,16 +1,18 @@ -// Copyright 2022 The Cross-Media Measurement Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * Copyright 2022 The Cross-Media Measurement Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.wfanet.measurement.reporting.service.api.v1alpha @@ -48,8 +50,6 @@ import org.mockito.kotlin.times import org.mockito.kotlin.verify import org.mockito.kotlin.verifyBlocking import org.mockito.kotlin.whenever -import org.wfanet.measurement.api.v2.alpha.ListReportsPageTokenKt.previousPageEnd -import org.wfanet.measurement.api.v2.alpha.listReportsPageToken import org.wfanet.measurement.api.v2alpha.Certificate import org.wfanet.measurement.api.v2alpha.CertificatesGrpcKt.CertificatesCoroutineImplBase import org.wfanet.measurement.api.v2alpha.CertificatesGrpcKt.CertificatesCoroutineStub @@ -164,6 +164,7 @@ import org.wfanet.measurement.internal.reporting.streamReportsRequest import org.wfanet.measurement.internal.reporting.timeInterval as internalTimeInterval import org.wfanet.measurement.internal.reporting.timeIntervals as internalTimeIntervals import org.wfanet.measurement.reporting.service.api.InMemoryEncryptionKeyPairStore +import org.wfanet.measurement.reporting.v1alpha.ListReportsPageTokenKt.previousPageEnd import org.wfanet.measurement.reporting.v1alpha.ListReportsRequest import org.wfanet.measurement.reporting.v1alpha.Metric.SetOperation import org.wfanet.measurement.reporting.v1alpha.MetricKt.SetOperationKt @@ -184,6 +185,7 @@ import org.wfanet.measurement.reporting.v1alpha.ReportKt.eventGroupUniverse import org.wfanet.measurement.reporting.v1alpha.copy import org.wfanet.measurement.reporting.v1alpha.createReportRequest import org.wfanet.measurement.reporting.v1alpha.getReportRequest +import org.wfanet.measurement.reporting.v1alpha.listReportsPageToken import org.wfanet.measurement.reporting.v1alpha.listReportsRequest import org.wfanet.measurement.reporting.v1alpha.listReportsResponse import org.wfanet.measurement.reporting.v1alpha.metric diff --git a/src/test/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/MetricsServiceTest.kt b/src/test/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/MetricsServiceTest.kt index e57ba83e61f..464f0ef3f25 100644 --- a/src/test/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/MetricsServiceTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha/MetricsServiceTest.kt @@ -50,8 +50,6 @@ import org.mockito.kotlin.stub import org.mockito.kotlin.times import org.mockito.kotlin.verifyBlocking import org.mockito.kotlin.whenever -import org.wfanet.measurement.api.v2.alpha.ListMetricsPageTokenKt.previousPageEnd -import org.wfanet.measurement.api.v2.alpha.listMetricsPageToken import org.wfanet.measurement.api.v2alpha.Certificate import org.wfanet.measurement.api.v2alpha.CertificatesGrpcKt import org.wfanet.measurement.api.v2alpha.CreateMeasurementRequest @@ -166,6 +164,7 @@ import org.wfanet.measurement.internal.reporting.v2.reportingSet as internalRepo import org.wfanet.measurement.internal.reporting.v2.streamMetricsRequest import org.wfanet.measurement.internal.reporting.v2.timeInterval as internalTimeInterval import org.wfanet.measurement.reporting.service.api.InMemoryEncryptionKeyPairStore +import org.wfanet.measurement.reporting.v2alpha.ListMetricsPageTokenKt.previousPageEnd import org.wfanet.measurement.reporting.v2alpha.ListMetricsRequest import org.wfanet.measurement.reporting.v2alpha.Metric import org.wfanet.measurement.reporting.v2alpha.MetricResultKt @@ -181,6 +180,7 @@ import org.wfanet.measurement.reporting.v2alpha.batchGetMetricsResponse import org.wfanet.measurement.reporting.v2alpha.copy import org.wfanet.measurement.reporting.v2alpha.createMetricRequest import org.wfanet.measurement.reporting.v2alpha.getMetricRequest +import org.wfanet.measurement.reporting.v2alpha.listMetricsPageToken import org.wfanet.measurement.reporting.v2alpha.listMetricsRequest import org.wfanet.measurement.reporting.v2alpha.listMetricsResponse import org.wfanet.measurement.reporting.v2alpha.metric