• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2024 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 static com.android.adservices.service.stats.AdsRelevanceStatusUtils.JS_RUN_STATUS_UNSET;
20 
21 import com.google.auto.value.AutoValue;
22 
23 /** Class for ReportImpression API Called stats. */
24 @AutoValue
25 public abstract class ReportImpressionApiCalledStats {
26 
27     /** Whether the BuyerContextualSignals contained ad cost. */
getReportWinBuyerAdditionalSignalsContainedAdCost()28     public abstract boolean getReportWinBuyerAdditionalSignalsContainedAdCost();
29 
30     /** Whether the BuyerContextualSignals contained data version. */
getReportWinBuyerAdditionalSignalsContainedDataVersion()31     public abstract boolean getReportWinBuyerAdditionalSignalsContainedDataVersion();
32 
33     /** Whether the SellerContextualSignals contained data version. */
getReportResultSellerAdditionalSignalsContainedDataVersion()34     public abstract boolean getReportResultSellerAdditionalSignalsContainedDataVersion();
35 
36     /** Result code of the buyer JS script (reportWin). */
37     @AdsRelevanceStatusUtils.JsRunStatus
getReportWinJsScriptResultCode()38     public abstract int getReportWinJsScriptResultCode();
39 
40     /** Result code of the seller JS script (reportResult). */
41     @AdsRelevanceStatusUtils.JsRunStatus
getReportResultJsScriptResultCode()42     public abstract int getReportResultJsScriptResultCode();
43 
44     /** Returns a generic builder. */
builder()45     public static Builder builder() {
46         return new AutoValue_ReportImpressionApiCalledStats.Builder()
47                 .setReportWinJsScriptResultCode(JS_RUN_STATUS_UNSET)
48                 .setReportResultJsScriptResultCode(JS_RUN_STATUS_UNSET);
49     }
50 
51     /** Builder class for ReportImpressionApiCalledStats. */
52     @AutoValue.Builder
53     public abstract static class Builder {
54         /** Sets whether the BuyerContextualSignals contained ad cost. */
setReportWinBuyerAdditionalSignalsContainedAdCost( boolean reportWinBuyerAdditionalSignalsContainedAdCost)55         public abstract Builder setReportWinBuyerAdditionalSignalsContainedAdCost(
56                 boolean reportWinBuyerAdditionalSignalsContainedAdCost);
57 
58         /** Sets whether the BuyerContextualSignals contained data version. */
setReportWinBuyerAdditionalSignalsContainedDataVersion( boolean reportWinBuyerAdditionalSignalsContainedDataVersion)59         public abstract Builder setReportWinBuyerAdditionalSignalsContainedDataVersion(
60                 boolean reportWinBuyerAdditionalSignalsContainedDataVersion);
61 
62         /** Sets whether the SellerContextualSignals contained data version. */
setReportResultSellerAdditionalSignalsContainedDataVersion( boolean reportResultSellerAdditionalSignalsContainedDataVersion)63         public abstract Builder setReportResultSellerAdditionalSignalsContainedDataVersion(
64                 boolean reportResultSellerAdditionalSignalsContainedDataVersion);
65 
66         /** Sets the result code of the buyer JS script (reportWin). */
setReportWinJsScriptResultCode( @dsRelevanceStatusUtils.JsRunStatus int resultCode)67         public abstract Builder setReportWinJsScriptResultCode(
68                 @AdsRelevanceStatusUtils.JsRunStatus int resultCode);
69 
70         /** Sets the result code of the seller JS script (reportResult). */
setReportResultJsScriptResultCode( @dsRelevanceStatusUtils.JsRunStatus int resultCode)71         public abstract Builder setReportResultJsScriptResultCode(
72                 @AdsRelevanceStatusUtils.JsRunStatus int resultCode);
73 
74         /** Builds the {@link ReportImpressionApiCalledStats} object. */
build()75         public abstract ReportImpressionApiCalledStats build();
76     }
77 }
78