1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.adservices.service.stats;
18 
19 import com.google.auto.value.AutoValue;
20 
21 /** Class for beacon level reporting for clearing interaction reporting table stats. */
22 @AutoValue
23 public abstract class InteractionReportingTableClearedStats {
24     private static final int NUM_UNREPORTED_URIS_UNSET = -1;
25 
26     /** @return number of registered URIs cleared every 24 hours. */
getNumUrisCleared()27     public abstract int getNumUrisCleared();
28 
29     /** @return number of unreported URIs before clearing. */
getNumUnreportedUris()30     public abstract int getNumUnreportedUris();
31 
32     /** @return generic builder. */
builder()33     public static Builder builder() {
34         // TODO(b/314210005): Update db schema to support "number of unreported URIs" metric
35         return new AutoValue_InteractionReportingTableClearedStats.Builder()
36                 .setNumUnreportedUris(NUM_UNREPORTED_URIS_UNSET);
37     }
38 
39     /** Builder class for InteractionReportingTableClearedStats. */
40     @AutoValue.Builder
41     public abstract static class Builder {
setNumUrisCleared(int value)42         public abstract Builder setNumUrisCleared(int value);
43 
setNumUnreportedUris(int value)44         public abstract Builder setNumUnreportedUris(int value);
45 
build()46         public abstract InteractionReportingTableClearedStats build();
47     }
48 }
49