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.pas; 18 19 import static com.android.adservices.service.stats.AdsRelevanceStatusUtils.JSON_PROCESSING_STATUS_UNSET; 20 import static com.android.adservices.service.stats.AdsRelevanceStatusUtils.SIZE_UNSET; 21 22 import com.android.adservices.service.stats.AdsRelevanceStatusUtils; 23 24 import com.google.auto.value.AutoValue; 25 26 /** Class for updateSignals API called stats. */ 27 @AutoValue 28 public abstract class UpdateSignalsApiCalledStats { 29 /** Returns http response code. */ getHttpResponseCode()30 public abstract int getHttpResponseCode(); 31 32 /** Returns the size of the JSON. */ 33 @AdsRelevanceStatusUtils.Size getJsonSize()34 public abstract int getJsonSize(); 35 36 /** Returns the status of JSON processing. */ 37 @AdsRelevanceStatusUtils.JsonProcessingStatus getJsonProcessingStatus()38 public abstract int getJsonProcessingStatus(); 39 40 /** Returns the package uid when the JsonProcessingStatus is not success. */ getPackageUid()41 public abstract int getPackageUid(); 42 43 /** Returns AdTech's enrollment id when the JsonProcessingStatus is not success. */ getAdTechId()44 public abstract String getAdTechId(); 45 46 /** Returns generic builder */ builder()47 public static Builder builder() { 48 return new AutoValue_UpdateSignalsApiCalledStats.Builder() 49 .setJsonProcessingStatus(JSON_PROCESSING_STATUS_UNSET) 50 .setHttpResponseCode(0) 51 .setJsonSize(SIZE_UNSET) 52 .setPackageUid(0) 53 .setAdTechId(""); 54 } 55 56 /** Builder class for UpdateSignalsApiCalledStats. */ 57 @AutoValue.Builder 58 public abstract static class Builder { setHttpResponseCode(int value)59 public abstract Builder setHttpResponseCode(int value); 60 setJsonSize(@dsRelevanceStatusUtils.Size int value)61 public abstract Builder setJsonSize(@AdsRelevanceStatusUtils.Size int value); 62 setJsonProcessingStatus( @dsRelevanceStatusUtils.JsonProcessingStatus int value)63 public abstract Builder setJsonProcessingStatus( 64 @AdsRelevanceStatusUtils.JsonProcessingStatus int value); 65 setPackageUid(int value)66 public abstract Builder setPackageUid(int value); 67 setAdTechId(String value)68 public abstract Builder setAdTechId(String value); 69 build()70 public abstract UpdateSignalsApiCalledStats build(); 71 } 72 } 73