• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 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  *     https://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 // Generated by the protocol buffer compiler.  DO NOT EDIT!
17 // source: google/cloud/automl/v1beta1/prediction_service.proto
18 
19 package com.google.cloud.automl.v1beta1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Request message for [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict].
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.automl.v1beta1.PredictRequest}
29  */
30 public final class PredictRequest extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.PredictRequest)
33     PredictRequestOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use PredictRequest.newBuilder() to construct.
PredictRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private PredictRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
PredictRequest()40   private PredictRequest() {
41     name_ = "";
42   }
43 
44   @java.lang.Override
45   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)46   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
47     return new PredictRequest();
48   }
49 
50   @java.lang.Override
getUnknownFields()51   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
52     return this.unknownFields;
53   }
54 
getDescriptor()55   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
56     return com.google.cloud.automl.v1beta1.PredictionServiceProto
57         .internal_static_google_cloud_automl_v1beta1_PredictRequest_descriptor;
58   }
59 
60   @SuppressWarnings({"rawtypes"})
61   @java.lang.Override
internalGetMapField(int number)62   protected com.google.protobuf.MapField internalGetMapField(int number) {
63     switch (number) {
64       case 3:
65         return internalGetParams();
66       default:
67         throw new RuntimeException("Invalid map field number: " + number);
68     }
69   }
70 
71   @java.lang.Override
72   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()73       internalGetFieldAccessorTable() {
74     return com.google.cloud.automl.v1beta1.PredictionServiceProto
75         .internal_static_google_cloud_automl_v1beta1_PredictRequest_fieldAccessorTable
76         .ensureFieldAccessorsInitialized(
77             com.google.cloud.automl.v1beta1.PredictRequest.class,
78             com.google.cloud.automl.v1beta1.PredictRequest.Builder.class);
79   }
80 
81   public static final int NAME_FIELD_NUMBER = 1;
82 
83   @SuppressWarnings("serial")
84   private volatile java.lang.Object name_ = "";
85   /**
86    *
87    *
88    * <pre>
89    * Required. Name of the model requested to serve the prediction.
90    * </pre>
91    *
92    * <code>
93    * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
94    * </code>
95    *
96    * @return The name.
97    */
98   @java.lang.Override
getName()99   public java.lang.String getName() {
100     java.lang.Object ref = name_;
101     if (ref instanceof java.lang.String) {
102       return (java.lang.String) ref;
103     } else {
104       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
105       java.lang.String s = bs.toStringUtf8();
106       name_ = s;
107       return s;
108     }
109   }
110   /**
111    *
112    *
113    * <pre>
114    * Required. Name of the model requested to serve the prediction.
115    * </pre>
116    *
117    * <code>
118    * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
119    * </code>
120    *
121    * @return The bytes for name.
122    */
123   @java.lang.Override
getNameBytes()124   public com.google.protobuf.ByteString getNameBytes() {
125     java.lang.Object ref = name_;
126     if (ref instanceof java.lang.String) {
127       com.google.protobuf.ByteString b =
128           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
129       name_ = b;
130       return b;
131     } else {
132       return (com.google.protobuf.ByteString) ref;
133     }
134   }
135 
136   public static final int PAYLOAD_FIELD_NUMBER = 2;
137   private com.google.cloud.automl.v1beta1.ExamplePayload payload_;
138   /**
139    *
140    *
141    * <pre>
142    * Required. Payload to perform a prediction on. The payload must match the
143    * problem type that the model was trained to solve.
144    * </pre>
145    *
146    * <code>
147    * .google.cloud.automl.v1beta1.ExamplePayload payload = 2 [(.google.api.field_behavior) = REQUIRED];
148    * </code>
149    *
150    * @return Whether the payload field is set.
151    */
152   @java.lang.Override
hasPayload()153   public boolean hasPayload() {
154     return payload_ != null;
155   }
156   /**
157    *
158    *
159    * <pre>
160    * Required. Payload to perform a prediction on. The payload must match the
161    * problem type that the model was trained to solve.
162    * </pre>
163    *
164    * <code>
165    * .google.cloud.automl.v1beta1.ExamplePayload payload = 2 [(.google.api.field_behavior) = REQUIRED];
166    * </code>
167    *
168    * @return The payload.
169    */
170   @java.lang.Override
getPayload()171   public com.google.cloud.automl.v1beta1.ExamplePayload getPayload() {
172     return payload_ == null
173         ? com.google.cloud.automl.v1beta1.ExamplePayload.getDefaultInstance()
174         : payload_;
175   }
176   /**
177    *
178    *
179    * <pre>
180    * Required. Payload to perform a prediction on. The payload must match the
181    * problem type that the model was trained to solve.
182    * </pre>
183    *
184    * <code>
185    * .google.cloud.automl.v1beta1.ExamplePayload payload = 2 [(.google.api.field_behavior) = REQUIRED];
186    * </code>
187    */
188   @java.lang.Override
getPayloadOrBuilder()189   public com.google.cloud.automl.v1beta1.ExamplePayloadOrBuilder getPayloadOrBuilder() {
190     return payload_ == null
191         ? com.google.cloud.automl.v1beta1.ExamplePayload.getDefaultInstance()
192         : payload_;
193   }
194 
195   public static final int PARAMS_FIELD_NUMBER = 3;
196 
197   private static final class ParamsDefaultEntryHolder {
198     static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry =
199         com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance(
200             com.google.cloud.automl.v1beta1.PredictionServiceProto
201                 .internal_static_google_cloud_automl_v1beta1_PredictRequest_ParamsEntry_descriptor,
202             com.google.protobuf.WireFormat.FieldType.STRING,
203             "",
204             com.google.protobuf.WireFormat.FieldType.STRING,
205             "");
206   }
207 
208   @SuppressWarnings("serial")
209   private com.google.protobuf.MapField<java.lang.String, java.lang.String> params_;
210 
internalGetParams()211   private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetParams() {
212     if (params_ == null) {
213       return com.google.protobuf.MapField.emptyMapField(ParamsDefaultEntryHolder.defaultEntry);
214     }
215     return params_;
216   }
217 
getParamsCount()218   public int getParamsCount() {
219     return internalGetParams().getMap().size();
220   }
221   /**
222    *
223    *
224    * <pre>
225    * Additional domain-specific parameters, any string must be up to 25000
226    * characters long.
227    * *  For Image Classification:
228    *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
229    *     makes predictions for an image, it will only produce results that have
230    *     at least this confidence score. The default is 0.5.
231    *  *  For Image Object Detection:
232    *    `score_threshold` - (float) When Model detects objects on the image,
233    *        it will only produce bounding boxes which have at least this
234    *        confidence score. Value in 0 to 1 range, default is 0.5.
235    *    `max_bounding_box_count` - (int64) No more than this number of bounding
236    *        boxes will be returned in the response. Default is 100, the
237    *        requested value may be limited by server.
238    * *  For Tables:
239    *    feature_imp&lt;span&gt;ortan&lt;/span&gt;ce - (boolean) Whether feature importance
240    *        should be populated in the returned TablesAnnotation.
241    *        The default is false.
242    * </pre>
243    *
244    * <code>map&lt;string, string&gt; params = 3;</code>
245    */
246   @java.lang.Override
containsParams(java.lang.String key)247   public boolean containsParams(java.lang.String key) {
248     if (key == null) {
249       throw new NullPointerException("map key");
250     }
251     return internalGetParams().getMap().containsKey(key);
252   }
253   /** Use {@link #getParamsMap()} instead. */
254   @java.lang.Override
255   @java.lang.Deprecated
getParams()256   public java.util.Map<java.lang.String, java.lang.String> getParams() {
257     return getParamsMap();
258   }
259   /**
260    *
261    *
262    * <pre>
263    * Additional domain-specific parameters, any string must be up to 25000
264    * characters long.
265    * *  For Image Classification:
266    *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
267    *     makes predictions for an image, it will only produce results that have
268    *     at least this confidence score. The default is 0.5.
269    *  *  For Image Object Detection:
270    *    `score_threshold` - (float) When Model detects objects on the image,
271    *        it will only produce bounding boxes which have at least this
272    *        confidence score. Value in 0 to 1 range, default is 0.5.
273    *    `max_bounding_box_count` - (int64) No more than this number of bounding
274    *        boxes will be returned in the response. Default is 100, the
275    *        requested value may be limited by server.
276    * *  For Tables:
277    *    feature_imp&lt;span&gt;ortan&lt;/span&gt;ce - (boolean) Whether feature importance
278    *        should be populated in the returned TablesAnnotation.
279    *        The default is false.
280    * </pre>
281    *
282    * <code>map&lt;string, string&gt; params = 3;</code>
283    */
284   @java.lang.Override
getParamsMap()285   public java.util.Map<java.lang.String, java.lang.String> getParamsMap() {
286     return internalGetParams().getMap();
287   }
288   /**
289    *
290    *
291    * <pre>
292    * Additional domain-specific parameters, any string must be up to 25000
293    * characters long.
294    * *  For Image Classification:
295    *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
296    *     makes predictions for an image, it will only produce results that have
297    *     at least this confidence score. The default is 0.5.
298    *  *  For Image Object Detection:
299    *    `score_threshold` - (float) When Model detects objects on the image,
300    *        it will only produce bounding boxes which have at least this
301    *        confidence score. Value in 0 to 1 range, default is 0.5.
302    *    `max_bounding_box_count` - (int64) No more than this number of bounding
303    *        boxes will be returned in the response. Default is 100, the
304    *        requested value may be limited by server.
305    * *  For Tables:
306    *    feature_imp&lt;span&gt;ortan&lt;/span&gt;ce - (boolean) Whether feature importance
307    *        should be populated in the returned TablesAnnotation.
308    *        The default is false.
309    * </pre>
310    *
311    * <code>map&lt;string, string&gt; params = 3;</code>
312    */
313   @java.lang.Override
getParamsOrDefault( java.lang.String key, java.lang.String defaultValue)314   public /* nullable */ java.lang.String getParamsOrDefault(
315       java.lang.String key,
316       /* nullable */
317       java.lang.String defaultValue) {
318     if (key == null) {
319       throw new NullPointerException("map key");
320     }
321     java.util.Map<java.lang.String, java.lang.String> map = internalGetParams().getMap();
322     return map.containsKey(key) ? map.get(key) : defaultValue;
323   }
324   /**
325    *
326    *
327    * <pre>
328    * Additional domain-specific parameters, any string must be up to 25000
329    * characters long.
330    * *  For Image Classification:
331    *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
332    *     makes predictions for an image, it will only produce results that have
333    *     at least this confidence score. The default is 0.5.
334    *  *  For Image Object Detection:
335    *    `score_threshold` - (float) When Model detects objects on the image,
336    *        it will only produce bounding boxes which have at least this
337    *        confidence score. Value in 0 to 1 range, default is 0.5.
338    *    `max_bounding_box_count` - (int64) No more than this number of bounding
339    *        boxes will be returned in the response. Default is 100, the
340    *        requested value may be limited by server.
341    * *  For Tables:
342    *    feature_imp&lt;span&gt;ortan&lt;/span&gt;ce - (boolean) Whether feature importance
343    *        should be populated in the returned TablesAnnotation.
344    *        The default is false.
345    * </pre>
346    *
347    * <code>map&lt;string, string&gt; params = 3;</code>
348    */
349   @java.lang.Override
getParamsOrThrow(java.lang.String key)350   public java.lang.String getParamsOrThrow(java.lang.String key) {
351     if (key == null) {
352       throw new NullPointerException("map key");
353     }
354     java.util.Map<java.lang.String, java.lang.String> map = internalGetParams().getMap();
355     if (!map.containsKey(key)) {
356       throw new java.lang.IllegalArgumentException();
357     }
358     return map.get(key);
359   }
360 
361   private byte memoizedIsInitialized = -1;
362 
363   @java.lang.Override
isInitialized()364   public final boolean isInitialized() {
365     byte isInitialized = memoizedIsInitialized;
366     if (isInitialized == 1) return true;
367     if (isInitialized == 0) return false;
368 
369     memoizedIsInitialized = 1;
370     return true;
371   }
372 
373   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)374   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
375     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
376       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
377     }
378     if (payload_ != null) {
379       output.writeMessage(2, getPayload());
380     }
381     com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
382         output, internalGetParams(), ParamsDefaultEntryHolder.defaultEntry, 3);
383     getUnknownFields().writeTo(output);
384   }
385 
386   @java.lang.Override
getSerializedSize()387   public int getSerializedSize() {
388     int size = memoizedSize;
389     if (size != -1) return size;
390 
391     size = 0;
392     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
393       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
394     }
395     if (payload_ != null) {
396       size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPayload());
397     }
398     for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
399         internalGetParams().getMap().entrySet()) {
400       com.google.protobuf.MapEntry<java.lang.String, java.lang.String> params__ =
401           ParamsDefaultEntryHolder.defaultEntry
402               .newBuilderForType()
403               .setKey(entry.getKey())
404               .setValue(entry.getValue())
405               .build();
406       size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, params__);
407     }
408     size += getUnknownFields().getSerializedSize();
409     memoizedSize = size;
410     return size;
411   }
412 
413   @java.lang.Override
equals(final java.lang.Object obj)414   public boolean equals(final java.lang.Object obj) {
415     if (obj == this) {
416       return true;
417     }
418     if (!(obj instanceof com.google.cloud.automl.v1beta1.PredictRequest)) {
419       return super.equals(obj);
420     }
421     com.google.cloud.automl.v1beta1.PredictRequest other =
422         (com.google.cloud.automl.v1beta1.PredictRequest) obj;
423 
424     if (!getName().equals(other.getName())) return false;
425     if (hasPayload() != other.hasPayload()) return false;
426     if (hasPayload()) {
427       if (!getPayload().equals(other.getPayload())) return false;
428     }
429     if (!internalGetParams().equals(other.internalGetParams())) return false;
430     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
431     return true;
432   }
433 
434   @java.lang.Override
hashCode()435   public int hashCode() {
436     if (memoizedHashCode != 0) {
437       return memoizedHashCode;
438     }
439     int hash = 41;
440     hash = (19 * hash) + getDescriptor().hashCode();
441     hash = (37 * hash) + NAME_FIELD_NUMBER;
442     hash = (53 * hash) + getName().hashCode();
443     if (hasPayload()) {
444       hash = (37 * hash) + PAYLOAD_FIELD_NUMBER;
445       hash = (53 * hash) + getPayload().hashCode();
446     }
447     if (!internalGetParams().getMap().isEmpty()) {
448       hash = (37 * hash) + PARAMS_FIELD_NUMBER;
449       hash = (53 * hash) + internalGetParams().hashCode();
450     }
451     hash = (29 * hash) + getUnknownFields().hashCode();
452     memoizedHashCode = hash;
453     return hash;
454   }
455 
parseFrom(java.nio.ByteBuffer data)456   public static com.google.cloud.automl.v1beta1.PredictRequest parseFrom(java.nio.ByteBuffer data)
457       throws com.google.protobuf.InvalidProtocolBufferException {
458     return PARSER.parseFrom(data);
459   }
460 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)461   public static com.google.cloud.automl.v1beta1.PredictRequest parseFrom(
462       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
463       throws com.google.protobuf.InvalidProtocolBufferException {
464     return PARSER.parseFrom(data, extensionRegistry);
465   }
466 
parseFrom( com.google.protobuf.ByteString data)467   public static com.google.cloud.automl.v1beta1.PredictRequest parseFrom(
468       com.google.protobuf.ByteString data)
469       throws com.google.protobuf.InvalidProtocolBufferException {
470     return PARSER.parseFrom(data);
471   }
472 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)473   public static com.google.cloud.automl.v1beta1.PredictRequest parseFrom(
474       com.google.protobuf.ByteString data,
475       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
476       throws com.google.protobuf.InvalidProtocolBufferException {
477     return PARSER.parseFrom(data, extensionRegistry);
478   }
479 
parseFrom(byte[] data)480   public static com.google.cloud.automl.v1beta1.PredictRequest parseFrom(byte[] data)
481       throws com.google.protobuf.InvalidProtocolBufferException {
482     return PARSER.parseFrom(data);
483   }
484 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)485   public static com.google.cloud.automl.v1beta1.PredictRequest parseFrom(
486       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
487       throws com.google.protobuf.InvalidProtocolBufferException {
488     return PARSER.parseFrom(data, extensionRegistry);
489   }
490 
parseFrom(java.io.InputStream input)491   public static com.google.cloud.automl.v1beta1.PredictRequest parseFrom(java.io.InputStream input)
492       throws java.io.IOException {
493     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
494   }
495 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)496   public static com.google.cloud.automl.v1beta1.PredictRequest parseFrom(
497       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
498       throws java.io.IOException {
499     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
500         PARSER, input, extensionRegistry);
501   }
502 
parseDelimitedFrom( java.io.InputStream input)503   public static com.google.cloud.automl.v1beta1.PredictRequest parseDelimitedFrom(
504       java.io.InputStream input) throws java.io.IOException {
505     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
506   }
507 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)508   public static com.google.cloud.automl.v1beta1.PredictRequest parseDelimitedFrom(
509       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
510       throws java.io.IOException {
511     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
512         PARSER, input, extensionRegistry);
513   }
514 
parseFrom( com.google.protobuf.CodedInputStream input)515   public static com.google.cloud.automl.v1beta1.PredictRequest parseFrom(
516       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
517     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
518   }
519 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)520   public static com.google.cloud.automl.v1beta1.PredictRequest parseFrom(
521       com.google.protobuf.CodedInputStream input,
522       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
523       throws java.io.IOException {
524     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
525         PARSER, input, extensionRegistry);
526   }
527 
528   @java.lang.Override
newBuilderForType()529   public Builder newBuilderForType() {
530     return newBuilder();
531   }
532 
newBuilder()533   public static Builder newBuilder() {
534     return DEFAULT_INSTANCE.toBuilder();
535   }
536 
newBuilder(com.google.cloud.automl.v1beta1.PredictRequest prototype)537   public static Builder newBuilder(com.google.cloud.automl.v1beta1.PredictRequest prototype) {
538     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
539   }
540 
541   @java.lang.Override
toBuilder()542   public Builder toBuilder() {
543     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
544   }
545 
546   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)547   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
548     Builder builder = new Builder(parent);
549     return builder;
550   }
551   /**
552    *
553    *
554    * <pre>
555    * Request message for [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict].
556    * </pre>
557    *
558    * Protobuf type {@code google.cloud.automl.v1beta1.PredictRequest}
559    */
560   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
561       implements
562       // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.PredictRequest)
563       com.google.cloud.automl.v1beta1.PredictRequestOrBuilder {
getDescriptor()564     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
565       return com.google.cloud.automl.v1beta1.PredictionServiceProto
566           .internal_static_google_cloud_automl_v1beta1_PredictRequest_descriptor;
567     }
568 
569     @SuppressWarnings({"rawtypes"})
internalGetMapField(int number)570     protected com.google.protobuf.MapField internalGetMapField(int number) {
571       switch (number) {
572         case 3:
573           return internalGetParams();
574         default:
575           throw new RuntimeException("Invalid map field number: " + number);
576       }
577     }
578 
579     @SuppressWarnings({"rawtypes"})
internalGetMutableMapField(int number)580     protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
581       switch (number) {
582         case 3:
583           return internalGetMutableParams();
584         default:
585           throw new RuntimeException("Invalid map field number: " + number);
586       }
587     }
588 
589     @java.lang.Override
590     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()591         internalGetFieldAccessorTable() {
592       return com.google.cloud.automl.v1beta1.PredictionServiceProto
593           .internal_static_google_cloud_automl_v1beta1_PredictRequest_fieldAccessorTable
594           .ensureFieldAccessorsInitialized(
595               com.google.cloud.automl.v1beta1.PredictRequest.class,
596               com.google.cloud.automl.v1beta1.PredictRequest.Builder.class);
597     }
598 
599     // Construct using com.google.cloud.automl.v1beta1.PredictRequest.newBuilder()
Builder()600     private Builder() {}
601 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)602     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
603       super(parent);
604     }
605 
606     @java.lang.Override
clear()607     public Builder clear() {
608       super.clear();
609       bitField0_ = 0;
610       name_ = "";
611       payload_ = null;
612       if (payloadBuilder_ != null) {
613         payloadBuilder_.dispose();
614         payloadBuilder_ = null;
615       }
616       internalGetMutableParams().clear();
617       return this;
618     }
619 
620     @java.lang.Override
getDescriptorForType()621     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
622       return com.google.cloud.automl.v1beta1.PredictionServiceProto
623           .internal_static_google_cloud_automl_v1beta1_PredictRequest_descriptor;
624     }
625 
626     @java.lang.Override
getDefaultInstanceForType()627     public com.google.cloud.automl.v1beta1.PredictRequest getDefaultInstanceForType() {
628       return com.google.cloud.automl.v1beta1.PredictRequest.getDefaultInstance();
629     }
630 
631     @java.lang.Override
build()632     public com.google.cloud.automl.v1beta1.PredictRequest build() {
633       com.google.cloud.automl.v1beta1.PredictRequest result = buildPartial();
634       if (!result.isInitialized()) {
635         throw newUninitializedMessageException(result);
636       }
637       return result;
638     }
639 
640     @java.lang.Override
buildPartial()641     public com.google.cloud.automl.v1beta1.PredictRequest buildPartial() {
642       com.google.cloud.automl.v1beta1.PredictRequest result =
643           new com.google.cloud.automl.v1beta1.PredictRequest(this);
644       if (bitField0_ != 0) {
645         buildPartial0(result);
646       }
647       onBuilt();
648       return result;
649     }
650 
buildPartial0(com.google.cloud.automl.v1beta1.PredictRequest result)651     private void buildPartial0(com.google.cloud.automl.v1beta1.PredictRequest result) {
652       int from_bitField0_ = bitField0_;
653       if (((from_bitField0_ & 0x00000001) != 0)) {
654         result.name_ = name_;
655       }
656       if (((from_bitField0_ & 0x00000002) != 0)) {
657         result.payload_ = payloadBuilder_ == null ? payload_ : payloadBuilder_.build();
658       }
659       if (((from_bitField0_ & 0x00000004) != 0)) {
660         result.params_ = internalGetParams();
661         result.params_.makeImmutable();
662       }
663     }
664 
665     @java.lang.Override
clone()666     public Builder clone() {
667       return super.clone();
668     }
669 
670     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)671     public Builder setField(
672         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
673       return super.setField(field, value);
674     }
675 
676     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)677     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
678       return super.clearField(field);
679     }
680 
681     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)682     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
683       return super.clearOneof(oneof);
684     }
685 
686     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)687     public Builder setRepeatedField(
688         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
689       return super.setRepeatedField(field, index, value);
690     }
691 
692     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)693     public Builder addRepeatedField(
694         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
695       return super.addRepeatedField(field, value);
696     }
697 
698     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)699     public Builder mergeFrom(com.google.protobuf.Message other) {
700       if (other instanceof com.google.cloud.automl.v1beta1.PredictRequest) {
701         return mergeFrom((com.google.cloud.automl.v1beta1.PredictRequest) other);
702       } else {
703         super.mergeFrom(other);
704         return this;
705       }
706     }
707 
mergeFrom(com.google.cloud.automl.v1beta1.PredictRequest other)708     public Builder mergeFrom(com.google.cloud.automl.v1beta1.PredictRequest other) {
709       if (other == com.google.cloud.automl.v1beta1.PredictRequest.getDefaultInstance()) return this;
710       if (!other.getName().isEmpty()) {
711         name_ = other.name_;
712         bitField0_ |= 0x00000001;
713         onChanged();
714       }
715       if (other.hasPayload()) {
716         mergePayload(other.getPayload());
717       }
718       internalGetMutableParams().mergeFrom(other.internalGetParams());
719       bitField0_ |= 0x00000004;
720       this.mergeUnknownFields(other.getUnknownFields());
721       onChanged();
722       return this;
723     }
724 
725     @java.lang.Override
isInitialized()726     public final boolean isInitialized() {
727       return true;
728     }
729 
730     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)731     public Builder mergeFrom(
732         com.google.protobuf.CodedInputStream input,
733         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
734         throws java.io.IOException {
735       if (extensionRegistry == null) {
736         throw new java.lang.NullPointerException();
737       }
738       try {
739         boolean done = false;
740         while (!done) {
741           int tag = input.readTag();
742           switch (tag) {
743             case 0:
744               done = true;
745               break;
746             case 10:
747               {
748                 name_ = input.readStringRequireUtf8();
749                 bitField0_ |= 0x00000001;
750                 break;
751               } // case 10
752             case 18:
753               {
754                 input.readMessage(getPayloadFieldBuilder().getBuilder(), extensionRegistry);
755                 bitField0_ |= 0x00000002;
756                 break;
757               } // case 18
758             case 26:
759               {
760                 com.google.protobuf.MapEntry<java.lang.String, java.lang.String> params__ =
761                     input.readMessage(
762                         ParamsDefaultEntryHolder.defaultEntry.getParserForType(),
763                         extensionRegistry);
764                 internalGetMutableParams()
765                     .getMutableMap()
766                     .put(params__.getKey(), params__.getValue());
767                 bitField0_ |= 0x00000004;
768                 break;
769               } // case 26
770             default:
771               {
772                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
773                   done = true; // was an endgroup tag
774                 }
775                 break;
776               } // default:
777           } // switch (tag)
778         } // while (!done)
779       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
780         throw e.unwrapIOException();
781       } finally {
782         onChanged();
783       } // finally
784       return this;
785     }
786 
787     private int bitField0_;
788 
789     private java.lang.Object name_ = "";
790     /**
791      *
792      *
793      * <pre>
794      * Required. Name of the model requested to serve the prediction.
795      * </pre>
796      *
797      * <code>
798      * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
799      * </code>
800      *
801      * @return The name.
802      */
getName()803     public java.lang.String getName() {
804       java.lang.Object ref = name_;
805       if (!(ref instanceof java.lang.String)) {
806         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
807         java.lang.String s = bs.toStringUtf8();
808         name_ = s;
809         return s;
810       } else {
811         return (java.lang.String) ref;
812       }
813     }
814     /**
815      *
816      *
817      * <pre>
818      * Required. Name of the model requested to serve the prediction.
819      * </pre>
820      *
821      * <code>
822      * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
823      * </code>
824      *
825      * @return The bytes for name.
826      */
getNameBytes()827     public com.google.protobuf.ByteString getNameBytes() {
828       java.lang.Object ref = name_;
829       if (ref instanceof String) {
830         com.google.protobuf.ByteString b =
831             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
832         name_ = b;
833         return b;
834       } else {
835         return (com.google.protobuf.ByteString) ref;
836       }
837     }
838     /**
839      *
840      *
841      * <pre>
842      * Required. Name of the model requested to serve the prediction.
843      * </pre>
844      *
845      * <code>
846      * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
847      * </code>
848      *
849      * @param value The name to set.
850      * @return This builder for chaining.
851      */
setName(java.lang.String value)852     public Builder setName(java.lang.String value) {
853       if (value == null) {
854         throw new NullPointerException();
855       }
856       name_ = value;
857       bitField0_ |= 0x00000001;
858       onChanged();
859       return this;
860     }
861     /**
862      *
863      *
864      * <pre>
865      * Required. Name of the model requested to serve the prediction.
866      * </pre>
867      *
868      * <code>
869      * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
870      * </code>
871      *
872      * @return This builder for chaining.
873      */
clearName()874     public Builder clearName() {
875       name_ = getDefaultInstance().getName();
876       bitField0_ = (bitField0_ & ~0x00000001);
877       onChanged();
878       return this;
879     }
880     /**
881      *
882      *
883      * <pre>
884      * Required. Name of the model requested to serve the prediction.
885      * </pre>
886      *
887      * <code>
888      * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
889      * </code>
890      *
891      * @param value The bytes for name to set.
892      * @return This builder for chaining.
893      */
setNameBytes(com.google.protobuf.ByteString value)894     public Builder setNameBytes(com.google.protobuf.ByteString value) {
895       if (value == null) {
896         throw new NullPointerException();
897       }
898       checkByteStringIsUtf8(value);
899       name_ = value;
900       bitField0_ |= 0x00000001;
901       onChanged();
902       return this;
903     }
904 
905     private com.google.cloud.automl.v1beta1.ExamplePayload payload_;
906     private com.google.protobuf.SingleFieldBuilderV3<
907             com.google.cloud.automl.v1beta1.ExamplePayload,
908             com.google.cloud.automl.v1beta1.ExamplePayload.Builder,
909             com.google.cloud.automl.v1beta1.ExamplePayloadOrBuilder>
910         payloadBuilder_;
911     /**
912      *
913      *
914      * <pre>
915      * Required. Payload to perform a prediction on. The payload must match the
916      * problem type that the model was trained to solve.
917      * </pre>
918      *
919      * <code>
920      * .google.cloud.automl.v1beta1.ExamplePayload payload = 2 [(.google.api.field_behavior) = REQUIRED];
921      * </code>
922      *
923      * @return Whether the payload field is set.
924      */
hasPayload()925     public boolean hasPayload() {
926       return ((bitField0_ & 0x00000002) != 0);
927     }
928     /**
929      *
930      *
931      * <pre>
932      * Required. Payload to perform a prediction on. The payload must match the
933      * problem type that the model was trained to solve.
934      * </pre>
935      *
936      * <code>
937      * .google.cloud.automl.v1beta1.ExamplePayload payload = 2 [(.google.api.field_behavior) = REQUIRED];
938      * </code>
939      *
940      * @return The payload.
941      */
getPayload()942     public com.google.cloud.automl.v1beta1.ExamplePayload getPayload() {
943       if (payloadBuilder_ == null) {
944         return payload_ == null
945             ? com.google.cloud.automl.v1beta1.ExamplePayload.getDefaultInstance()
946             : payload_;
947       } else {
948         return payloadBuilder_.getMessage();
949       }
950     }
951     /**
952      *
953      *
954      * <pre>
955      * Required. Payload to perform a prediction on. The payload must match the
956      * problem type that the model was trained to solve.
957      * </pre>
958      *
959      * <code>
960      * .google.cloud.automl.v1beta1.ExamplePayload payload = 2 [(.google.api.field_behavior) = REQUIRED];
961      * </code>
962      */
setPayload(com.google.cloud.automl.v1beta1.ExamplePayload value)963     public Builder setPayload(com.google.cloud.automl.v1beta1.ExamplePayload value) {
964       if (payloadBuilder_ == null) {
965         if (value == null) {
966           throw new NullPointerException();
967         }
968         payload_ = value;
969       } else {
970         payloadBuilder_.setMessage(value);
971       }
972       bitField0_ |= 0x00000002;
973       onChanged();
974       return this;
975     }
976     /**
977      *
978      *
979      * <pre>
980      * Required. Payload to perform a prediction on. The payload must match the
981      * problem type that the model was trained to solve.
982      * </pre>
983      *
984      * <code>
985      * .google.cloud.automl.v1beta1.ExamplePayload payload = 2 [(.google.api.field_behavior) = REQUIRED];
986      * </code>
987      */
setPayload( com.google.cloud.automl.v1beta1.ExamplePayload.Builder builderForValue)988     public Builder setPayload(
989         com.google.cloud.automl.v1beta1.ExamplePayload.Builder builderForValue) {
990       if (payloadBuilder_ == null) {
991         payload_ = builderForValue.build();
992       } else {
993         payloadBuilder_.setMessage(builderForValue.build());
994       }
995       bitField0_ |= 0x00000002;
996       onChanged();
997       return this;
998     }
999     /**
1000      *
1001      *
1002      * <pre>
1003      * Required. Payload to perform a prediction on. The payload must match the
1004      * problem type that the model was trained to solve.
1005      * </pre>
1006      *
1007      * <code>
1008      * .google.cloud.automl.v1beta1.ExamplePayload payload = 2 [(.google.api.field_behavior) = REQUIRED];
1009      * </code>
1010      */
mergePayload(com.google.cloud.automl.v1beta1.ExamplePayload value)1011     public Builder mergePayload(com.google.cloud.automl.v1beta1.ExamplePayload value) {
1012       if (payloadBuilder_ == null) {
1013         if (((bitField0_ & 0x00000002) != 0)
1014             && payload_ != null
1015             && payload_ != com.google.cloud.automl.v1beta1.ExamplePayload.getDefaultInstance()) {
1016           getPayloadBuilder().mergeFrom(value);
1017         } else {
1018           payload_ = value;
1019         }
1020       } else {
1021         payloadBuilder_.mergeFrom(value);
1022       }
1023       bitField0_ |= 0x00000002;
1024       onChanged();
1025       return this;
1026     }
1027     /**
1028      *
1029      *
1030      * <pre>
1031      * Required. Payload to perform a prediction on. The payload must match the
1032      * problem type that the model was trained to solve.
1033      * </pre>
1034      *
1035      * <code>
1036      * .google.cloud.automl.v1beta1.ExamplePayload payload = 2 [(.google.api.field_behavior) = REQUIRED];
1037      * </code>
1038      */
clearPayload()1039     public Builder clearPayload() {
1040       bitField0_ = (bitField0_ & ~0x00000002);
1041       payload_ = null;
1042       if (payloadBuilder_ != null) {
1043         payloadBuilder_.dispose();
1044         payloadBuilder_ = null;
1045       }
1046       onChanged();
1047       return this;
1048     }
1049     /**
1050      *
1051      *
1052      * <pre>
1053      * Required. Payload to perform a prediction on. The payload must match the
1054      * problem type that the model was trained to solve.
1055      * </pre>
1056      *
1057      * <code>
1058      * .google.cloud.automl.v1beta1.ExamplePayload payload = 2 [(.google.api.field_behavior) = REQUIRED];
1059      * </code>
1060      */
getPayloadBuilder()1061     public com.google.cloud.automl.v1beta1.ExamplePayload.Builder getPayloadBuilder() {
1062       bitField0_ |= 0x00000002;
1063       onChanged();
1064       return getPayloadFieldBuilder().getBuilder();
1065     }
1066     /**
1067      *
1068      *
1069      * <pre>
1070      * Required. Payload to perform a prediction on. The payload must match the
1071      * problem type that the model was trained to solve.
1072      * </pre>
1073      *
1074      * <code>
1075      * .google.cloud.automl.v1beta1.ExamplePayload payload = 2 [(.google.api.field_behavior) = REQUIRED];
1076      * </code>
1077      */
getPayloadOrBuilder()1078     public com.google.cloud.automl.v1beta1.ExamplePayloadOrBuilder getPayloadOrBuilder() {
1079       if (payloadBuilder_ != null) {
1080         return payloadBuilder_.getMessageOrBuilder();
1081       } else {
1082         return payload_ == null
1083             ? com.google.cloud.automl.v1beta1.ExamplePayload.getDefaultInstance()
1084             : payload_;
1085       }
1086     }
1087     /**
1088      *
1089      *
1090      * <pre>
1091      * Required. Payload to perform a prediction on. The payload must match the
1092      * problem type that the model was trained to solve.
1093      * </pre>
1094      *
1095      * <code>
1096      * .google.cloud.automl.v1beta1.ExamplePayload payload = 2 [(.google.api.field_behavior) = REQUIRED];
1097      * </code>
1098      */
1099     private com.google.protobuf.SingleFieldBuilderV3<
1100             com.google.cloud.automl.v1beta1.ExamplePayload,
1101             com.google.cloud.automl.v1beta1.ExamplePayload.Builder,
1102             com.google.cloud.automl.v1beta1.ExamplePayloadOrBuilder>
getPayloadFieldBuilder()1103         getPayloadFieldBuilder() {
1104       if (payloadBuilder_ == null) {
1105         payloadBuilder_ =
1106             new com.google.protobuf.SingleFieldBuilderV3<
1107                 com.google.cloud.automl.v1beta1.ExamplePayload,
1108                 com.google.cloud.automl.v1beta1.ExamplePayload.Builder,
1109                 com.google.cloud.automl.v1beta1.ExamplePayloadOrBuilder>(
1110                 getPayload(), getParentForChildren(), isClean());
1111         payload_ = null;
1112       }
1113       return payloadBuilder_;
1114     }
1115 
1116     private com.google.protobuf.MapField<java.lang.String, java.lang.String> params_;
1117 
internalGetParams()1118     private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetParams() {
1119       if (params_ == null) {
1120         return com.google.protobuf.MapField.emptyMapField(ParamsDefaultEntryHolder.defaultEntry);
1121       }
1122       return params_;
1123     }
1124 
1125     private com.google.protobuf.MapField<java.lang.String, java.lang.String>
internalGetMutableParams()1126         internalGetMutableParams() {
1127       if (params_ == null) {
1128         params_ = com.google.protobuf.MapField.newMapField(ParamsDefaultEntryHolder.defaultEntry);
1129       }
1130       if (!params_.isMutable()) {
1131         params_ = params_.copy();
1132       }
1133       bitField0_ |= 0x00000004;
1134       onChanged();
1135       return params_;
1136     }
1137 
getParamsCount()1138     public int getParamsCount() {
1139       return internalGetParams().getMap().size();
1140     }
1141     /**
1142      *
1143      *
1144      * <pre>
1145      * Additional domain-specific parameters, any string must be up to 25000
1146      * characters long.
1147      * *  For Image Classification:
1148      *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
1149      *     makes predictions for an image, it will only produce results that have
1150      *     at least this confidence score. The default is 0.5.
1151      *  *  For Image Object Detection:
1152      *    `score_threshold` - (float) When Model detects objects on the image,
1153      *        it will only produce bounding boxes which have at least this
1154      *        confidence score. Value in 0 to 1 range, default is 0.5.
1155      *    `max_bounding_box_count` - (int64) No more than this number of bounding
1156      *        boxes will be returned in the response. Default is 100, the
1157      *        requested value may be limited by server.
1158      * *  For Tables:
1159      *    feature_imp&lt;span&gt;ortan&lt;/span&gt;ce - (boolean) Whether feature importance
1160      *        should be populated in the returned TablesAnnotation.
1161      *        The default is false.
1162      * </pre>
1163      *
1164      * <code>map&lt;string, string&gt; params = 3;</code>
1165      */
1166     @java.lang.Override
containsParams(java.lang.String key)1167     public boolean containsParams(java.lang.String key) {
1168       if (key == null) {
1169         throw new NullPointerException("map key");
1170       }
1171       return internalGetParams().getMap().containsKey(key);
1172     }
1173     /** Use {@link #getParamsMap()} instead. */
1174     @java.lang.Override
1175     @java.lang.Deprecated
getParams()1176     public java.util.Map<java.lang.String, java.lang.String> getParams() {
1177       return getParamsMap();
1178     }
1179     /**
1180      *
1181      *
1182      * <pre>
1183      * Additional domain-specific parameters, any string must be up to 25000
1184      * characters long.
1185      * *  For Image Classification:
1186      *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
1187      *     makes predictions for an image, it will only produce results that have
1188      *     at least this confidence score. The default is 0.5.
1189      *  *  For Image Object Detection:
1190      *    `score_threshold` - (float) When Model detects objects on the image,
1191      *        it will only produce bounding boxes which have at least this
1192      *        confidence score. Value in 0 to 1 range, default is 0.5.
1193      *    `max_bounding_box_count` - (int64) No more than this number of bounding
1194      *        boxes will be returned in the response. Default is 100, the
1195      *        requested value may be limited by server.
1196      * *  For Tables:
1197      *    feature_imp&lt;span&gt;ortan&lt;/span&gt;ce - (boolean) Whether feature importance
1198      *        should be populated in the returned TablesAnnotation.
1199      *        The default is false.
1200      * </pre>
1201      *
1202      * <code>map&lt;string, string&gt; params = 3;</code>
1203      */
1204     @java.lang.Override
getParamsMap()1205     public java.util.Map<java.lang.String, java.lang.String> getParamsMap() {
1206       return internalGetParams().getMap();
1207     }
1208     /**
1209      *
1210      *
1211      * <pre>
1212      * Additional domain-specific parameters, any string must be up to 25000
1213      * characters long.
1214      * *  For Image Classification:
1215      *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
1216      *     makes predictions for an image, it will only produce results that have
1217      *     at least this confidence score. The default is 0.5.
1218      *  *  For Image Object Detection:
1219      *    `score_threshold` - (float) When Model detects objects on the image,
1220      *        it will only produce bounding boxes which have at least this
1221      *        confidence score. Value in 0 to 1 range, default is 0.5.
1222      *    `max_bounding_box_count` - (int64) No more than this number of bounding
1223      *        boxes will be returned in the response. Default is 100, the
1224      *        requested value may be limited by server.
1225      * *  For Tables:
1226      *    feature_imp&lt;span&gt;ortan&lt;/span&gt;ce - (boolean) Whether feature importance
1227      *        should be populated in the returned TablesAnnotation.
1228      *        The default is false.
1229      * </pre>
1230      *
1231      * <code>map&lt;string, string&gt; params = 3;</code>
1232      */
1233     @java.lang.Override
getParamsOrDefault( java.lang.String key, java.lang.String defaultValue)1234     public /* nullable */ java.lang.String getParamsOrDefault(
1235         java.lang.String key,
1236         /* nullable */
1237         java.lang.String defaultValue) {
1238       if (key == null) {
1239         throw new NullPointerException("map key");
1240       }
1241       java.util.Map<java.lang.String, java.lang.String> map = internalGetParams().getMap();
1242       return map.containsKey(key) ? map.get(key) : defaultValue;
1243     }
1244     /**
1245      *
1246      *
1247      * <pre>
1248      * Additional domain-specific parameters, any string must be up to 25000
1249      * characters long.
1250      * *  For Image Classification:
1251      *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
1252      *     makes predictions for an image, it will only produce results that have
1253      *     at least this confidence score. The default is 0.5.
1254      *  *  For Image Object Detection:
1255      *    `score_threshold` - (float) When Model detects objects on the image,
1256      *        it will only produce bounding boxes which have at least this
1257      *        confidence score. Value in 0 to 1 range, default is 0.5.
1258      *    `max_bounding_box_count` - (int64) No more than this number of bounding
1259      *        boxes will be returned in the response. Default is 100, the
1260      *        requested value may be limited by server.
1261      * *  For Tables:
1262      *    feature_imp&lt;span&gt;ortan&lt;/span&gt;ce - (boolean) Whether feature importance
1263      *        should be populated in the returned TablesAnnotation.
1264      *        The default is false.
1265      * </pre>
1266      *
1267      * <code>map&lt;string, string&gt; params = 3;</code>
1268      */
1269     @java.lang.Override
getParamsOrThrow(java.lang.String key)1270     public java.lang.String getParamsOrThrow(java.lang.String key) {
1271       if (key == null) {
1272         throw new NullPointerException("map key");
1273       }
1274       java.util.Map<java.lang.String, java.lang.String> map = internalGetParams().getMap();
1275       if (!map.containsKey(key)) {
1276         throw new java.lang.IllegalArgumentException();
1277       }
1278       return map.get(key);
1279     }
1280 
clearParams()1281     public Builder clearParams() {
1282       bitField0_ = (bitField0_ & ~0x00000004);
1283       internalGetMutableParams().getMutableMap().clear();
1284       return this;
1285     }
1286     /**
1287      *
1288      *
1289      * <pre>
1290      * Additional domain-specific parameters, any string must be up to 25000
1291      * characters long.
1292      * *  For Image Classification:
1293      *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
1294      *     makes predictions for an image, it will only produce results that have
1295      *     at least this confidence score. The default is 0.5.
1296      *  *  For Image Object Detection:
1297      *    `score_threshold` - (float) When Model detects objects on the image,
1298      *        it will only produce bounding boxes which have at least this
1299      *        confidence score. Value in 0 to 1 range, default is 0.5.
1300      *    `max_bounding_box_count` - (int64) No more than this number of bounding
1301      *        boxes will be returned in the response. Default is 100, the
1302      *        requested value may be limited by server.
1303      * *  For Tables:
1304      *    feature_imp&lt;span&gt;ortan&lt;/span&gt;ce - (boolean) Whether feature importance
1305      *        should be populated in the returned TablesAnnotation.
1306      *        The default is false.
1307      * </pre>
1308      *
1309      * <code>map&lt;string, string&gt; params = 3;</code>
1310      */
removeParams(java.lang.String key)1311     public Builder removeParams(java.lang.String key) {
1312       if (key == null) {
1313         throw new NullPointerException("map key");
1314       }
1315       internalGetMutableParams().getMutableMap().remove(key);
1316       return this;
1317     }
1318     /** Use alternate mutation accessors instead. */
1319     @java.lang.Deprecated
getMutableParams()1320     public java.util.Map<java.lang.String, java.lang.String> getMutableParams() {
1321       bitField0_ |= 0x00000004;
1322       return internalGetMutableParams().getMutableMap();
1323     }
1324     /**
1325      *
1326      *
1327      * <pre>
1328      * Additional domain-specific parameters, any string must be up to 25000
1329      * characters long.
1330      * *  For Image Classification:
1331      *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
1332      *     makes predictions for an image, it will only produce results that have
1333      *     at least this confidence score. The default is 0.5.
1334      *  *  For Image Object Detection:
1335      *    `score_threshold` - (float) When Model detects objects on the image,
1336      *        it will only produce bounding boxes which have at least this
1337      *        confidence score. Value in 0 to 1 range, default is 0.5.
1338      *    `max_bounding_box_count` - (int64) No more than this number of bounding
1339      *        boxes will be returned in the response. Default is 100, the
1340      *        requested value may be limited by server.
1341      * *  For Tables:
1342      *    feature_imp&lt;span&gt;ortan&lt;/span&gt;ce - (boolean) Whether feature importance
1343      *        should be populated in the returned TablesAnnotation.
1344      *        The default is false.
1345      * </pre>
1346      *
1347      * <code>map&lt;string, string&gt; params = 3;</code>
1348      */
putParams(java.lang.String key, java.lang.String value)1349     public Builder putParams(java.lang.String key, java.lang.String value) {
1350       if (key == null) {
1351         throw new NullPointerException("map key");
1352       }
1353       if (value == null) {
1354         throw new NullPointerException("map value");
1355       }
1356       internalGetMutableParams().getMutableMap().put(key, value);
1357       bitField0_ |= 0x00000004;
1358       return this;
1359     }
1360     /**
1361      *
1362      *
1363      * <pre>
1364      * Additional domain-specific parameters, any string must be up to 25000
1365      * characters long.
1366      * *  For Image Classification:
1367      *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
1368      *     makes predictions for an image, it will only produce results that have
1369      *     at least this confidence score. The default is 0.5.
1370      *  *  For Image Object Detection:
1371      *    `score_threshold` - (float) When Model detects objects on the image,
1372      *        it will only produce bounding boxes which have at least this
1373      *        confidence score. Value in 0 to 1 range, default is 0.5.
1374      *    `max_bounding_box_count` - (int64) No more than this number of bounding
1375      *        boxes will be returned in the response. Default is 100, the
1376      *        requested value may be limited by server.
1377      * *  For Tables:
1378      *    feature_imp&lt;span&gt;ortan&lt;/span&gt;ce - (boolean) Whether feature importance
1379      *        should be populated in the returned TablesAnnotation.
1380      *        The default is false.
1381      * </pre>
1382      *
1383      * <code>map&lt;string, string&gt; params = 3;</code>
1384      */
putAllParams(java.util.Map<java.lang.String, java.lang.String> values)1385     public Builder putAllParams(java.util.Map<java.lang.String, java.lang.String> values) {
1386       internalGetMutableParams().getMutableMap().putAll(values);
1387       bitField0_ |= 0x00000004;
1388       return this;
1389     }
1390 
1391     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1392     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1393       return super.setUnknownFields(unknownFields);
1394     }
1395 
1396     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1397     public final Builder mergeUnknownFields(
1398         final com.google.protobuf.UnknownFieldSet unknownFields) {
1399       return super.mergeUnknownFields(unknownFields);
1400     }
1401 
1402     // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.PredictRequest)
1403   }
1404 
1405   // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.PredictRequest)
1406   private static final com.google.cloud.automl.v1beta1.PredictRequest DEFAULT_INSTANCE;
1407 
1408   static {
1409     DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.PredictRequest();
1410   }
1411 
getDefaultInstance()1412   public static com.google.cloud.automl.v1beta1.PredictRequest getDefaultInstance() {
1413     return DEFAULT_INSTANCE;
1414   }
1415 
1416   private static final com.google.protobuf.Parser<PredictRequest> PARSER =
1417       new com.google.protobuf.AbstractParser<PredictRequest>() {
1418         @java.lang.Override
1419         public PredictRequest parsePartialFrom(
1420             com.google.protobuf.CodedInputStream input,
1421             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1422             throws com.google.protobuf.InvalidProtocolBufferException {
1423           Builder builder = newBuilder();
1424           try {
1425             builder.mergeFrom(input, extensionRegistry);
1426           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1427             throw e.setUnfinishedMessage(builder.buildPartial());
1428           } catch (com.google.protobuf.UninitializedMessageException e) {
1429             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1430           } catch (java.io.IOException e) {
1431             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1432                 .setUnfinishedMessage(builder.buildPartial());
1433           }
1434           return builder.buildPartial();
1435         }
1436       };
1437 
parser()1438   public static com.google.protobuf.Parser<PredictRequest> parser() {
1439     return PARSER;
1440   }
1441 
1442   @java.lang.Override
getParserForType()1443   public com.google.protobuf.Parser<PredictRequest> getParserForType() {
1444     return PARSER;
1445   }
1446 
1447   @java.lang.Override
getDefaultInstanceForType()1448   public com.google.cloud.automl.v1beta1.PredictRequest getDefaultInstanceForType() {
1449     return DEFAULT_INSTANCE;
1450   }
1451 }
1452