@@ -68,6 +68,7 @@ public Model apply(ModelInfo ModelInfo) {
68
68
private final Long lastModifiedTime ;
69
69
private final Long expirationTime ;
70
70
private final Labels labels ;
71
+ private final String location ;
71
72
private final ImmutableList <TrainingRun > trainingRunList ;
72
73
private final ImmutableList <StandardSQLField > featureColumnList ;
73
74
private final ImmutableList <StandardSQLField > labelColumnList ;
@@ -97,6 +98,8 @@ public abstract static class Builder {
97
98
*/
98
99
public abstract Builder setLabels (Map <String , String > labels );
99
100
101
+ abstract Builder setLocation (String location );
102
+
100
103
public abstract Builder setModelId (ModelId modelId );
101
104
102
105
abstract Builder setEtag (String etag );
@@ -130,6 +133,7 @@ static class BuilderImpl extends Builder {
130
133
private Long lastModifiedTime ;
131
134
private Long expirationTime ;
132
135
private Labels labels = Labels .ZERO ;
136
+ private String location ;
133
137
private List <TrainingRun > trainingRunList = Collections .emptyList ();
134
138
private List <StandardSQLField > labelColumnList = Collections .emptyList ();
135
139
private List <StandardSQLField > featureColumnList = Collections .emptyList ();
@@ -150,6 +154,7 @@ static class BuilderImpl extends Builder {
150
154
this .labelColumnList = modelInfo .labelColumnList ;
151
155
this .featureColumnList = modelInfo .featureColumnList ;
152
156
this .encryptionConfiguration = modelInfo .encryptionConfiguration ;
157
+ this .location = modelInfo .location ;
153
158
}
154
159
155
160
BuilderImpl (Model modelPb ) {
@@ -165,6 +170,7 @@ static class BuilderImpl extends Builder {
165
170
this .lastModifiedTime = modelPb .getLastModifiedTime ();
166
171
this .expirationTime = modelPb .getExpirationTime ();
167
172
this .labels = Labels .fromPb (modelPb .getLabels ());
173
+ this .location = modelPb .getLocation ();
168
174
if (modelPb .getTrainingRuns () != null ) {
169
175
this .trainingRunList = modelPb .getTrainingRuns ();
170
176
}
@@ -236,6 +242,12 @@ public Builder setLabels(Map<String, String> labels) {
236
242
return this ;
237
243
}
238
244
245
+ @ Override
246
+ Builder setLocation (String location ) {
247
+ this .location = location ;
248
+ return this ;
249
+ }
250
+
239
251
@ Override
240
252
Builder setTrainingRuns (List <TrainingRun > trainingRunList ) {
241
253
this .trainingRunList = checkNotNull (trainingRunList );
@@ -276,6 +288,7 @@ public ModelInfo build() {
276
288
this .lastModifiedTime = builder .lastModifiedTime ;
277
289
this .expirationTime = builder .expirationTime ;
278
290
this .labels = builder .labels ;
291
+ this .location = builder .location ;
279
292
this .trainingRunList = ImmutableList .copyOf (builder .trainingRunList );
280
293
this .labelColumnList = ImmutableList .copyOf (builder .labelColumnList );
281
294
this .featureColumnList = ImmutableList .copyOf (builder .featureColumnList );
@@ -330,6 +343,11 @@ public Map<String, String> getLabels() {
330
343
return labels .userMap ();
331
344
}
332
345
346
+ /** Returns a location of the model. */
347
+ public String getLocation () {
348
+ return location ;
349
+ }
350
+
333
351
/** Returns metadata about each training run iteration. */
334
352
@ BetaApi
335
353
public ImmutableList <TrainingRun > getTrainingRuns () {
@@ -368,6 +386,7 @@ public String toString() {
368
386
.add ("lastModifiedTime" , lastModifiedTime )
369
387
.add ("expirationTime" , expirationTime )
370
388
.add ("labels" , labels )
389
+ .add ("location" , location )
371
390
.add ("trainingRuns" , trainingRunList )
372
391
.add ("labelColumns" , labelColumnList )
373
392
.add ("featureColumns" , featureColumnList )
@@ -416,6 +435,7 @@ Model toPb() {
416
435
modelPb .setLastModifiedTime (lastModifiedTime );
417
436
modelPb .setExpirationTime (expirationTime );
418
437
modelPb .setLabels (labels .toPb ());
438
+ modelPb .setLocation (location );
419
439
modelPb .setTrainingRuns (trainingRunList );
420
440
if (labelColumnList != null ) {
421
441
modelPb .setLabelColumns (Lists .transform (labelColumnList , StandardSQLField .TO_PB_FUNCTION ));
0 commit comments