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 number of custom audiences in this buyer input sending component ads */ getNumCustomAudiencesWithComponentAds()63 public abstract int getNumCustomAudiencesWithComponentAds(); 64 65 /** Returns a generic builder. */ builder()66 public static Builder builder() { 67 return new AutoValue_GetAdSelectionDataBuyerInputGeneratedStats.Builder() 68 .setNumEncodedSignals(FIELD_UNSET) 69 .setEncodedSignalsSizeMax(FIELD_UNSET) 70 .setEncodedSignalsSizeMin(FIELD_UNSET) 71 .setEncodedSignalsSizeMean(FIELD_UNSET) 72 .setNumCustomAudiencesWithComponentAds(FIELD_UNSET); 73 } 74 75 /** Builder class for GetAdSelectionDataBuyerInputGeneratedStats. */ 76 @AutoValue.Builder 77 public abstract static class Builder { 78 /** Sets the number of custom audiences. */ setNumCustomAudiences(int numCustomAudiences)79 public abstract Builder setNumCustomAudiences(int numCustomAudiences); 80 81 /** Sets the number of custom audiences omitting ads. */ setNumCustomAudiencesOmitAds(int numCustomAudiencesOmitAds)82 public abstract Builder setNumCustomAudiencesOmitAds(int numCustomAudiencesOmitAds); 83 84 /** Sets the mean of the size of a custom audience for this buyer input. */ setCustomAudienceSizeMeanB(float customAudienceSizeMeanB)85 public abstract Builder setCustomAudienceSizeMeanB(float customAudienceSizeMeanB); 86 87 /** Sets the variance of the size of a custom audience for this buyer input. */ setCustomAudienceSizeVarianceB(float customAudienceSizeVarianceB)88 public abstract Builder setCustomAudienceSizeVarianceB(float customAudienceSizeVarianceB); 89 90 /** Sets the mean of the size of the trusted bidding signals keys for this buyer input. */ setTrustedBiddingSignalsKeysSizeMeanB( float trustedBiddingSignalsKeysSizeMeanB)91 public abstract Builder setTrustedBiddingSignalsKeysSizeMeanB( 92 float trustedBiddingSignalsKeysSizeMeanB); 93 94 /** 95 * Sets the variance of the size of the trusted bidding signals keys for this buyer input. 96 */ setTrustedBiddingSignalsKeysSizeVarianceB( float trustedBiddingSignalsSizeVarianceB)97 public abstract Builder setTrustedBiddingSignalsKeysSizeVarianceB( 98 float trustedBiddingSignalsSizeVarianceB); 99 100 /** Sets the mean of the size of the user bidding signals for this buyer input */ setUserBiddingSignalsSizeMeanB(float userBiddingSignalsSizeMeanB)101 public abstract Builder setUserBiddingSignalsSizeMeanB(float userBiddingSignalsSizeMeanB); 102 103 /** Sets the variance of the size of the user bidding signals for this buyer input */ setUserBiddingSignalsSizeVarianceB( float userBiddingSignalsSizeVarianceB)104 public abstract Builder setUserBiddingSignalsSizeVarianceB( 105 float userBiddingSignalsSizeVarianceB); 106 107 /** Sets number of encoded signals payloads included in the auctions */ setNumEncodedSignals(int numEncodedSignals)108 public abstract Builder setNumEncodedSignals(int numEncodedSignals); 109 110 /** Sets mean size of encoded signals payloads */ setEncodedSignalsSizeMean(int encodedSignalsSizeMean)111 public abstract Builder setEncodedSignalsSizeMean(int encodedSignalsSizeMean); 112 113 /** Sets max size of encoded signals payloads */ setEncodedSignalsSizeMax(int encodedSignalsSizeMax)114 public abstract Builder setEncodedSignalsSizeMax(int encodedSignalsSizeMax); 115 116 /** Sets min size of encoded signals payloads */ setEncodedSignalsSizeMin(int encodedSignalsSizeMin)117 public abstract Builder setEncodedSignalsSizeMin(int encodedSignalsSizeMin); 118 119 /** Sets number of custom audiences in this buyer input sending component ads */ setNumCustomAudiencesWithComponentAds( int numCustomAudiencesWithComponentAds)120 public abstract Builder setNumCustomAudiencesWithComponentAds( 121 int numCustomAudiencesWithComponentAds); 122 123 /** Builds the {@link GetAdSelectionDataBuyerInputGeneratedStats} object. */ build()124 public abstract GetAdSelectionDataBuyerInputGeneratedStats build(); 125 } 126 } 127