1 /* 2 * Copyright (C) 2022 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.adselection; 18 19 import android.adservices.adselection.AdWithBid; 20 import android.annotation.Nullable; 21 22 import com.google.auto.value.AutoValue; 23 24 /** 25 * Results from Ad Bidding, combined with the Custom Audience Bidding info to be able to map CA data 26 * related to an Ad for reporting 27 */ 28 @AutoValue 29 public abstract class AdBiddingOutcome { 30 31 /** 32 * @return Ad data object with bid value 33 */ getAdWithBid()34 public abstract AdWithBid getAdWithBid(); 35 36 /** 37 * @return CA Bidding info that is used for reporting 38 */ getCustomAudienceBiddingInfo()39 public abstract CustomAudienceBiddingInfo getCustomAudienceBiddingInfo(); 40 41 /** 42 * @return data for event-level debug reporting. 43 */ 44 @Nullable getDebugReport()45 public abstract DebugReport getDebugReport(); 46 47 /** 48 * @return Generic builder 49 */ builder()50 public static Builder builder() { 51 return new AutoValue_AdBiddingOutcome.Builder(); 52 } 53 54 /** The Builder for {@link AdBiddingOutcome} */ 55 @AutoValue.Builder 56 public abstract static class Builder { 57 /** Sets the AdWithBid */ setAdWithBid(AdWithBid adWithBid)58 public abstract Builder setAdWithBid(AdWithBid adWithBid); 59 60 /** Sets the CustomAudienceBiddingInfo */ setCustomAudienceBiddingInfo( CustomAudienceBiddingInfo customAudienceBiddingInfo)61 public abstract Builder setCustomAudienceBiddingInfo( 62 CustomAudienceBiddingInfo customAudienceBiddingInfo); 63 64 /** Sets the DebugReport. */ setDebugReport(DebugReport debugReport)65 abstract Builder setDebugReport(DebugReport debugReport); 66 67 /** Build an AdBiddingOutcome object. */ build()68 public abstract AdBiddingOutcome build(); 69 } 70 } 71