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