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.AdServicesLoggerUtil.FIELD_UNSET; 20 21 import com.google.auto.value.AutoValue; 22 23 /** Class for buyer input generated for getAdSelectionData api stats. */ 24 @AutoValue 25 public abstract class GetAdSelectionDataBuyerInputGeneratedStats { 26 /** Returns the number of custom audiences in this buyer input */ getNumCustomAudiences()27 public abstract int getNumCustomAudiences(); 28 29 /** Returns the number of custom audiences opting into the omit-ads feature */ getNumCustomAudiencesOmitAds()30 public abstract int getNumCustomAudiencesOmitAds(); 31 32 /** Returns the mean of the size of a custom audience for this buyer input */ getCustomAudienceSizeMeanB()33 public abstract float getCustomAudienceSizeMeanB(); 34 35 /** Returns the variance of the size of a custom audience for this buyer input */ getCustomAudienceSizeVarianceB()36 public abstract float getCustomAudienceSizeVarianceB(); 37 38 /** Returns the mean of the size of the trusted bidding signals keys for this buyer input */ getTrustedBiddingSignalsKeysSizeMeanB()39 public abstract float getTrustedBiddingSignalsKeysSizeMeanB(); 40 41 /** Returns the variance of the size of the trusted bidding signals keys for this buyer input */ getTrustedBiddingSignalsKeysSizeVarianceB()42 public abstract float getTrustedBiddingSignalsKeysSizeVarianceB(); 43 44 /** Returns the mean of the size of the user bidding signals for this buyer input */ getUserBiddingSignalsSizeMeanB()45 public abstract float getUserBiddingSignalsSizeMeanB(); 46 47 /** Returns the variance of the size of the user bidding signals for this buyer input */ getUserBiddingSignalsSizeVarianceB()48 public abstract float getUserBiddingSignalsSizeVarianceB(); 49 50 /** Returns number of encoded signals payloads included in the auctions */ getNumEncodedSignals()51 public abstract int getNumEncodedSignals(); 52 53 /** Returns mean size of encoded signals payloads */ getEncodedSignalsSizeMean()54 public abstract int getEncodedSignalsSizeMean(); 55 56 /** Returns max size of encoded signals payloads */ getEncodedSignalsSizeMax()57 public abstract int getEncodedSignalsSizeMax(); 58 59 /** Returns min size of encoded signals payloads */ getEncodedSignalsSizeMin()60 public abstract int getEncodedSignalsSizeMin(); 61 62 /** Returns a generic builder. */ builder()63 public static Builder builder() { 64 return new AutoValue_GetAdSelectionDataBuyerInputGeneratedStats.Builder() 65 .setNumEncodedSignals(FIELD_UNSET) 66 .setEncodedSignalsSizeMax(FIELD_UNSET) 67 .setEncodedSignalsSizeMin(FIELD_UNSET) 68 .setEncodedSignalsSizeMean(FIELD_UNSET); 69 } 70 71 /** Builder class for GetAdSelectionDataBuyerInputGeneratedStats. */ 72 @AutoValue.Builder 73 public abstract static class Builder { 74 /** Sets the number of custom audiences. */ setNumCustomAudiences(int numCustomAudiences)75 public abstract Builder setNumCustomAudiences(int numCustomAudiences); 76 77 /** Sets the number of custom audiences omitting ads. */ setNumCustomAudiencesOmitAds(int numCustomAudiencesOmitAds)78 public abstract Builder setNumCustomAudiencesOmitAds(int numCustomAudiencesOmitAds); 79 80 /** Sets the mean of the size of a custom audience for this buyer input. */ setCustomAudienceSizeMeanB(float customAudienceSizeMeanB)81 public abstract Builder setCustomAudienceSizeMeanB(float customAudienceSizeMeanB); 82 83 /** Sets the variance of the size of a custom audience for this buyer input. */ setCustomAudienceSizeVarianceB(float customAudienceSizeVarianceB)84 public abstract Builder setCustomAudienceSizeVarianceB(float customAudienceSizeVarianceB); 85 86 /** Sets the mean of the size of the trusted bidding signals keys for this buyer input. */ setTrustedBiddingSignalsKeysSizeMeanB( float trustedBiddingSignalsKeysSizeMeanB)87 public abstract Builder setTrustedBiddingSignalsKeysSizeMeanB( 88 float trustedBiddingSignalsKeysSizeMeanB); 89 90 /** 91 * Sets the variance of the size of the trusted bidding signals keys for this buyer input. 92 */ setTrustedBiddingSignalsKeysSizeVarianceB( float trustedBiddingSignalsSizeVarianceB)93 public abstract Builder setTrustedBiddingSignalsKeysSizeVarianceB( 94 float trustedBiddingSignalsSizeVarianceB); 95 96 /** Sets the mean of the size of the user bidding signals for this buyer input */ setUserBiddingSignalsSizeMeanB(float userBiddingSignalsSizeMeanB)97 public abstract Builder setUserBiddingSignalsSizeMeanB(float userBiddingSignalsSizeMeanB); 98 99 /** Sets the variance of the size of the user bidding signals for this buyer input */ setUserBiddingSignalsSizeVarianceB( float userBiddingSignalsSizeVarianceB)100 public abstract Builder setUserBiddingSignalsSizeVarianceB( 101 float userBiddingSignalsSizeVarianceB); 102 103 /** Sets number of encoded signals payloads included in the auctions */ setNumEncodedSignals(int numEncodedSignals)104 public abstract Builder setNumEncodedSignals(int numEncodedSignals); 105 106 /** Sets mean size of encoded signals payloads */ setEncodedSignalsSizeMean(int encodedSignalsSizeMean)107 public abstract Builder setEncodedSignalsSizeMean(int encodedSignalsSizeMean); 108 109 /** Sets max size of encoded signals payloads */ setEncodedSignalsSizeMax(int encodedSignalsSizeMax)110 public abstract Builder setEncodedSignalsSizeMax(int encodedSignalsSizeMax); 111 112 /** Sets min size of encoded signals payloads */ setEncodedSignalsSizeMin(int encodedSignalsSizeMin)113 public abstract Builder setEncodedSignalsSizeMin(int encodedSignalsSizeMin); 114 115 /** Builds the {@link GetAdSelectionDataBuyerInputGeneratedStats} object. */ build()116 public abstract GetAdSelectionDataBuyerInputGeneratedStats build(); 117 } 118 } 119