1 /*
2  * Copyright (C) 2023 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.libraries.entitlement.odsa;
18 
19 import androidx.annotation.NonNull;
20 import androidx.annotation.Nullable;
21 
22 import com.google.auto.value.AutoValue;
23 
24 /** Mobile plan described in GSMA Service Entitlement Configuration section 6.5.6 table 43. */
25 @AutoValue
26 public abstract class PlanOffer {
27     /** ID for the plan offered by the MNO. */
28     @NonNull
planId()29     public abstract String planId();
30 
31     /**
32      * Name of the plan offered by the MNO. It is considered as an optional parameter due to it is
33      * not required in any request, but it is recommended to make easier the plan identification.
34      */
35     @Nullable
planName()36     public abstract String planName();
37 
38     /**
39      * Description of the plan offered by the MNO. It is considered as an optional parameter due to
40      * it is not required in any request, but it is recommended to make easier the plan
41      * identification.
42      */
43     @Nullable
planDescription()44     public abstract String planDescription();
45 
46     /** Returns the builder of {@link PlanOffer}. */
builder()47     public static Builder builder() {
48         return new AutoValue_PlanOffer.Builder();
49     }
50 
51     /** Builder of PlanOffer */
52     @AutoValue.Builder
53     public abstract static class Builder {
54         /** Sets ID for the plan offered by the MNO. */
55         @NonNull
setPlanId(@onNull String planId)56         public abstract Builder setPlanId(@NonNull String planId);
57 
58         /**
59          * Sets name of the plan offered by the MNO. It is considered as an optional parameter due
60          * to it is not required in any request, but it is recommended to make easier the plan
61          * identification.
62          */
63         @NonNull
setPlanName(@onNull String planName)64         public abstract Builder setPlanName(@NonNull String planName);
65 
66         /**
67          * Sets description of the plan offered by the MNO. It is considered as an optional
68          * parameter due to it is not required in any request, but it is recommended to make easier
69          * the plan identification.
70          */
71         @NonNull
setPlanDescription(@onNull String planDescription)72         public abstract Builder setPlanDescription(@NonNull String planDescription);
73 
74         /** Build the {@link PlanOffer} object. */
75         @NonNull
build()76         public abstract PlanOffer build();
77     }
78 }
79