1 /* 2 * Copyright 2022 Google LLC 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 package com.google.android.libraries.mobiledatadownload; 17 18 import android.accounts.Account; 19 import com.google.auto.value.AutoValue; 20 import com.google.common.base.Optional; 21 import javax.annotation.concurrent.Immutable; 22 23 /** Request to get a single file group definition. */ 24 @AutoValue 25 @Immutable 26 public abstract class ReadDataFileGroupRequest { 27 groupName()28 public abstract String groupName(); 29 accountOptional()30 public abstract Optional<Account> accountOptional(); 31 variantIdOptional()32 public abstract Optional<String> variantIdOptional(); 33 newBuilder()34 public static Builder newBuilder() { 35 return new AutoValue_ReadDataFileGroupRequest.Builder(); 36 } 37 38 /** Builder for {@link ReadDataFileGroupRequest}. */ 39 @AutoValue.Builder 40 public abstract static class Builder { Builder()41 Builder() {} 42 43 /** Sets the data file group, which is required. */ setGroupName(String groupName)44 public abstract Builder setGroupName(String groupName); 45 46 /** Sets the account associated with the group, which is optional. */ setAccountOptional(Optional<Account> accountOptional)47 public abstract Builder setAccountOptional(Optional<Account> accountOptional); 48 49 /** Sets the variant id associated with the group, which is optional. */ setVariantIdOptional(Optional<String> variantIdOptional)50 public abstract Builder setVariantIdOptional(Optional<String> variantIdOptional); 51 build()52 public abstract ReadDataFileGroupRequest build(); 53 } 54 } 55