-
Notifications
You must be signed in to change notification settings - Fork 306
Expand file tree
/
Copy pathTemplateResponse.java
More file actions
621 lines (484 loc) · 14.4 KB
/
TemplateResponse.java
File metadata and controls
621 lines (484 loc) · 14.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.firebase.remoteconfig.internal;
import com.google.api.client.util.Key;
import java.util.List;
import java.util.Map;
import org.checkerframework.checker.units.qual.K;
/**
* The Data Transfer Object for parsing Remote Config template responses from the
* Remote Config service.
**/
public final class TemplateResponse {
@Key("parameters")
private Map<String, ParameterResponse> parameters;
@Key("conditions")
private List<ConditionResponse> conditions;
@Key("parameterGroups")
private Map<String, ParameterGroupResponse> parameterGroups;
@Key("version")
private VersionResponse version;
// For local JSON serialization and deserialization purposes only.
// ETag in response type is never set by the HTTP response.
@Key("etag")
private String etag;
public Map<String, ParameterResponse> getParameters() {
return parameters;
}
public List<ConditionResponse> getConditions() {
return conditions;
}
public Map<String, ParameterGroupResponse> getParameterGroups() {
return parameterGroups;
}
public VersionResponse getVersion() {
return version;
}
public String getEtag() {
return etag;
}
public TemplateResponse setParameters(
Map<String, ParameterResponse> parameters) {
this.parameters = parameters;
return this;
}
public TemplateResponse setConditions(
List<ConditionResponse> conditions) {
this.conditions = conditions;
return this;
}
public TemplateResponse setParameterGroups(
Map<String, ParameterGroupResponse> parameterGroups) {
this.parameterGroups = parameterGroups;
return this;
}
public TemplateResponse setVersion(VersionResponse version) {
this.version = version;
return this;
}
public TemplateResponse setEtag(String etag) {
this.etag = etag;
return this;
}
/**
* The Data Transfer Object for parsing Remote Config parameter responses from the
* Remote Config service.
**/
public static final class ParameterResponse {
@Key("defaultValue")
private ParameterValueResponse defaultValue;
@Key("description")
private String description;
@Key("conditionalValues")
private Map<String, ParameterValueResponse> conditionalValues;
@Key("valueType")
private String valueType;
public ParameterValueResponse getDefaultValue() {
return defaultValue;
}
public String getDescription() {
return description;
}
public Map<String, ParameterValueResponse> getConditionalValues() {
return conditionalValues;
}
public String getValueType() {
return valueType;
}
public ParameterResponse setDefaultValue(
ParameterValueResponse defaultValue) {
this.defaultValue = defaultValue;
return this;
}
public ParameterResponse setDescription(String description) {
this.description = description;
return this;
}
public ParameterResponse setConditionalValues(
Map<String, ParameterValueResponse> conditionalValues) {
this.conditionalValues = conditionalValues;
return this;
}
public ParameterResponse setValueType(String valueType) {
this.valueType = valueType;
return this;
}
}
/**
* The Data Transfer Object for parsing Remote Config parameter value responses from the
* Remote Config service.
**/
public static final class ParameterValueResponse {
@Key("value")
private String value;
@Key("useInAppDefault")
private Boolean useInAppDefault;
@Key("rolloutValue")
private RolloutValueResponse rolloutValue;
@Key("personalizationValue")
private PersonalizationValueResponse personalizationValue;
@Key("experimentValue")
private ExperimentValueResponse experimentValue;
public String getValue() {
return value;
}
public boolean isUseInAppDefault() {
return Boolean.TRUE.equals(this.useInAppDefault);
}
public RolloutValueResponse getRolloutValue() {
return rolloutValue;
}
public PersonalizationValueResponse getPersonalizationValue() {
return personalizationValue;
}
public ExperimentValueResponse getExperimentValue() {
return experimentValue;
}
public ParameterValueResponse setValue(String value) {
this.value = value;
return this;
}
public ParameterValueResponse setUseInAppDefault(boolean useInAppDefault) {
this.useInAppDefault = useInAppDefault;
return this;
}
public ParameterValueResponse setRolloutValue(RolloutValueResponse rolloutValue) {
this.rolloutValue = rolloutValue;
return this;
}
public ParameterValueResponse setPersonalizationValue(
PersonalizationValueResponse personalizationValue) {
this.personalizationValue = personalizationValue;
return this;
}
public ParameterValueResponse setExperimentValue(ExperimentValueResponse experimentValue) {
this.experimentValue = experimentValue;
return this;
}
}
/**
* The Data Transfer Object for parsing Remote Config Rollout value responses from the
* Remote Config service.
**/
public static final class RolloutValueResponse {
@Key("rolloutId")
private String rolloutId;
@Key("value")
private String value;
@Key("percent")
private Double percent;
public String getRolloutId() {
return rolloutId;
}
public String getValue() {
return value;
}
public Double getPercent() {
return percent;
}
public RolloutValueResponse setRolloutId(String rolloutId) {
this.rolloutId = rolloutId;
return this;
}
public RolloutValueResponse setValue(String value) {
this.value = value;
return this;
}
public RolloutValueResponse setPercent(Double percent) {
this.percent = percent;
return this;
}
}
/**
* The Data Transfer Object for parsing Remote Config Personalization value responses from the
* Remote Config service.
**/
public static final class PersonalizationValueResponse {
@Key("personalizationId")
private String personalizationId;
public String getPersonalizationId() {
return personalizationId;
}
public PersonalizationValueResponse setPersonalizationId(String personalizationId) {
this.personalizationId = personalizationId;
return this;
}
}
/**
* The Data Transfer Object for parsing Remote Config Experiment value responses from the
* Remote Config service.
**/
public static final class ExperimentValueResponse {
@Key("experimentId")
private String experimentId;
@Key("variantValue")
private List<ExperimentVariantValueResponse> experimentVariantValues;
@Key("exposurePercent")
private Double exposurePercent;
public String getExperimentId() {
return experimentId;
}
public List<ExperimentVariantValueResponse> getExperimentVariantValues() {
return experimentVariantValues;
}
public Double getExposurePercent() {
return exposurePercent;
}
public ExperimentValueResponse setExperimentId(String experimentId) {
this.experimentId = experimentId;
return this;
}
public ExperimentValueResponse setExperimentVariantValues(
List<ExperimentVariantValueResponse> experimentVariantValues) {
this.experimentVariantValues = experimentVariantValues;
return this;
}
public ExperimentValueResponse setExposurePercent(Double exposurePercent) {
this.exposurePercent = exposurePercent;
return this;
}
}
/**
* The Data Transfer Object for parsing Remote Config Experiment variant value responses from the
* Remote Config service.
**/
public static final class ExperimentVariantValueResponse {
@Key("variantId")
private String variantId;
@Key("value")
private String value;
@Key("noChange")
private Boolean noChange;
public String getVariantId() {
return variantId;
}
public String getValue() {
return value;
}
public Boolean getNoChange() {
return noChange;
}
public ExperimentVariantValueResponse setVariantId(String variantId) {
this.variantId = variantId;
return this;
}
public ExperimentVariantValueResponse setValue(String value) {
this.value = value;
return this;
}
public ExperimentVariantValueResponse setNoChange(Boolean noChange) {
this.noChange = noChange;
return this;
}
}
/**
* The Data Transfer Object for parsing Remote Config condition responses from the
* Remote Config service.
**/
public static final class ConditionResponse {
@Key("name")
private String name;
@Key("expression")
private String expression;
@Key("tagColor")
private String tagColor;
public String getName() {
return name;
}
public String getExpression() {
return expression;
}
public String getTagColor() {
return tagColor;
}
public ConditionResponse setName(String name) {
this.name = name;
return this;
}
public ConditionResponse setExpression(String expression) {
this.expression = expression;
return this;
}
public ConditionResponse setTagColor(String tagColor) {
this.tagColor = tagColor;
return this;
}
}
/**
* The Data Transfer Object for parsing Remote Config parameter groups responses from the
* Remote Config service.
**/
public static final class ParameterGroupResponse {
@Key("description")
private String description;
@Key("parameters")
private Map<String, ParameterResponse> parameters;
public Map<String, ParameterResponse> getParameters() {
return parameters;
}
public String getDescription() {
return description;
}
public ParameterGroupResponse setParameters(
Map<String, ParameterResponse> parameters) {
this.parameters = parameters;
return this;
}
public ParameterGroupResponse setDescription(String description) {
this.description = description;
return this;
}
}
/**
* The Data Transfer Object for parsing Remote Config version responses from the
* Remote Config service.
**/
public static final class VersionResponse {
@Key("versionNumber")
private String versionNumber;
@Key("updateTime")
private String updateTime;
@Key("updateOrigin")
private String updateOrigin;
@Key("updateType")
private String updateType;
@Key("updateUser")
private UserResponse updateUser;
@Key("description")
private String description;
@Key("rollbackSource")
private String rollbackSource;
@Key("legacy")
private Boolean legacy;
public String getVersionNumber() {
return versionNumber;
}
public String getUpdateTime() {
return updateTime;
}
public String getUpdateOrigin() {
return updateOrigin;
}
public String getUpdateType() {
return updateType;
}
public UserResponse getUpdateUser() {
return updateUser;
}
public String getDescription() {
return description;
}
public String getRollbackSource() {
return rollbackSource;
}
public boolean isLegacy() {
return Boolean.TRUE.equals(this.legacy);
}
public VersionResponse setDescription(String description) {
this.description = description;
return this;
}
public VersionResponse setVersionNumber(String versionNumber) {
this.versionNumber = versionNumber;
return this;
}
public VersionResponse setUpdateTime(String updateTime) {
this.updateTime = updateTime;
return this;
}
public VersionResponse setUpdateOrigin(String updateOrigin) {
this.updateOrigin = updateOrigin;
return this;
}
public VersionResponse setUpdateType(String updateType) {
this.updateType = updateType;
return this;
}
public VersionResponse setUpdateUser(UserResponse updateUser) {
this.updateUser = updateUser;
return this;
}
public VersionResponse setRollbackSource(String rollbackSource) {
this.rollbackSource = rollbackSource;
return this;
}
public VersionResponse setLegacy(Boolean legacy) {
this.legacy = legacy;
return this;
}
}
/**
* The Data Transfer Object for parsing Remote Config user responses from the
* Remote Config service.
**/
public static final class UserResponse {
@Key("email")
private String email;
@Key("name")
private String name;
@Key("imageUrl")
private String imageUrl;
public String getEmail() {
return email;
}
public String getName() {
return name;
}
public String getImageUrl() {
return imageUrl;
}
public UserResponse setEmail(String email) {
this.email = email;
return this;
}
public UserResponse setName(String name) {
this.name = name;
return this;
}
public UserResponse setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
return this;
}
}
/**
* The Data Transfer Object for parsing Remote Config versions list responses from the
* Remote Config service.
**/
public static final class ListVersionsResponse {
@Key("versions")
private List<VersionResponse> versions;
@Key("nextPageToken")
private String nextPageToken;
public List<VersionResponse> getVersions() {
return versions;
}
public boolean hasVersions() {
return versions != null && !versions.isEmpty();
}
public String getNextPageToken() {
return nextPageToken;
}
public ListVersionsResponse setNextPageToken(String nextPageToken) {
this.nextPageToken = nextPageToken;
return this;
}
public ListVersionsResponse setVersions(
List<VersionResponse> versions) {
this.versions = versions;
return this;
}
}
}